diff --git a/notNeededPackages.json b/notNeededPackages.json index fd7868f2ae..7683c07522 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1590,6 +1590,12 @@ "sourceRepoURL": "https://github.com/sourcelair/xterm.js/", "asOfVersion": "3.0.0" }, + { + "libraryName": "yFiles for HTML", + "typingsPackageName": "yfiles", + "sourceRepoURL": "none", + "asOfVersion": "2.1.0" + }, { "libraryName": "zetapush-js", "typingsPackageName": "zetapush-js", diff --git a/types/activex-diskquota/activex-diskquota-tests.ts b/types/activex-diskquota/activex-diskquota-tests.ts new file mode 100644 index 0000000000..2672b590ca --- /dev/null +++ b/types/activex-diskquota/activex-diskquota-tests.ts @@ -0,0 +1,44 @@ +const collectionToArray = (col: any) => { // tslint:disable-line no-unnecessary-generics + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787925(v=vs.85).aspx +(() => { + const enumUsers = (label: string) => { + const volume = new ActiveXObject('Microsoft.DiskQuota'); + volume.Initialize(label, true); + collectionToArray(volume).forEach(x => { + // Use the QuotaUser object to retrieve or set one or more of the user's disk quota properties + }); + }; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787916(v=vs.85).aspx +(() => { + const volume = new ActiveXObject('Microsoft.DiskQuota'); + volume.Initialize('MYDISK', true); + ActiveXObject.on(volume, 'OnUserNameChanged', ['pUser'], p => { + // Code to handle the event. + }); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787904(v=vs.85).aspx +(() => { + const dqc = new ActiveXObject('Microsoft.DiskQuota'); + dqc.Initialize('MYDISK', true); + const findName = (name: string) => { + try { + return dqc.FindUser(name); + } catch { } + try { + return dqc.FindUser(dqc.TranslateLogonNameToSID(name)); + } catch { } + }; +})(); diff --git a/types/activex-diskquota/index.d.ts b/types/activex-diskquota/index.d.ts new file mode 100644 index 0000000000..d27863de3c --- /dev/null +++ b/types/activex-diskquota/index.d.ts @@ -0,0 +1,152 @@ +// Type definitions for DiskQuotaTypeLibrary 1.0 +// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 + +declare namespace DiskQuotaTypeLibrary { + // tslint:disable-next-line no-const-enum + const enum AccountStatusConstants { + dqAcctDeleted = 2, + dqAcctInvalid = 3, + dqAcctResolved = 0, + dqAcctUnavailable = 1, + dqAcctUnknown = 4, + dqAcctUnresolved = 5, + } + + // tslint:disable-next-line no-const-enum + const enum QuotaStateConstants { + dqStateDisable = 0, + dqStateEnforce = 2, + dqStateTrack = 1, + } + + // tslint:disable-next-line no-const-enum + const enum UserNameResolutionConstants { + dqResolveAsync = 2, + dqResolveNone = 0, + dqResolveSync = 1, + } + + /** Automation interface for DiskQuotaUser */ + class DIDiskQuotaUser { + private 'DiskQuotaTypeLibrary.DIDiskQuotaUser_typekey': DIDiskQuotaUser; + private constructor(); + + /** Name of user's account container */ + readonly AccountContainerName: string; + + /** Status of user's account */ + readonly AccountStatus: AccountStatusConstants; + + /** User's display name */ + readonly DisplayName: string; + + /** Unique ID number */ + readonly ID: number; + + /** Invalidate data cached in user object */ + Invalidate(): void; + + /** User's logon account name */ + readonly LogonName: string; + + /** User's quota limit (bytes) */ + QuotaLimit: number; + + /** User's quota limit (text) */ + readonly QuotaLimitText: string; + + /** User's quota warning threshold (bytes) */ + QuotaThreshold: number; + + /** User's quota warning threshold (text) */ + readonly QuotaThresholdText: string; + + /** Quota charged to user (bytes) */ + readonly QuotaUsed: number; + + /** Quota charged to user (text) */ + readonly QuotaUsedText: string; + } + + /** Microsoft Disk Quota */ + class DiskQuotaControl { + private 'DiskQuotaTypeLibrary.DiskQuotaControl_typekey': DiskQuotaControl; + private constructor(); + + /** Add a user quota entry by Name */ + AddUser(LogonName: string): DIDiskQuotaUser; + + /** Default quota limit applied to new volume users (byte value) */ + DefaultQuotaLimit: number; + + /** Default quota limit applied to new volume users (text string) */ + readonly DefaultQuotaLimitText: string; + + /** Default warning threshold applied to new volume users (byte value) */ + DefaultQuotaThreshold: number; + + /** Default warning threshold applied to new volume users (text string) */ + readonly DefaultQuotaThresholdText: string; + + /** Delete a user quota entry */ + DeleteUser(pUser: DIDiskQuotaUser): void; + + /** Find a user quota entry by Name */ + FindUser(LogonName: string): DIDiskQuotaUser; + + /** Promote a user quota entry to the head of the name resolution queue */ + GiveUserNameResolutionPriority(pUser: DIDiskQuotaUser): void; + + /** Initialize the quota control object for a specified volume */ + Initialize(path: string, bReadWrite: boolean): void; + + /** Invalidate the cache of user name information */ + InvalidateSidNameCache(): void; + + /** Write event log entry when user exceeds quota limit */ + LogQuotaLimit: boolean; + + /** Write event log entry when user exceeds quota warning threshold */ + LogQuotaThreshold: boolean; + + /** Indicates if quota information is out of date */ + readonly QuotaFileIncomplete: boolean; + + /** Indicates if quota information is being rebuilt */ + readonly QuotaFileRebuilding: boolean; + + /** State of the volume's disk quota system */ + QuotaState: QuotaStateConstants; + + /** Terminate the user name resolution thread */ + ShutdownNameResolution(): void; + + /** Translates a user logon name to a security ID */ + TranslateLogonNameToSID(LogonName: string): string; + + /** Control the resolution of user Security IDs to user Names */ + UserNameResolution: UserNameResolutionConstants; + } +} + +interface ActiveXObject { + on( + obj: DiskQuotaTypeLibrary.DiskQuotaControl, event: 'OnUserNameChanged', argNames: ['pUser'], handler: ( + this: DiskQuotaTypeLibrary.DiskQuotaControl, parameter: {readonly pUser: DiskQuotaTypeLibrary.DIDiskQuotaUser}) => void): void; + new(progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'Microsoft.DiskQuota': DiskQuotaTypeLibrary.DiskQuotaControl; +} + +interface EnumeratorConstructor { + new(col: DiskQuotaTypeLibrary.DiskQuotaControl): Enumerator; +} + +interface SafeArray { + _brand: SafeArray; +} diff --git a/types/activex-diskquota/package.json b/types/activex-diskquota/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-diskquota/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-diskquota/tsconfig.json b/types/activex-diskquota/tsconfig.json new file mode 100644 index 0000000000..b7430e47f9 --- /dev/null +++ b/types/activex-diskquota/tsconfig.json @@ -0,0 +1,22 @@ + +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "scripthost"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "activex-diskquota-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-diskquota/tslint.json b/types/activex-diskquota/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-diskquota/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-shdocvw/activex-shdocvw-tests.ts b/types/activex-shdocvw/activex-shdocvw-tests.ts new file mode 100644 index 0000000000..713578fb06 --- /dev/null +++ b/types/activex-shdocvw/activex-shdocvw-tests.ts @@ -0,0 +1,12 @@ +// https://msdn.microsoft.com/en-us/library/aa752044(v=vs.85).aspx +(() => { + const ie = new ActiveXObject('InternetExplorer.Application'); + ie.Navigate('http://contoso.com'); + ie.Visible = true; +})(); + +let obj1 = new ActiveXObject('ShellNameSpace.ShellNameSpace'); + +let obj2 = new ActiveXObject('Shell.UIHelper'); + +let obj3 = new ActiveXObject('Shell.Explorer'); diff --git a/types/activex-shdocvw/index.d.ts b/types/activex-shdocvw/index.d.ts new file mode 100644 index 0000000000..86568f6c5d --- /dev/null +++ b/types/activex-shdocvw/index.d.ts @@ -0,0 +1,1577 @@ +// Type definitions for Microsoft Internet Controls - SHDocVw 1.1 +// Project: https://msdn.microsoft.com/en-us/library/aa752040(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +declare namespace SHDocVw { + // tslint:disable-next-line no-const-enum + const enum BrowserBarConstants { + AddressBar = 0x0009, + Tools = 0x000A, + Links = 0x000B, + Search = '{30D02401-6A81-11D0-8274-00C04FD5AE38}', + Favorites = '{EFA24E61-B078-11D0-89E4-00C04FC9E26E}', + History = '{EFA24E62-B078-11D0-89E4-00C04FC9E26E}', + Channels = '{EFA24E63-B078-11D0-89E4-00C04FC9E26E}' + } + + // tslint:disable-next-line no-const-enum + const enum BrowserNavConstants { + /** Open the resource or file in a new window. */ + OpenInNewWindow = 1, + + /** Do not add the resource or file to the history list. The new page replaces the current page in the list. */ + NoHistory = 2, + + /** If the navigation fails, the autosearch functionality attempts to navigate common root domains (.com, .edu, and so on). If this also fails, the URL is passed to a search engine. */ + AllowAutosearch = 16, + + /** Causes the current Explorer Bar to navigate to the given item, if possible. */ + BrowserBar = 32, + + /** + * Internet Explorer 6 for Windows XP SP2 and later. If the navigation fails when a hyperlink is being followed, this constant specifies that the resource should then be bound to the + * moniker using the [**BINDF_HYPERLINK**](https://msdn.microsoft.com/en-us/library/ms775130(v=vs.85).aspx) flag. + */ + Hyperlink = 64, + + /** Internet Explorer 6 for Windows XP SP2 and later. Force the URL into the restricted zone. */ + EnforceRestricted = 128, + + /** Internet Explorer 6 for Windows XP SP2 and later. Use the default Popup Manager to block pop-up windows. */ + NewWindowsManaged = 256, + + /** Internet Explorer 6 for Windows XP SP2 and later. Block files that normally trigger a file download dialog box. */ + UntrustedForDownload = 512, + + /** Internet Explorer 6 for Windows XP SP2 and later. Prompt for the installation of ActiveX controls. */ + TrustedForActiveX = 1024, + + /** Internet Explorer 7. Open the resource or file in a new tab. Allow the destination window to come to the foreground, if necessary. */ + OpenInNewTab = 2048, + + /** Internet Explorer 7. Open the resource or file in a new background tab; the currently active window and/or tab remains open on top. */ + OpenInBackgroundTab = 4096, + + /** + * Internet Explorer 7. Maintain state for dynamic navigation based on the filter string entered in the search band text box (wordwheel). Restore the wordwheel text when the navigation + * completes. + */ + KeepWordWheelText = 8192, + + /** + * Internet Explorer 8. Open the resource as a replacement for the current or target tab. The existing tab is closed while the new tab takes its place in the tab bar and replaces it in the + * tab group, if any. Browser history is copied forward to the new tab. On Windows Vista, this flag is implied if the navigation would cross integrity levels and **navOpenInNewTab**, + * **navOpenInBackgroundTab**, or **navOpenInNewWindow**> is not specified. + */ + VirtualTab = 16384, + + /** + * Internet Explorer 8. Block cross-domain redirect requests. The navigation triggers the + * [**DWebBrowserEvents2::RedirectXDomainBlocked**](https://msdn.microsoft.com/en-us/library/dd565686(v=vs.85).aspx) event if blocked. + */ + BlockRedirectsXDomain = 32768, + + /** Internet Explorer 8 and later. Open the resource in a new tab that becomes the foreground tab. */ + OpenNewForegroundTab = 65536 + } + + /** Constants for WebBrowser CommandStateChange */ + // tslint:disable-next-line no-const-enum + const enum CommandStateChangeConstants { + CSC_NAVIGATEBACK = 2, + CSC_NAVIGATEFORWARD = 1, + CSC_UPDATECOMMANDS = -1, + } + + /** Constants for WebBrowser NewProcess notification */ + // tslint:disable-next-line no-const-enum + const enum NewProcessCauseConstants { + ProtectedModeRedirect = 1, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDEXECOPT { + OLECMDEXECOPT_DODEFAULT = 0, + OLECMDEXECOPT_DONTPROMPTUSER = 2, + OLECMDEXECOPT_PROMPTUSER = 1, + OLECMDEXECOPT_SHOWHELP = 3, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDF { + OLECMDF_DEFHIDEONCTXTMENU = 32, + OLECMDF_ENABLED = 2, + OLECMDF_INVISIBLE = 16, + OLECMDF_LATCHED = 4, + OLECMDF_NINCHED = 8, + OLECMDF_SUPPORTED = 1, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDID { + OLECMDID_ACTIVEXINSTALLSCOPE = 66, + OLECMDID_ADDTRAVELENTRY = 60, + OLECMDID_ALLOWUILESSSAVEAS = 46, + OLECMDID_CLEARSELECTION = 18, + OLECMDID_CLOSE = 45, + OLECMDID_COPY = 12, + OLECMDID_CUT = 11, + OLECMDID_DELETE = 33, + OLECMDID_DONTDOWNLOADCSS = 47, + OLECMDID_ENABLE_INTERACTION = 36, + OLECMDID_ENABLE_VISIBILITY = 77, + OLECMDID_EXITFULLSCREEN = 81, + OLECMDID_FIND = 32, + OLECMDID_FOCUSVIEWCONTROLS = 57, + OLECMDID_FOCUSVIEWCONTROLSQUERY = 58, + OLECMDID_GETPRINTTEMPLATE = 52, + OLECMDID_GETUSERSCALABLE = 75, + OLECMDID_GETZOOMRANGE = 20, + OLECMDID_HIDETOOLBARS = 24, + OLECMDID_HTTPEQUIV = 34, + OLECMDID_HTTPEQUIV_DONE = 35, + OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71, + OLECMDID_MEDIA_PLAYBACK = 78, + OLECMDID_NEW = 2, + OLECMDID_ONBEFOREUNLOAD = 83, + OLECMDID_ONTOOLBARACTIVATED = 31, + OLECMDID_ONUNLOAD = 37, + OLECMDID_OPEN = 1, + OLECMDID_OPTICAL_GETZOOMRANGE = 64, + OLECMDID_OPTICAL_ZOOM = 63, + OLECMDID_PAGEACTIONBLOCKED = 55, + OLECMDID_PAGEACTIONUIQUERY = 56, + OLECMDID_PAGEAVAILABLE = 74, + OLECMDID_PAGESETUP = 8, + OLECMDID_PASTE = 13, + OLECMDID_PASTESPECIAL = 14, + OLECMDID_POPSTATEEVENT = 69, + OLECMDID_PREREFRESH = 39, + OLECMDID_PRINT = 6, + OLECMDID_PRINT2 = 49, + OLECMDID_PRINTPREVIEW = 7, + OLECMDID_PRINTPREVIEW2 = 50, + OLECMDID_PROPERTIES = 10, + OLECMDID_PROPERTYBAG2 = 38, + OLECMDID_REDO = 16, + OLECMDID_REFRESH = 22, + OLECMDID_SAVE = 3, + OLECMDID_SAVEAS = 4, + OLECMDID_SAVECOPYAS = 5, + OLECMDID_SCROLLCOMPLETE = 82, + OLECMDID_SELECTALL = 17, + OLECMDID_SET_HOST_FULLSCREENMODE = 80, + OLECMDID_SETDOWNLOADSTATE = 29, + OLECMDID_SETFAVICON = 79, + OLECMDID_SETPRINTTEMPLATE = 51, + OLECMDID_SETPROGRESSMAX = 25, + OLECMDID_SETPROGRESSPOS = 26, + OLECMDID_SETPROGRESSTEXT = 27, + OLECMDID_SETTITLE = 28, + OLECMDID_SHOWFIND = 42, + OLECMDID_SHOWMESSAGE = 41, + OLECMDID_SHOWMESSAGE_BLOCKABLE = 84, + OLECMDID_SHOWPAGEACTIONMENU = 59, + OLECMDID_SHOWPAGESETUP = 43, + OLECMDID_SHOWPRINT = 44, + OLECMDID_SHOWSCRIPTERROR = 40, + OLECMDID_SHOWTASKDLG = 68, + OLECMDID_SHOWTASKDLG_BLOCKABLE = 85, + OLECMDID_SPELL = 9, + OLECMDID_STOP = 23, + OLECMDID_STOPDOWNLOAD = 30, + OLECMDID_UNDO = 15, + OLECMDID_UPDATE_CARET = 76, + OLECMDID_UPDATEBACKFORWARDSTATE = 62, + OLECMDID_UPDATECOMMANDS = 21, + OLECMDID_UPDATEPAGESTATUS = 48, + OLECMDID_UPDATETRAVELENTRY = 61, + OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67, + OLECMDID_USER_OPTICAL_ZOOM = 73, + OLECMDID_VIEWPORT_MODE = 70, + OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72, + OLECMDID_WINDOWSTATECHANGED = 65, + OLECMDID_ZOOM = 19, + } + + // tslint:disable-next-line no-const-enum + const enum RefreshConstants { + Normal = 0, + IfExpired = 1, + Completely = 3 + } + + /** Constants for WebBrowser security icon notification */ + // tslint:disable-next-line no-const-enum + const enum SecureLockIconConstants { + secureLockIconMixed = 1, + secureLockIconSecure128Bit = 6, + secureLockIconSecure40Bit = 3, + secureLockIconSecure56Bit = 4, + secureLockIconSecureFortezza = 5, + secureLockIconSecureUnknownBits = 2, + secureLockIconUnsecure = 0, + } + + /** Options for ShellWindows FindWindow */ + // tslint:disable-next-line no-const-enum + const enum ShellWindowFindWindowOptions { + SWFO_COOKIEPASSED = 4, + SWFO_INCLUDEPENDING = 2, + SWFO_NEEDDISPATCH = 1, + } + + /** Constants for ShellWindows registration */ + // tslint:disable-next-line no-const-enum + const enum ShellWindowTypeConstants { + SWC_3RDPARTY = 2, + SWC_BROWSER = 1, + SWC_CALLBACK = 4, + SWC_DESKTOP = 8, + SWC_EXPLORER = 0, + } + + // tslint:disable-next-line no-const-enum + const enum tagREADYSTATE { + READYSTATE_COMPLETE = 4, + READYSTATE_INTERACTIVE = 3, + READYSTATE_LOADED = 2, + READYSTATE_LOADING = 1, + READYSTATE_UNINITIALIZED = 0, + } + + type TargetFrameValues = '_blank' | '_parent' | '_self' | '_top' ; + + class CScriptErrorList { + private 'SHDocVw.CScriptErrorList_typekey': CScriptErrorList; + private constructor(); + advanceError(): void; + canAdvanceError(): number; + canRetreatError(): number; + getAlwaysShowLockState(): number; + getDetailsPaneOpen(): number; + getErrorChar(): number; + getErrorCode(): number; + getErrorLine(): number; + getErrorMsg(): string; + getErrorUrl(): string; + getPerErrorDisplay(): number; + retreatError(): void; + setDetailsPaneOpen(fDetailsPaneOpen: number): void; + setPerErrorDisplay(fPerErrorDisplay: number): void; + } + + /** Internet Explorer Application. */ + class InternetExplorer { + private 'SHDocVw.InternetExplorer_typekey': InternetExplorer; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** Internet Explorer Application with default integrity of Medium */ + class InternetExplorerMedium { + private 'SHDocVw.InternetExplorerMedium_typekey': InternetExplorerMedium; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** Shell Browser Window. */ + class ShellBrowserWindow { + private 'SHDocVw.ShellBrowserWindow_typekey': ShellBrowserWindow; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + class ShellNameSpace { + private 'SHDocVw.ShellNameSpace_typekey': ShellNameSpace; + private constructor(); + Columns: string; + + /** number of view types */ + readonly CountViewTypes: number; + + /** method CreateSubscriptionForSelection */ + CreateSubscriptionForSelection(): boolean; + + /** method DeleteSubscriptionForSelection */ + DeleteSubscriptionForSelection(): boolean; + Depth: number; + + /** options */ + EnumOptions: number; + + /** expands item specified depth */ + Expand(var_0: any, iDepth: number): void; + + /** method Export */ + Export(): void; + Flags: number; + + /** method Import */ + Import(): void; + + /** method InvokeContextMenuCommand */ + InvokeContextMenuCommand(strCommand: string): void; + Mode: number; + + /** method MoveSelectionDown */ + MoveSelectionDown(): void; + + /** method MoveSelectionTo */ + MoveSelectionTo(): void; + + /** method MoveSelectionUp */ + MoveSelectionUp(): void; + + /** method NewFolder */ + NewFolder(): void; + + /** method ResetSort */ + ResetSort(): void; + + /** get the root item */ + Root: any; + + /** get the selected item */ + SelectedItem: any; + + /** collection of selected items */ + SelectedItems(): any; + + /** old, use put_Root() instead */ + SetRoot(bstrFullPath: string): void; + + /** set view type */ + SetViewType(iType: number): void; + + /** Query to see if subscriptions are enabled */ + readonly SubscriptionsEnabled: boolean; + + /** method Synchronize */ + Synchronize(): void; + TVFlags: number; + + /** unselects all items */ + UnselectAll(): void; + } + + class ShellUIHelper { + private 'SHDocVw.ShellUIHelper_typekey': ShellUIHelper; + private constructor(); + AddChannel(URL: string): void; + AddDesktopComponent(URL: string, Type: string, Left?: any, Top?: any, Width?: any, Height?: any): void; + AddFavorite(URL: string, Title?: any): void; + AddSearchProvider(URL: string): void; + AddService(URL: string): void; + AddToFavoritesBar(URL: string, Title: string, Type?: any): void; + AutoCompleteAttach(Reserved?: any): void; + AutoCompleteSaveForm(Form?: any): void; + AutoScan(strSearch: string, strFailureUrl: string, pvarTargetFrame?: any): void; + BrandImageUri(): string; + BuildNewTabPage(): void; + ContentDiscoveryReset(): void; + CustomizeClearType(fSet: boolean): void; + CustomizeSettings(fSQM: boolean, fPhishing: boolean, bstrLocale: string): void; + DefaultSearchProvider(): string; + DiagnoseConnection(): void; + EnableSuggestedSites(fEnable: boolean): void; + GetCVListData(): string; + GetCVListLocalData(): string; + GetEMIEListData(): string; + GetEMIEListLocalData(): string; + GetExperimentalFlag(bstrFlagString: string): boolean; + GetExperimentalValue(bstrValueString: string): number; + GetNeedIEAutoLaunchFlag(bstrUrl: string): boolean; + HasNeedIEAutoLaunchFlag(bstrUrl: string): boolean; + ImportExportFavorites(fImport: boolean, strImpExpPath: string): void; + InPrivateFilteringEnabled(): boolean; + IsSearchMigrated(): boolean; + IsSearchProviderInstalled(URL: string): number; + IsServiceInstalled(URL: string, Verb: string): number; + IsSubscribed(URL: string): boolean; + IsSuggestedSitesEnabled(): boolean; + LaunchIE(bstrUrl: string, automated: boolean): void; + LaunchInHVSI(bstrUrl: string): void; + msActiveXFilteringEnabled(): boolean; + msAddSiteMode(): void; + msAddTrackingProtectionList(URL: string, bstrFilterName: string): void; + msChangeDefaultBrowser(fChange: boolean): void; + msClearTile(): void; + msDiagnoseConnectionUILess(): void; + msEnableTileNotificationQueue(fChange: boolean): void; + msEnableTileNotificationQueueForSquare150x150(fChange: boolean): void; + msEnableTileNotificationQueueForSquare310x310(fChange: boolean): void; + msEnableTileNotificationQueueForWide310x150(fChange: boolean): void; + msIsSiteMode(): boolean; + msIsSiteModeFirstRun(fPreserveState: boolean): any; + msLaunchInternetOptions(): void; + msLaunchNetworkClientHelp(): void; + msPinnedSiteState(): any; + msProvisionNetworks(bstrProvisioningXml: string): any; + msRemoveScheduledTileNotification(bstrNotificationId: string): void; + msReportSafeUrl(): void; + msScheduledTileNotification(bstrNotificationXml: string, bstrNotificationId: string, bstrNotificationTag: string, startTime?: any, expirationTime?: any): void; + msSiteModeActivate(): void; + msSiteModeAddButtonStyle(uiButtonID: any, bstrIconURL: string, bstrTooltip: string): any; + msSiteModeAddJumpListItem(bstrName: string, bstrActionUri: string, bstrIconUri: string, pvarWindowType?: any): void; + msSiteModeAddThumbBarButton(bstrIconURL: string, bstrTooltip: string): any; + msSiteModeClearBadge(): void; + msSiteModeClearIconOverlay(): void; + msSiteModeClearJumpList(): void; + msSiteModeCreateJumpList(bstrHeader: string): void; + msSiteModeRefreshBadge(): void; + msSiteModeSetIconOverlay(IconUrl: string, pvarDescription?: any): void; + msSiteModeShowButtonStyle(uiButtonID: any, uiStyleID: any): void; + msSiteModeShowJumpList(): void; + msSiteModeShowThumbBar(): void; + msSiteModeUpdateThumbBarButton(ButtonID: any, fEnabled: boolean, fVisible: boolean): void; + msStartPeriodicBadgeUpdate(pollingUri: string, startTime?: any, uiUpdateRecurrence?: any): void; + msStartPeriodicTileUpdate(pollingUris: any, startTime?: any, uiUpdateRecurrence?: any): void; + msStartPeriodicTileUpdateBatch(pollingUris: any, startTime?: any, uiUpdateRecurrence?: any): void; + msStopPeriodicBadgeUpdate(): void; + msStopPeriodicTileUpdate(): void; + msTrackingProtectionEnabled(): boolean; + NavigateAndFind(URL: string, strQuery: string, varTargetFrame: any): void; + NavigateToSuggestedSites(bstrRelativeUrl: string): void; + OpenFavoritesPane(): void; + OpenFavoritesSettings(): void; + PhishingEnabled(): boolean; + RefreshOfflineDesktop(): void; + ResetAllExperimentalFlagsAndValues(): void; + ResetFirstBootMode(): void; + ResetSafeMode(): void; + RunOnceHasShown(): boolean; + RunOnceRequiredSettingsComplete(fComplete: boolean): void; + RunOnceShown(): void; + SearchGuideUrl(): string; + SetActivitiesVisible(fVisible: boolean): void; + SetExperimentalFlag(bstrFlagString: string, vfFlag: boolean): void; + SetExperimentalValue(bstrValueString: string, dwValue: number): void; + SetNeedIEAutoLaunchFlag(bstrUrl: string, flag: boolean): void; + SetRecentlyClosedVisible(fVisible: boolean): void; + ShowBrowserUI(bstrName: string, pvarIn: any): any; + ShowInPrivateHelp(): void; + ShowTabsHelp(): void; + SkipRunOnce(): void; + SkipTabsWelcome(): void; + SqmEnabled(): boolean; + } + + /** ShellDispatch Load in Shell Context */ + class ShellWindows { + private 'SHDocVw.ShellWindows_typekey': ShellWindows; + private constructor(); + + /** Get count of open Shell windows */ + readonly Count: number; + + /** Find the window based on the location */ + FindWindowSW(pvarloc: any, pvarlocRoot: any, swClass: number, pHWND: number, swfwOptions: number): any; + + /** Return the shell window for the given index */ + Item(index?: any): any; + + /** Notifies the activation */ + OnActivated(lCookie: number, fActive: boolean): void; + + /** Notifies on creation and frame name set */ + OnCreated(lCookie: number, punk: any): void; + + /** Notifies the new location */ + OnNavigate(lCookie: number, pvarloc: any): void; + + /** Used by IExplore to register different processes */ + ProcessAttachDetach(fAttach: boolean): void; + + /** Register a window with the list */ + Register(pid: any, HWND: number, swClass: number, plCookie: number): void; + + /** Register a pending open with the list */ + RegisterPending(lThreadId: number, pvarloc: any, pvarlocRoot: any, swClass: number, plCookie: number): void; + + /** Remove a window from the list */ + Revoke(lCookie: number): void; + } + + /** WebBrowser Control */ + class WebBrowser { + private 'SHDocVw.WebBrowser_typekey': WebBrowser; + private constructor(); + + /** Controls whether address bar is shown (ignored by WebBrowser) */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** WebBrowser Control */ + class WebBrowser_V1 { + private 'SHDocVw.WebBrowser_V1_typekey': WebBrowser_V1; + private constructor(); + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Stops opening a file. */ + Stop(): void; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + namespace EventHelperTypes { + type InternetExplorer_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type InternetExplorerMedium_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type ShellBrowserWindow_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type ShellNameSpace_FavoritesSelectionChange_ArgNames = ['cItems', 'hItem', 'strName', 'strUrl', 'cVisits', 'strDate', 'fAvailableOffline']; + + type WebBrowser_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_BeforeNavigate_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_FrameBeforeNavigate_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_FrameNewWindow_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Processed']; + + type WebBrowser_V1_NewWindow_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Processed']; + + interface InternetExplorer_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface InternetExplorerMedium_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface ShellBrowserWindow_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface ShellNameSpace_FavoritesSelectionChange_Parameter { + readonly cItems: number; + readonly cVisits: number; + readonly fAvailableOffline: number; + readonly hItem: number; + readonly strDate: string; + readonly strName: string; + readonly strUrl: string; + } + + interface WebBrowser_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface WebBrowser_V1_BeforeNavigate_Parameter { + Cancel: boolean; + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_FrameBeforeNavigate_Parameter { + Cancel: boolean; + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_FrameNewWindow_Parameter { + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + Processed: boolean; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_NewWindow_Parameter { + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + Processed: boolean; + readonly TargetFrameName: string; + readonly URL: string; + } + } +} + +interface ActiveXObject { + on( + obj: SHDocVw.InternetExplorer, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.InternetExplorer_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.InternetExplorer, parameter: SHDocVw.EventHelperTypes.InternetExplorer_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.InternetExplorer, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.InternetExplorer, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.InternetExplorer, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: (this: SHDocVw.InternetExplorer, + parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: (this: SHDocVw.InternetExplorer, + parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.InternetExplorerMedium_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.InternetExplorerMedium, parameter: SHDocVw.EventHelperTypes.InternetExplorerMedium_BeforeNavigate2_Parameter) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { + ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, + readonly bstrUrl: string + }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.InternetExplorerMedium, + parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly StatusBar: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.InternetExplorerMedium, + parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly SecureLockIcon: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Left: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetResizable', argNames: ['Resizable'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.ShellBrowserWindow_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.ShellBrowserWindow, parameter: SHDocVw.EventHelperTypes.ShellBrowserWindow_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.ShellBrowserWindow, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.ShellBrowserWindow, parameter: { + readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, + readonly StatusCode: any + }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.ShellNameSpace, event: 'FavoritesSelectionChange', argNames: SHDocVw.EventHelperTypes.ShellNameSpace_FavoritesSelectionChange_ArgNames, + handler: (this: SHDocVw.ShellNameSpace, parameter: SHDocVw.EventHelperTypes.ShellNameSpace_FavoritesSelectionChange_Parameter) => void): void; + on(obj: SHDocVw.ShellWindows, event: 'WindowRegistered' | 'WindowRevoked', argNames: ['lCookie'], handler: (this: SHDocVw.ShellWindows, parameter: { readonly lCookie: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.WebBrowser_BeforeNavigate2_ArgNames, handler: ( + this: SHDocVw.WebBrowser, parameter: SHDocVw.EventHelperTypes.WebBrowser_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.WebBrowser, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.WebBrowser, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], handler: ( + this: SHDocVw.WebBrowser, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'BeforeNavigate', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_BeforeNavigate_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_BeforeNavigate_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.WebBrowser_V1, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'FrameBeforeNavigate', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameBeforeNavigate_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameBeforeNavigate_Parameter) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'FrameNavigateComplete' | 'NavigateComplete', argNames: ['URL'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly URL: string }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'FrameNewWindow', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameNewWindow_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameNewWindow_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'NewWindow', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_NewWindow_ArgNames, handler: ( + this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_NewWindow_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.WebBrowser_V1, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'PropertyChange', argNames: ['Property'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly Property: string }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'Quit', argNames: ['Cancel'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly Text: string }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.InternetExplorer, parameter: {}) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.InternetExplorerMedium, parameter: {}) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.ShellBrowserWindow, parameter: {}) => void): void; + on(obj: SHDocVw.ShellNameSpace, event: 'DoubleClick' | 'Initialized' | 'SelectionChange', handler: (this: SHDocVw.ShellNameSpace, parameter: {}) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.WebBrowser, parameter: {}) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'DownloadBegin' | 'DownloadComplete' | 'WindowActivate' | 'WindowMove' | 'WindowResize', handler: (this: SHDocVw.WebBrowser_V1, parameter: {}) => void): void; + new (progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'InternetExplorer.Application': SHDocVw.InternetExplorer; + 'Shell.Explorer': SHDocVw.WebBrowser; + 'Shell.UIHelper': SHDocVw.ShellUIHelper; + 'ShellNameSpace.ShellNameSpace': SHDocVw.ShellNameSpace; +} + +interface EnumeratorConstructor { + new(col: SHDocVw.ShellWindows): Enumerator; +} diff --git a/types/activex-shdocvw/package.json b/types/activex-shdocvw/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-shdocvw/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-shdocvw/tsconfig.json b/types/activex-shdocvw/tsconfig.json new file mode 100644 index 0000000000..1759b6965f --- /dev/null +++ b/types/activex-shdocvw/tsconfig.json @@ -0,0 +1,22 @@ + +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "scripthost"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "activex-shdocvw-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-shdocvw/tslint.json b/types/activex-shdocvw/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-shdocvw/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-shell/activex-shell-tests.ts b/types/activex-shell/activex-shell-tests.ts new file mode 100644 index 0000000000..1a7e08754c --- /dev/null +++ b/types/activex-shell/activex-shell-tests.ts @@ -0,0 +1,489 @@ +/// + +const shell = new ActiveXObject('Shell.Application'); + +const getWindowsFolder = () => shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfWINDOWS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537735(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (!folder) { return; } + const folderItem = folder.ParseName('system.ini'); + if (!folderItem) { return; } + shell.AddToRecent(folderItem.Path); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774065(v=vs.85).aspx +(() => { + const folder = shell.BrowseForFolder(0, 'Example', 0, Shell32.ShellSpecialFolderConstants.ssfWINDOWS); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537736(v=vs.85).aspx +const canStartStop = shell.CanStartStopService('service name'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774069(v=vs.85).aspx +shell.ControlPanelItem('desk.cpl'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774073(v=vs.85).aspx +shell.Explore('C:\\'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537737(v=vs.85).aspx +const explorerPolicy = shell.ExplorerPolicy('ValueName'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537739(v=vs.85).aspx +const settingValue = shell.GetSetting(Shell32.SettingKey.SSF_SHOWALLOBJECTS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537740(v=vs.85).aspx +const processorLevel = shell.GetSystemInformation('ProcessorLevel'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537741(v=vs.85).aspx +const isRestricted = shell.IsRestricted('system', 'undockwithoutlogon'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742(v=vs.85).aspx +const isServiceRunning = shell.IsServiceRunning('Themes'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774086(v=vs.85).aspx +shell.Open(Shell32.ShellSpecialFolderConstants.ssfWINDOWS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537743(v=vs.85).aspx +shell.ServiceStart('Messenger', true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537744(v=vs.85).aspx +shell.ServiceStop('Messenger', true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537745(v=vs.85).aspx +shell.ShellExecute("notepad.exe", "", "", "open", Shell32.ShellExecuteShow.Normal); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537746(v=vs.85).aspx?cs-save-lang=1&cs-lang=jscript#code-snippet-1 +shell.ShowBrowserBar(Shell32.ExplorerBarCLSID.Favorites, true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774107(v=vs.85).aspx +const wshShell = new ActiveXObject('WScript.Shell'); +wshShell.Popup(shell.Windows().Count); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx +shell.NameSpace(`c:\\windows`)!.CopyHere('c:\\autoexec.bat'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787870(v=vs.85).aspx +(() => { + const folder = shell.NameSpace('c:\\windows'); + const folderItem = folder ? folder.ParseName('clock.avi') : undefined; + if (folder && folderItem) { + const info = folder.GetDetailsOf(folderItem, Shell32.FileSystemDetails.Type); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787874(v=vs.85).aspx +shell.NameSpace('c:\\windows')!.MoveHere('c:\\temp.txt', Shell32.FileOperationFlag.FOF_NOCONFIRMATION); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787876(v=vs.85).aspx +shell.NameSpace('c:\\')!.NewFolder('TestFolder'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787858(v=vs.85).aspx +(() => { + const folder = shell.NameSpace("\\\\server\\share\\folder"); + const offlineStatus = folder ? folder.OfflineStatus : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787880(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + WScript.Echo(folder!.ParentFolder.Title); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787860(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787816(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787850(v=vs.85).aspx +(() => { + const folder = shell.NameSpace('C:\\WINDOWS'); + const folderItem = folder ? folder.Self : undefined; + if (folderItem) { + const verbs = folderItem.Verbs(); + folderItem.InvokeVerb(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787812(v=vs.85).aspx +(() => { + const parentFolder = getWindowsFolder(); + const folderItem = parentFolder ? parentFolder.ParseName('system32') : undefined; + const folder = folderItem ? folderItem.GetFolder : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787814(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787824(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const folderItem = folder ? folder.ParseName('Internet Explorer.lnk') : undefined; + if (folderItem && folderItem.IsLink) { + const link = folderItem.GetLink; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787818(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787819(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787821(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + if (folderItem) { + const isBrowsable = folderItem.IsBrowsable; + const isFileSystem = folderItem.IsFileSystem; + const isFolder = folderItem.IsFolder; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787825(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder!.ParseName('notepad.exe'); + if (folderItem) { + const oldDate = folderItem.ModifyDate; + folderItem.ModifyDate = new Date(1900, 1, 1, 18, 5).getVarDate(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787827(v=vs.85).aspx +(() => { + const rootFolder = shell.NameSpace('C:\\'); + const folderItem = rootFolder ? rootFolder.ParseName('autoexec.bat') : undefined; + if (folderItem) { + const oldName = folderItem.Name; + folderItem.Name = 'test.bat'; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787829(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + const parent = folderItem ? folderItem.Parent : undefined; + if (parent) { + WScript.Echo('Got parent object'); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787844(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + const path = folderItem ? folderItem.Path : ''; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787846(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder!.ParseName('notepad.exe'); + const size = folderItem ? folderItem.Size : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787848(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (folder) { + WScript.Echo(folder.Self.Type); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787798(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItems = folder ? folder.Items() : undefined; + const count = folderItems ? folderItems.Count : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787794(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfDRIVES); + if (folder) { + folder.Items().InvokeVerbEx(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774170(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774174(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const verbs = folder ? folder.Self.Verbs() : undefined; + if (verbs) { + const verb = verbs.Item(0); + WScript.Echo(verb.Name); + verb.DoIt(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787787(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (folder) { + const folderItems = folder.Items(); + WScript.Echo(folderItems.Count); + folderItems.Filter(Shell32.ShellFolderEnumerationFlags.SHCONTF_NONFOLDERS, '*.txt'); + WScript.Echo(folderItems.Count); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787791(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774162(v=vs.85).aspx +(() => { + const echoFirstVerbName = (folder: Shell32.Folder3 | null) => { + if (!folder) { return; } + const verbs = folder.Items().Verbs; + WScript.Echo(verbs.Item(0).Name); + }; + + let folder = getWindowsFolder(); + echoFirstVerbName(folder); + + folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfCONTROLS); + echoFirstVerbName(folder); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774158(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfCONTROLS); + if (folder) { + const verbs = folder.Self.Verbs(); + WScript.Echo(verbs.Count); + } +})(); + +const getIELink = () => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const folderItem = folder ? folder.ParseName('Internet Explorer.lnk') : undefined; + return { + link: folderItem ? folderItem.GetLink : undefined, + folderItem + }; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773990(v=vs.85).aspx +(() => { + const { link, folderItem } = getIELink(); + if (link && folderItem) { + WScript.Echo(link.GetIconLocation(folderItem.Path)); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773996(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.Resolve(Shell32.ShellLinkResolveFlags.NoUI); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773998(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.Description = 'New Description'; + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774002(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.SetIconLocation(link.Path, 1); + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773986(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Arguments); + link.Arguments = '/s'; + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773988(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Description); + link.Description = 'Test'; + link.Save(); + } +})(); + +const parseHotkey = (hotkey: number) => { + // missing implementation + return { + shift: false, + ctrl: false, + alt: false, + extended: false, + hotkey + }; +}; +const buildHotkey = (hotkey: number, shift: boolean = false, ctrl: boolean = false, alt: boolean = false, extended: boolean = false) => { + // missing implementation + return 0; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773992(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + const { hotkey } = parseHotkey(link.Hotkey); + WScript.Echo(hotkey); + link.Hotkey = buildHotkey(4); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773994(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Path); + link.Path = 'C:\\Program Files\\IE\\IEXPLORE.EXE'; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774006(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.ShowCommand); + link.ShowCommand = Shell32.LinkShowWindowState.Normal; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774008(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.WorkingDirectory); + link.WorkingDirectory = ''; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774115(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + const target = link.Target; + if (target) { + WScript.Echo(target.Size); + } + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774055(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.ParseName('notepad.exe') : undefined; + if (folderItem) { + WScript.Echo(folderItem.ExtendedProperty('infotip')); + } + + const wordDoc = shell.NameSpace('C:\\')!.ParseName('test.doc'); + if (wordDoc) { + const FMTID_SummaryInfo = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}"; + const PID_TITLE = "2"; + const PID_AUTHOR = "4"; + const SCID_TITLE = `${FMTID_SummaryInfo} ${PID_TITLE}`; + const SCID_AUTHOR = `${FMTID_SummaryInfo} ${PID_AUTHOR}`; + const docTitle = wordDoc.ExtendedProperty(SCID_TITLE); + const docAuthor = wordDoc.ExtendedProperty(SCID_AUTHOR); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774057(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.ParseName('notepad.exe') : undefined; + if (folderItem) { + folderItem.InvokeVerbEx("open", "c:\\autoexec.bat"); + } +})(); + +const collectionToArray = (col: any): T[] => { // tslint:disable-line no-unnecessary-generics + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +interface String { + endsWith(searchString: string, length?: number): boolean; +} +if (!String.prototype.endsWith) { + String.prototype.endsWith = function(search, this_len) { + if (this_len === undefined || this_len > this.length) { + this_len = this.length; + } + return this.substring(this_len - search.length, this_len) === search; + }; +} + +// shell.Windows() includes items other than Explorer windows, such as Internet Explorer tabs +const getExplorerWindows = () => + collectionToArray(shell.Windows()) + .filter(x => x.FullName.toLowerCase().endsWith('explorer.exe')); + +const getFolderViews = () => + getExplorerWindows() + .map(x => x.Document as Shell32.ShellFolderView); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774045(v=vs.85).aspx +(() => { + getFolderViews().forEach(x => + ActiveXObject.on(x, 'SelectionChanged', function(this: Shell32.ShellFolderView) { + WScript.Echo(`Selection change in ${this.Folder.Title} -- count: ${this.SelectedItems().Count}`); + }) + ); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773970(v=vs.85).aspx +WScript.Echo(shell.Windows().Item().Path); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773969(v=vs.85).aspx +WScript.Echo(shell.Windows().Count); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774043(v=vs.85).aspx +(() => { + getFolderViews().forEach(x => + WScript.Echo(`${x.Folder.Title} -- ${x.SelectedItems().Count} selected items`) + ); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774047(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774022(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774053(v=vs.85).aspx +(() => { + const folderView = getExplorerWindows()[0].Document as Shell32.ShellFolderView; + const folder = folderView.Folder; + if (folder) { + const folderItem = folder.Self; + folderView.SelectItem(folder.Self, Shell32.ShellFolderViewSelectItem.Focus); + } + WScript.Echo(folderView.ViewOptions); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774020(v=vs.85).aspx +(() => { + const folderView = getExplorerWindows()[0].Document as Shell32.ShellFolderView; + const focusedItem = folderView.FocusedItem; + if (focusedItem) { + WScript.Echo(`Focused item in first Excplorer window -- ${focusedItem.Path}`); + } +})(); + +(() => { + const router = new ActiveXObject('Shell.FolderView'); + const folder = getFolderViews()[0]; + router.SetFolderView(folder); + ActiveXObject.on(router, 'EnumDone', () => WScript.Echo('Current folder view was finisehd enumerating')); + ActiveXObject.on(router, 'SelectionChanged', () => WScript.Echo('Selection changed in current folder view')); + // the folder view monitored by the ShellFolderViewOC object can be changed via SetFolderView without disconnecting and reconnecting the handlers +})(); diff --git a/types/activex-shell/index.d.ts b/types/activex-shell/index.d.ts new file mode 100644 index 0000000000..cb59a11c5e --- /dev/null +++ b/types/activex-shell/index.d.ts @@ -0,0 +1,1016 @@ +// Type definitions for Microsoft Shell Controls And Automation - Shell32 1.0 +// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare namespace Shell32 { + // tslint:disable-next-line no-const-enum + const enum BrowseInfoFlags { + /** + * Allow folder junctions such as a library or a compressed file with a .zip file name extension to be browsed. + * + * _Windows 7 and later._ + */ + BIF_BROWSEFILEJUNCTIONS = 0x00010000, + + /** Only return computers. If the user selects anything other than a computer, the **OK** button is grayed. */ + BIF_BROWSEFORCOMPUTER = 0x00001000, + + /** + * Only allow the selection of printers. If the user selects anything other than a printer, the **OK** button is grayed. + * + * In Windows XP and later systems, the best practice is to use a Windows XP-style dialog, setting the root of the dialog to the **Printers and Faxes** folder (`CSIDL_PRINTERS`). + */ + BIF_BROWSEFORPRINTER = 0x00002000, + + /** + * The browse dialog box displays files as well as folders. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_BROWSEINCLUDEFILES = 0x00004000, + + /** + * The browse dialog box can display URLs. The `BIF_USENEWUI` and `BIF_BROWSEINCLUDEFILES` flags must also be set. If any of these three flags are not set, the browser dialog box rejects URLs. + * Even when these flags are set, the browse dialog box displays URLs only if the folder that contains the selected item supports URLs. + * + * When the folder's [IShellFolder::GetAttributesOf](https://msdn.microsoft.com/en-us/library/windows/desktop/bb775068.aspx) method is called to request the selected item's attributes, the + * folder must set the `SFGAO_FOLDER` attribute flag. Otherwise, the browse dialog box will not display the URL. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_BROWSEINCLUDEURLS = 0x00000080, + + /** Do not include network folders below the domain level in the dialog box's tree view control. */ + BIF_DONTGOBELOWDOMAIN = 0x00000002, + + /** + * Include an edit control in the browse dialog box that allows the user to type the name of an item. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_EDITBOX = 0x00000010, + + /** + * Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized. The dialog box has several new capabilities, including: drag-and-drop + * capability within the dialog box, reordering, shortcut menus, new folders, delete, and other shortcut menu commands. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NEWDIALOGSTYLE = 0x00000040, + + /** + * Do not include the **New Folder** button in the browse dialog box. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NONEWFOLDERBUTTON = 0x00000200, + + /** + * When the selected item is a shortcut, return the PIDL of the shortcut itself rather than its target. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NOTRANSLATETARGETS = 0x00000400, + + /** + * Only return file system ancestors. An ancestor is a subfolder that is beneath the root folder in the namespace hierarchy. If the user selects an ancestor of the root folder that is not + * part of the file system, the **OK** button is grayed. + */ + BIF_RETURNFSANCESTORS = 0x00000008, + + /** + * Only return file system directories. If the user selects folders that are not part of the file system, the **OK** button is grayed. + * + * **Note** The **OK** button remains enabled for `\\server` items, as well as `\\server\share` and directory items. However, if the user selects a `\\server` item, passing the PIDL + * returned by [SHBrowseForFolder](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762115.aspx) to + * [SHGetPathFromIDList](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762194.aspx) fails. + */ + BIF_RETURNONLYFSDIRS = 0x00000001, + + /** + * The browse dialog box can display sharable resources on remote systems. This is intended for applications that want to expose remote shares on a local system. The BIF_NEWDIALOGSTYLE flag + * must also be set. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_SHAREABLE = 0x00008000, + + /** + * Include a status area in the dialog box. The callback function can set the status text by sending messages to the dialog box. This flag is not supported when BIF_NEWDIALOGSTYLE + * is specified. + */ + BIF_STATUSTEXT = 0x00000004, + + /** + * When combined with `BIF_NEWDIALOGSTYLE`, adds a usage hint to the dialog box, in place of the edit box. `BIF_EDITBOX` overrides this flag. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_UAHINT = 0x00000100, + + /** + * Use the new user interface, including an edit box. This flag is equivalent to `BIF_EDITBOX | BIF_NEWDIALOGSTYLE`. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_USENEWUI = 0x00000090, + + /** + * If the user types an invalid name into the edit box, the browse dialog box calls the application's + * [BrowseCallbackProc](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762598.aspx) with the **BFFM_VALIDATEFAILED** message. This flag is ignored if BIF_EDITBOX is not specified. + * + * _[Version 4.71](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779)_ + */ + BIF_VALIDATE = 0x00000020, + } + + // tslint:disable-next-line no-const-enum + const enum ExplorerBarCLSID { + Favorites = '{EFA24E61-B078-11d0-89E4-00C04FC9E26E}', + Folders = '{EFA24E64-B078-11d0-89E4-00C04FC9E26E}', + History = '{EFA24E62-B078-11d0-89E4-00C04FC9E26E}', + Search = '{30D02401-6A81-11d0-8274-00C04FD5AE38}', + } + + // tslint:disable-next-line no-const-enum + const enum FileOperationFlag { + /** Preserve undo information, if possible. */ + FOF_ALLOWUNDO = 64, + + /** Perform the operation on files only if a wildcard file name (*.*) is specified. */ + FOF_FILESONLY = 128, + + /** Respond with "Yes to All" for any dialog box that is displayed. */ + FOF_NOCONFIRMATION = 16, + + /** Do not confirm the creation of a new directory if the operation requires one to be created. */ + FOF_NOCONFIRMMKDIR = 512, + + /** + * Do not copy connected files as a group. Only copy the specified files. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + FOF_NO_CONNECTED_ELEMENTS = 8192, + + /** + * Do not copy the security attributes of the file. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + FOF_NOCOPYSECURITYATTRIBS = 2048, + + /** Do not display a user interface if an error occurs. */ + FOF_NOERRORUI = 1024, + + /** Only operate in the local directory. Do not operate recursively into subdirectories. */ + FOF_NORECURSION = 4096, + + /** Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists. */ + FOF_RENAMEONCOLLISION = 8, + + /** Do not display a progress dialog box. */ + FOF_SILENT = 4, + + /** Display a progress dialog box but do not show the file names. */ + FOF_SIMPLEPROGRESS = 256, + } + + // tslint:disable-next-line no-const-enum + const enum FileSystemDetails { + Name = 0, + Size = 1, + Type = 2, + LastModified = 3, + Attributes = 4, + InfoTip = -1, + } + + // tslint:disable-next-line no-const-enum + const enum HotkeyModifiers { + SHIFT = 1, + CTRL = 2, + ALT = 4, + Extended = 8 + } + + // tslint:disable-next-line no-const-enum + const enum LinkShowWindowState { + /** Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. */ + Normal = 1, + + /** Activates the window and displays it as a minimized window. */ + Minimized = 2, + + /** Activates the window and displays it as a maximized window. */ + Maximized = 3 + } + + /** Constants for Folder2.OfflineStatus */ + // tslint:disable-next-line no-const-enum + const enum OfflineFolderStatus { + OFS_DIRTYCACHE = 3, + OFS_INACTIVE = -1, + OFS_OFFLINE = 1, + OFS_ONLINE = 0, + OFS_SERVERBACK = 2, + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderEnumerationFlags { + /** **Windows 7 and later** The calling application is checking for the existence of child items in the folder. */ + SHCONTF_CHECKING_FOR_CHILDREN = 0x00010, + + /** Include items that are folders in the enumeration. */ + SHCONTF_FOLDERS = 0x00020, + + /** Include items that are not folders in the enumeration. */ + SHCONTF_NONFOLDERS = 0x00040, + + /** Include hidden items in the enumeration. This does not include hidden system items. (To include hidden system items, use SHCONTF_INCLUDESUPERHIDDEN.) */ + SHCONTF_INCLUDEHIDDEN = 0x00080, + + /** The calling application is looking for printer objects. */ + SHCONTF_NETPRINTERSRCH = 0x00200, + + /** The calling application is looking for resources that can be shared. */ + SHCONTF_SHAREABLE = 0x00400, + + /** Include items with accessible storage and their ancestors, including hidden items. */ + SHCONTF_STORAGE = 0x00800, + + /** **Windows 7 and later**. Child folders should provide a navigation enumeration. */ + SHCONTF_NAVIGATION_ENUM = 0x01000, + + /** **Windows Vista and later**. The calling application is looking for resources that can be enumerated quickly. */ + SHCONTF_FASTITEMS = 0x02000, + + /** **Windows Vista and later**. Enumerate items as a simple list even if the folder itself is not structured in that way. */ + SHCONTF_FLATLIST = 0x04000, + + /** + * **Windows Vista and later**. The calling application is monitoring for change notifications.This means that the enumerator does not have to return all results. + * Items can be reported through change notifications. + */ + SHCONTF_ENABLE_ASYNC = 0x08000, + + /** + * **Windows 7 and later**. Include hidden system items in the enumeration. This value does not include hidden non-system items. + * (To include hidden non-system items, use SHCONTF_INCLUDEHIDDEN.) + */ + SHCONTF_INCLUDESUPERHIDDEN = 0x10000, + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderViewOptions { + /** The **Show All Files** option is enabled. */ + SFVVO_SHOWALLOBJECTS = 0x00000001, + + /** The **Hide extensions for known file types** option is disabled. */ + SFVVO_SHOWEXTENSIONS = 0x00000002, + + /** The **Display Compressed Files and Folders with Alternate Color** option is enabled. */ + SFVVO_SHOWCOMPCOLOR = 0x00000008, + + /** The **Do Not Show Hidden Files** option is enabled. */ + SFVVO_SHOWSYSFILES = 0x00000020, + + /** The **Classic Style** option is enabled. */ + SFVVO_WIN95CLASSIC = 0x00000040, + + /** The **Double-Click to Open an Item** option is enabled. */ + SFVVO_DOUBLECLICKINWEBVIEW = 0x00000080, + + /** The **Active Desktop – View as Web Page** option is enabled. */ + SFVVO_DESKTOPHTML = 0x00000200 + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderViewSelectItem { + Deselect = 0, + Select = 1, + EditMode = 3, + DeselectAllButThis = 4, + ScrollIntoView = 8, + Focus = 16 + } + + // tslint:disable-next-line no-const-enum + const enum ShellLinkResolveFlags { + /** + * Do not display a dialog box if the link cannot be resolved. When this flag is set, the high-order word of _fFlags_ specifies a time-out duration, in milliseconds. + * The method returns if the link cannot be resolved within the time-out duration. If the high-order word is set to zero, the time-out duration defaults to 3000 milliseconds (3 seconds). + */ + NoUI = 1, + + /** If the link has changed, update its path and list of identifiers. */ + Update = 4, + + /** Do not update the link information. */ + NoUpdate = 8, + + /** Do not execute the search heuristics. */ + NoSearch = 16, + + /** Do not use distributed link tracking. */ + NoTrack = 32, + + /** + * Disable distributed link tracking. By default, distributed link tracking tracks removable media across multiple devices based on the volume name. + * It also uses the UNC path to track remote file systems whose drive letter has changed. Setting this flag disables both types of tracking. + */ + NoLinkInfo = 64, + + /** Call the Windows Installer. */ + InvokeMSI = 128 + } + + // tslint:disable-next-line no-const-enum + const enum SettingKey { + /** + * The state of the **Use check boxes to select items** option. This option is enabled automatically when the system has a pen input device configured. + * + * _Windows Vista and later_ + */ + SSF_AUTOCHECKSELECT = 0x00800000, + + /** Not used. */ + SSF_DESKTOPHTML = 0x00000200, + + /** The state of the **Allow all uppercase names** option. As of Windows Vista, this folder option is no longer available. */ + SSF_DONTPRETTYPATH = 0x00000800, + + /** The state of the **Double-click to open an item (single-click to select)** option. */ + SSF_DOUBLECLICKINWEBVIEW = 0x00000080, + + /** Not used. */ + SSF_FILTER = 0x00010000, + + /** Not used. */ + SSF_HIDDENFILEEXTS = 0x00000004, + + /** The state of icon display in the Windows Explorer list view. If this option is active, no icons are displayed in the list view. */ + SSF_HIDEICONS = 0x00004000, + + /** + * The state of display name display in the Windows Explorer list view. If this option is active, icons are displayed in the list view, but display names are not. + * + * _Windows Vista and later_ + */ + SSF_ICONSONLY = 0x01000000, + + /** The state of the **Show map network drive button in toolbar** option. As of Windows Vista, this option is no longer available. */ + SSF_MAPNETDRVBUTTON = 0x00001000, + + /** The state of the Recycle Bin's **Display delete confirmation dialog** option. */ + SSF_NOCONFIRMRECYCLE = 0x00008000, + + /** The state of the **Automatically search for network folders and printers** option. As of Windows Vista, this option is no longer available. */ + SSF_NONETCRAWLING = 0x00100000, + + /** The state of the **Launch folder windows in a separate process** option. */ + SSF_SEPPROCESS = 0x00080000, + + /** Not used. */ + SSF_SERVERADMINUI = 0x00000004, + + /** The state of the **Hidden files and folders** option. */ + SSF_SHOWALLOBJECTS = 0x00000001, + + /** The state of the **Show File Attributes in Detail View** option. As of Windows Vista, this option is no longer available. */ + SSF_SHOWATTRIBCOL = 0x00000100, + + /** The state of the **Show encrypted or compressed NTFS files in color** option. */ + SSF_SHOWCOMPCOLOR = 0x00000008, + + /** The state of the **Hide extensions for known file types** option. */ + SSF_SHOWEXTENSIONS = 0x00000002, + + /** The state of the **Show pop-up description for folder and desktop items** option. */ + SSF_SHOWINFOTIP = 0x00002000, + + /** Not used. */ + SSF_SHOWSTARTPAGE = 0x00400000, + + /** The state of the **Hide protected operating system files** option. */ + SSF_SHOWSUPERHIDDEN = 0x00040000, + + /** + * The state of the **Hidden files and folders** option. In Windows Vista and later, this is equivalent to `SSF_SHOWALLOBJECTS`. In versions of Windows before Windows Vista, this value + * referred to the state of the **Do not show hidden files and folders** option. + */ + SSF_SHOWSYSFILES = 0x00000020, + + /** + * The state of the **Display file icon on thumbnails** option. If this option is active, a file type overlay is applied when a file supplies a thumbnail representation. + * + * _Windows Vista and later_ + */ + SSF_SHOWTYPEOVERLAY = 0x02000000, + + /** Not used. */ + SSF_SORTCOLUMNS = 0x00000010, + + /** The state of the Windows XP display option, which selects between the Windows XP style and the classic style. As of Windows Vista, this option is no longer available. */ + SSF_STARTPANELON = 0x00200000, + + /** The state of the **Display as a web view option**. As of Windows Vista, this option is no longer available. */ + SSF_WEBVIEW = 0x00020000, + + /** The state of the **Classic Style** option. As of Windows Vista, this option is no longer available. */ + SSF_WIN95CLASSIC = 0x00000400, + } + + // tslint:disable-next-line no-const-enum + const enum ShellExecuteShow { + /** Open the application with a hidden window. */ + Hidden = 0, + + /** Open the application with a normal window. If the window is minimized or maximized, the system restores it to its original size and position. */ + Normal = 1, + + /** Open the application with a minimized window. */ + Minimized = 2, + + /** Open the application with a maximized window. */ + Maximized = 3, + + /** Open the application with its window at its most recent size and position. The active window remains active. */ + Last = 4, + + /** Open the application with its window at its current size and position. */ + Current = 5, + + /** Open the application with a minimized window. The active window remains active. */ + MinimizedNotActivated = 7, + + /** Open the application with its window in the default state specified by the application. */ + Application = 10, + } + + /** Constants for Special Folders for open/Explore */ + // tslint:disable-next-line no-const-enum + const enum ShellSpecialFolderConstants { + ssfALTSTARTUP = 29, + ssfAPPDATA = 26, + ssfBITBUCKET = 10, + ssfCOMMONALTSTARTUP = 30, + ssfCOMMONAPPDATA = 35, + ssfCOMMONDESKTOPDIR = 25, + ssfCOMMONFAVORITES = 31, + ssfCOMMONPROGRAMS = 23, + ssfCOMMONSTARTMENU = 22, + ssfCOMMONSTARTUP = 24, + ssfCONTROLS = 3, + ssfCOOKIES = 33, + ssfDESKTOP = 0, + ssfDESKTOPDIRECTORY = 16, + ssfDRIVES = 17, + ssfFAVORITES = 6, + ssfFONTS = 20, + ssfHISTORY = 34, + ssfINTERNETCACHE = 32, + ssfLOCALAPPDATA = 28, + ssfMYPICTURES = 39, + ssfNETHOOD = 19, + ssfNETWORK = 18, + ssfPERSONAL = 5, + ssfPRINTERS = 4, + ssfPRINTHOOD = 27, + ssfPROFILE = 40, + ssfPROGRAMFILES = 38, + ssfPROGRAMFILESx86 = 48, + ssfPROGRAMS = 2, + ssfRECENT = 8, + ssfSENDTO = 9, + ssfSTARTMENU = 11, + ssfSTARTUP = 7, + ssfSYSTEM = 37, + ssfSYSTEMx86 = 41, + ssfTEMPLATES = 21, + ssfWINDOWS = 36, + } + + /** FileSearchBand Class */ + class FileSearchBand { + private 'Shell32.FileSearchBand_typekey': FileSearchBand; + private constructor(); + + /** Retrieve the file from which the search was restored. */ + readonly QueryFile: any; + + /** Get the search scope */ + readonly Scope: any; + + /** Retrieve the guid of the currently active search. */ + readonly SearchID: string; + + /** method SetFocus */ + SetFocus(): void; + + /** method SetSearchParameters */ + SetSearchParameters(pbstrSearchID: string, bNavToResults: boolean, pvarScope?: any, pvarQueryFile?: any): void; + } + + /** Definition of interface Folder version 3 */ + class Folder3 { + private 'Shell32.Folder3_typekey': Folder3; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Copy Items to this folder. */ + CopyHere(vItem: string | ShellFolderItem | FolderItems3, vOptions?: FileOperationFlag): void; + + /** Call this after the WebView barricade is dismissed by the user */ + DismissedWebViewBarricade(): void; + + /** + * Get the details about an item. + * @param vItem The item for which to retrieve the information. + * @param iColumn An integer value that specifies the information to be retrieved. The information available for an item depends on the folder in which it is displayed. This value + * corresponds to the zero-based column number that is displayed in a Shell view. + */ + GetDetailsOf(vItem: ShellFolderItem, iColumn: number): string; + + /** Should the WebView barricade be shown? */ + readonly HaveToShowWebViewBarricade: boolean; + + /** The collection of Items in folder */ + Items(): FolderItems3; + + /** Move Items to this folder. */ + MoveHere(vItem: string | ShellFolderItem | FolderItems3, vOptions?: FileOperationFlag): void; + + /** Create a new sub folder in this folder. */ + NewFolder(bName: string): void; + + /** Offline status of the server? */ + readonly OfflineStatus: OfflineFolderStatus; + + /** Get Parent object */ + readonly ParentFolder: Folder3; + + /** Parse the name to get an item. */ + ParseName(bName: string): ShellFolderItem | null; + + /** Folder's FolderItem interface */ + readonly Self: ShellFolderItem; + + /** Ask if the WebView barricade should be shown or not */ + ShowWebViewBarricade: boolean; + + /** Synchronize all offline files */ + Synchronize(): void; + + /** Get the display name for the window */ + readonly Title: string; + } + + /** Definition of interface FolderItems3 */ + class FolderItems3 { + private 'Shell32.FolderItems3_typekey': FolderItems3; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Get count of items in the folder */ + readonly Count: number; + + /** Set a wildcard filter to apply to the items returned */ + Filter(grfFlags: ShellFolderEnumerationFlags, bstrFileSpec: string): void; + + /** + * Executes a verb on a collection of `FolderItem` objects + * @param vVerb String that corresponds to the command to be executed. If no verb is specified, the default verb is executed. + * @param vArgs String with one or more arguments to the command specified by vVerb. The format of this string depends on the particular verb. + */ + InvokeVerbEx(vVerb?: string, vArgs?: string): void; + + /** Return the figure for the given index */ + Item(index?: any): ShellFolderItem; + + /** Get the list of verbs common to all the items */ + readonly Verbs: FolderItemVerbs; + } + + /** Definition of interface FolderItemVerb */ + class FolderItemVerb { + private 'Shell32.FolderItemVerb_typekey': FolderItemVerb; + private constructor(); + + /** Execute the verb */ + DoIt(): void; + + /** Get display name for item */ + readonly Name: string; + } + + /** Definition of interface FolderItemVerbs */ + class FolderItemVerbs { + private 'Shell32.FolderItemVerbs_typekey': FolderItemVerbs; + private constructor(); + + /** Get count of open folder windows */ + readonly Count: number; + + /** Return the specified verb */ + Item(index?: any): FolderItemVerb; + } + + /** Shell Object Type Information */ + class Shell { + private 'Shell32.Shell_typekey': Shell; + private constructor(); + + /** Add an object to the Recent Docuements */ + AddToRecent(varFile: string | null, bstrCategory?: string): void; + + /** Get Application object */ + readonly Application: any; + + /** Browse the name space for a Folder */ + BrowseForFolder(Hwnd: number, Title: string, Options: number | BrowseInfoFlags, RootFolder?: string | ShellSpecialFolderConstants): Folder3; + + /** Determine if the current user can start/stop the named service. */ + CanStartStopService(ServiceName: string): boolean; + + /** Cascade Windows */ + CascadeWindows(): void; + + /* + * Runs the specified Control Panel (*.cpl) application. If the application is already open, it will activate the running instance. + * + * **Note** As of Windows Vista, most Control Panel applications are Shell items and cannot be opened with this function. To open those Control Panel applications, pass the canonical name to + * `control.exe`. For example: + * + * `control.exe /name Microsoft.Personalization` + */ + ControlPanelItem(bstrDir: string): void; + + /** Eject the pc */ + EjectPC(): void; + + /** Explore a folder */ + Explore(vDir: string | ShellSpecialFolderConstants): void; + + /** + * Return explorer policy value + * + * The specified value name must be within the **HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer** subkey. + * If the value name does not exist then the method returns null. + */ + ExplorerPolicy(bstrPolicyName: string): any; + + /** Bring up the file run dialog box */ + FileRun(): void; + + /** Find a computer */ + FindComputer(): void; + + /** Find Files */ + FindFiles(): void; + + /** Find a Printer in the Directory Service */ + FindPrinter(Name?: string, location?: string, model?: string): void; + + /** Return shell global setting */ + GetSetting(lSetting: number | SettingKey): boolean; + + /** + * `DirectoryServiceAvailable` -- Returns **true** if the directory service is available + * + * `IsOS_DomainMember` -- Returns **true** if the computer is a member of a domain (_Windows XP and later_) + * + * `IsOS_Personal` -- Returns **true** if the operating system is Windows XP Home Edition (_Windows XP only_) + * + * `IsOS_Professional` -- Returns **true** if the operating system is Windows XP Professional Edition (_Windows XP only_) + */ + GetSystemInformation(Name: 'DirectoryServiceAvailable' | 'IsOS_DomainMember' | 'IsOS_Personal' | 'IsOS_Professional'): boolean; + + /** + * `DoubleClickTime` -- The double-click time, in milliseconds + * + * `PhysicalMemoryInstalled` -- The amount of physical memory installed, in bytes + * + * `ProcessorArchitecture` -- The processor architecture. For details, see the discussion of the **wProcessorArchitecture** member of the + * [`SYSTEM_INFO`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724958.aspx) structure + * + * `ProcessorLevel` -- The processor level. Returns 3, 4, or 5, for x386, x486, and Pentium-level processors, respectively (_Windows Vista and later_) + * + * `ProcessorSpeed` -- The processor speed, in megahertz (MHz) + */ + GetSystemInformation(Name: 'DoubleClickTime' | 'PhysicalMemoryInstalled' | 'ProcessorArchitecture' | 'ProcessorLevel' | 'ProcessorSpeed'): number; + + /** Display shell help */ + Help(): void; + + /** get restriction settings */ + IsRestricted(Group: string, Restriction: string): number; + + /** Determine if a service is running by name. */ + IsServiceRunning(ServiceName: string): any; + + /** Minimize all windows */ + MinimizeAll(): void; + + /** Get special folder from ShellSpecialFolderConstants */ + NameSpace(vDir: string | ShellSpecialFolderConstants): Folder3 | null; + + /** Open a folder */ + Open(vDir: string | ShellSpecialFolderConstants): void; + + /** Get Parent object */ + readonly Parent: any; + + /** Refresh the menu */ + RefreshMenu(): void; + + /** Immersive Search */ + SearchCommand(): void; + + /** + * Start a service by name, and optionally set it to autostart. + * + * The method returns `false` if the service has already been started. Before calling this method, you can call + * [Shell.IsServiceRunning](https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742.aspx) to ascertain the status of the service. + */ + ServiceStart(ServiceName: string, Persistent?: boolean): boolean; + + /** + * Stop a service by name, and optionally disable autostart. + * + * The method returns `false` if the service has already been stopped. Before calling this method, you can call + * [Shell.IsServiceRunning](https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742.aspx) to ascertain the status of the service. + */ + ServiceStop(ServiceName: string, Persistent?: boolean): boolean; + + /** Displays the **Date and Time Properties** dialog box. */ + SetTime(): void; + + /** + * Execute generic command + * @param sFile A string that contains the name of the file on which `ShellExecute` will perform the action specified by `vOperation`. + * @param [vArgs] A string that contains parameter values for the operation. + * @param [vDir] The fully qualified path of the directory that contains the file specified by `sFile`. If this parameter is not specified, the current working directory is used. + * @param [vOperation] The operation to be performed. This value is set to one of the verb strings that is supported by the file. If this parameter is not specified, the default operation is + * performed. + * @param [vShow] A recommendation as to how the application window should be displayed initially. The application can ignore this recommendation. + */ + ShellExecute(File: string, vArgs?: string, vDir?: string, vOperation?: string, vShow?: ShellExecuteShow): void; + + /** Show/Hide browser bar. */ + ShowBrowserBar(bstrClsid: ExplorerBarCLSID, bShow: boolean): any; + + /** Exit Windows */ + ShutdownWindows(): void; + + /** Tile windows horizontally */ + TileHorizontally(): void; + + /** Tile windows vertically */ + TileVertically(): void; + + /** Raise/lower the desktop */ + ToggleDesktop(): void; + + /** Displays the **Taskbar and Start Menu Properties** dialog box. */ + TrayProperties(): void; + + /** Undo Minimize All */ + UndoMinimizeALL(): void; + + /** The collection of open folder windows */ + Windows(): ShellWindows; + + /** Displays the **Windows Security** dialog box. */ + WindowsSecurity(): void; + + /** Displays your open windows in a 3D stack that you can flip through. */ + WindowSwitcher(): void; + } + + /** ShellDispatch Load in Shell Context */ + class ShellDispatchInproc { + private 'Shell32.ShellDispatchInproc_typekey': ShellDispatchInproc; + private constructor(); + } + + /** Shell Folder Item */ + class ShellFolderItem { + private 'Shell32.ShellFolderItem_typekey': ShellFolderItem; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Access an extended property */ + ExtendedProperty(bstrPropName: string): any; + + /** If item is a folder return folder object */ + readonly GetFolder: Folder3 | null; + + /** If item is link return link object */ + readonly GetLink: ShellLinkObject | null; + + /** + * Execute a command on the item. + * Must be one of the values returned by the item's `FolderItemVerb.Name` property. + * If no verb is specified, the default verb will be invoked. + */ + InvokeVerb(vVerb?: string): void; + + /** + * Extended version of InvokeVerb + * @param vVerb String that corresponds to the command to be executed. If no verb is specified, the default verb is executed. + * @param vArgs String with one or more arguments to the command specified by vVerb. The format of this string depends on the particular verb. + */ + InvokeVerbEx(vVerb?: string, vArgs?: string): void; + + /** Indicates if the item can be hosted inside a browser or Windows Explorer frame. */ + readonly IsBrowsable: boolean; + + /** Is the item a file system object? */ + readonly IsFileSystem: boolean; + + /** Is the item a Folder? */ + readonly IsFolder: boolean; + + /** Is the item a link? */ + readonly IsLink: boolean; + + /** Modification Date? */ + ModifyDate: VarDate; + + /** Get display name for item */ + Name: string; + + /** Get Parent object */ + readonly Parent: any; + + /** Get the pathname to the item */ + readonly Path: string; + + /** Size */ + readonly Size: number; + + /** Contains a string representation of the item's type */ + readonly Type: string; + + /** Get the list of verbs for the object */ + Verbs(): FolderItemVerbs; + } + + /** Shell Folder View Object */ + class ShellFolderView { + private 'Shell32.ShellFolderView_typekey': ShellFolderView; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Get Current View Mode */ + CurrentViewMode: number; + + /** Filter View */ + FilterView(bstrFilterText: string): void; + + /** The currently focused item in the folder */ + readonly FocusedItem: ShellFolderItem; + + /** Get the folder being viewed */ + readonly Folder: Folder3; + + /** Get Folder Flags */ + FolderFlags: number; + + /** Get Group By Column */ + GroupBy: string; + + /** Set Icon Size */ + IconSize: number; + + /** Show items menu and return command selected */ + PopupItemMenu(pfi: ShellFolderItem, vx?: any, vy?: any): string; + + /** The collection of Selected Items in folder */ + SelectedItems(): FolderItems3; + + /** Select the item */ + SelectItem(pvfi: ShellFolderItem, dwFlags: ShellFolderViewSelectItem): void; + + /** Select Item relative to the Current Item */ + SelectItemRelative(iRelative: number): void; + + /** Get Sorting Columns */ + SortColumns: string; + + /** Returns the view options for showing a folder. */ + readonly ViewOptions: ShellFolderViewOptions; + } + + /** + * The **ShellFolderView** object fires two events, **EnumDone** and **SelectionChanged**, that are typically handled by applications. However, some applications + * must handle events from a series of **ShellFolderView** objects. For example, an application might host a **WebBrowser** control that allows users to navigate through + * a series of folders. Each folder has its own **ShellFolderView** object with its associated events. Handling these events can be difficult. + * + * The **ShellFolderViewOC** object simplifies event handling for such scenarios. It allows applications to handle events for all ShellFolderView objects with a single + * pair of **ShellFolderViewOC** event handlers. Each time the user navigates to a new folder, the application passes the associated **ShellFolderView** object to the + * **ShellFolderViewOC** object by calling **SetFolderView**. Then, when an **EnumDone** or **SelectionChanged** event is fired, the **ShellFolderViewOC** object + * forwards the event to its own handler for processing. + */ + class ShellFolderViewOC { + private 'Shell32.ShellFolderViewOC_typekey': ShellFolderViewOC; + private constructor(); + + /** Set the ShellFolderView object to monitor events of. */ + SetFolderView(pdisp: ShellFolderView): void; + } + + /** Shell Link object */ + class ShellLinkObject { + private 'Shell32.ShellLinkObject_typekey': ShellLinkObject; + private constructor(); + + /** Arguments for the link */ + Arguments: string; + + /** Description of the link */ + Description: string; + + /** Get the IconLocation for the link */ + GetIconLocation(pbs: string): number; + + /** Hotkey for the link */ + Hotkey: number; + + /** Fully qualified path of the link */ + Path: string; + + /** Tell the link to resolve itself */ + Resolve(fFlags: ShellLinkResolveFlags): void; + + /** + * Tell the link to save the changes + * @param sFile The fully qualified path of the file where the new link information is to be saved. If no file is specified, the current file is used. + */ + Save(vWhere?: string): void; + + /** + * Set the IconLocation for the link + * @param sPath The fully qualified path of the file that contains the icon. + * @param iIcon The index of the icon in the file specified by _sPath_. + */ + SetIconLocation(sPath: string, iIcon: number): void; + + /** Get the Show Command for the link */ + ShowCommand: LinkShowWindowState; + + /** Get the target of a link object */ + readonly Target: ShellFolderItem | null; + + /** Get the working directory for the link */ + WorkingDirectory: string; + } + + class ShellWindows { + private 'Shell32.ShellWindows_typekey': ShellWindows; + private constructor(); + + /** + * Retrieves an InternetExplorer object that represents the Shell window. + * @param index Default is 0 + */ + Item(index?: number): SHDocVw.InternetExplorer; + + /** Contains the number of items in the collection. */ + readonly Count: number; + } +} + +interface ActiveXObject { + on( + obj: Shell32.ShellFolderView, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked', handler: ( + this: Shell32.ShellFolderView, parameter: {}) => void): void; + on( + obj: Shell32.ShellFolderViewOC, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked', + handler: (this: Shell32.ShellFolderViewOC, parameter: {}) => void): void; + new (progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'Shell.Application': Shell32.Shell; + 'Shell.FolderView': Shell32.ShellFolderViewOC; +} + +interface EnumeratorConstructor { + new(col: Shell32.FolderItems3): Enumerator; + new(col: Shell32.FolderItemVerbs): Enumerator; + new(col: Shell32.ShellWindows): Enumerator; +} diff --git a/types/activex-shell/package.json b/types/activex-shell/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-shell/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-shell/tsconfig.json b/types/activex-shell/tsconfig.json new file mode 100644 index 0000000000..97b3ee81cb --- /dev/null +++ b/types/activex-shell/tsconfig.json @@ -0,0 +1,22 @@ + +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "scripthost"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "activex-shell-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-shell/tslint.json b/types/activex-shell/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-shell/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/adone/adone.d.ts b/types/adone/adone.d.ts index 34540761b5..0d6e3255ee 100644 --- a/types/adone/adone.d.ts +++ b/types/adone/adone.d.ts @@ -110,6 +110,8 @@ declare namespace adone { export function require(path: string): object; export const package: object; + export function sprintf(format: string, ...args: any[]): string; + namespace I { interface Runtime { term: object; // TODO diff --git a/types/adone/glosses/application.d.ts b/types/adone/glosses/application.d.ts index 6b2b783d68..4c9661843a 100644 --- a/types/adone/glosses/application.d.ts +++ b/types/adone/glosses/application.d.ts @@ -1,5 +1,275 @@ declare namespace adone { namespace application { - function run(app: object, ignoreArgs?: boolean): Promise; + namespace I { + type ArgumentType = ((x: string, index: number) => any) | RegExp; + + interface ArgumentInfo { + name: string | string[]; + action?: "store" + | "store_const" + | "store_true" + | "store_false" + | "append" + | "count" + | "set"; + nargs?: number | "+" | "*" | "?" + type?: ArgumentType | ArgumentType[]; + verify?: (args: any, opts: any) => boolean; // TODO + required?: boolean; + description?: string; + help?: string; + holder?: string | string[]; + appendDefaultMessage?: boolean; + appendChoicesHelpMessage?: boolean; + default?: any; + enabled?: boolean; + } + + interface Group { + name: string; + description?: string; + } + + interface MainCommandInfo { + arguments?: Array; + options?: Array; + description?: string; + optionsGroups?: Group[]; + blindMode?: boolean; + match?: (name: string) => boolean; + handler?: (args: object, opts: object) => void; + } + + interface CommandInfo extends MainCommandInfo { + name?: string | string[]; + group?: string; + } + + interface ApplicationInfo { + name?: string; + description?: string; + subsystems?: SubsystemInfo[]; + commandsGroups?: Group[] + } + + interface SubsystemInfo { + name: string; + description?: string; + subsystem: string; + transpile?: boolean; + group?: string; + } + } + + function DSubsystem(info?: I.ApplicationInfo): (...args: any[]) => void; + + function DApplication(info?: I.ApplicationInfo): (...args: any[]) => void; + + function DCliCommand(info?: I.CommandInfo): (...args: any[]) => void; + + function DMainCliCommand(info?: I.MainCommandInfo): (...args: any[]) => void; + + namespace I { + interface LoadSubsystemOptions { + name?: string, + description?: string, + group?: string, + transpile?: boolean + } + + interface CommonAddSubsystemInfo { + name?: string, + useFilename?: boolean + description?: string, + group?: string, + configureArgs?: any[] + transpile?: boolean, + bind?: boolean | string + } + + interface AddSubsystemInfo extends CommonAddSubsystemInfo { + subsystem: Subsystem | string, + } + + interface SysInfo { + name: string; + description: string; + group: string; + configureArgs: any[]; + instance: Subsystem; + path: string | null; + } + + interface SysInfoWithPath extends SysInfo { + path: string; + } + + interface SysInfoNoPath extends SysInfo { + path: null; + } + + interface AddSubsystemsFromOptions extends CommonAddSubsystemInfo { + filter?: string[] | ((file: string) => boolean | Promise) + } + } + + class Subsystem extends event.AsyncEmitter { + constructor(options?: { name?: string }); + + readonly name?: string; + + readonly root?: Subsystem; + + setRoot(root: Subsystem): void; + + readonly parent?: Subsystem; + + readonly state: number; + + readonly isOwned: boolean; + + setState(state: number): void; + + waitForState(expectedState: number, timeout?: number): Promise; + + configure(): void; + + initialize(): void; + + uninitialize(): void; + + configureSubsystems(): Promise; + + uninitializeSubsystems(): Promise; + + reinitializeSubsystems(): Promise; + + configureSubsystem(name: string): Promise; + + loadSubsystem(subsystem: string | Subsystem, options?: I.LoadSubsystemOptions): Promise; + + unloadSubsystem(name: string): Promise; + + initializeSubsystem(name: string): Promise; + + uninitializeSubsystem(name: string): Promise; + + reinitializeSubsystem(name: string): Promise; + + getSubsystem(name: string): Subsystem; + + hasSubsystem(name: string): boolean; + + hasSubsystems(): boolean; + + addSubsystem(info: I.AddSubsystemInfo & { subsystem: Subsystem }): I.SysInfoNoPath; + addSubsystem(info: I.AddSubsystemInfo & { subsystem: string }): I.SysInfoWithPath; + + addSubsystemsFrom(path: string, options?: I.AddSubsystemsFromOptions): I.SysInfoWithPath; + + instantiateSubsystem(subsystem: string | Subsystem, options?: { + transpile?: boolean + }): Subsystem; + + deleteSubsystem(name: string, force?: boolean): void; + + getSubsystemInfo(name: string): I.SysInfo; + + getSubsystems(): I.SysInfo[]; + } + + namespace I { + interface ReportOptions { + events?: string; + signal?: string; + filename?: string; + directory?: string; + } + } + + class Application extends Subsystem { + readonly isMain: boolean; + + main(): void; + + enableReport(opts?: I.ReportOptions): void; + + reportEnabled(): boolean; + + run(): Promise; + + exit(code?: number): Promise; + + exitOnSignal(...names: string[]): void; + + removeProcesshandlers(): void; + + _uncaughtException(err: any): void; + + _unhandledRejection(reson: any, p: Promise): void; + + _rejectionHandled(p: Promise): void; + + _signalExit(sigName: string): void; + + } + + namespace I { + interface Command { + // ? + } + + interface Argument { + // ? + } + + interface PositionalArgument extends Argument { + // ? + } + + interface OptionalArgument extends Argument { + // ? + } + + interface DefineCommandFromSubsystemOptions { + name?: string; + description?: string; + group?: string; + subsystem: string | Subsystem; + configureArgs?: any[]; + lazily?: boolean; + transpile?: boolean; + } + } + + class CliApplication extends Application { + run(options?: { ignoreArgs?: boolean }): Promise; + + getVersion(): Promise; + + exposeCliInterface(ctxId?: string): void; + + readonly mainCommand: I.Command; + + defineMainCommand(schema: I.MainCommandInfo): this; + + defineArguments(schema: I.MainCommandInfo): this; + + defineCommand(schema: I.CommandInfo): I.Command; + + defineCommandFromSubsystem(options?: I.DefineCommandFromSubsystemOptions): void; + + defineOption(schema: I.ArgumentInfo): void; + + defineOptionsGroup(schema: I.Group): void; + + defineCommandsGroup(schema: I.Group): void; + + option(path: string, options?: { value?: boolean }): any; + } + + function run(app: Application, ignoreArgs?: boolean): Promise; + + function runCli(app: CliApplication, ignoreArgs?: boolean): Promise; } } diff --git a/types/adone/glosses/archives.d.ts b/types/adone/glosses/archives.d.ts index 3f059ff14d..ddeb25d891 100644 --- a/types/adone/glosses/archives.d.ts +++ b/types/adone/glosses/archives.d.ts @@ -448,7 +448,7 @@ declare namespace adone { isCompressed(): boolean; } - interface ZipFile extends event.EventEmitter { + interface ZipFile extends event.Emitter { /** * true until close() is called; then it's false */ diff --git a/types/adone/glosses/assertion.d.ts b/types/adone/glosses/assertion.d.ts index e7ba662791..ca0d75bdf5 100644 --- a/types/adone/glosses/assertion.d.ts +++ b/types/adone/glosses/assertion.d.ts @@ -38,7 +38,7 @@ declare namespace adone { proxyExcludedKeys: string[]; } - type PossibleTypes = util.I.PossibleTypes | "array"; + type PossibleTypes = meta.I.PossibleTypes | "array"; type UseFunction = (fn: () => void) => assertion; @@ -53,18 +53,10 @@ declare namespace adone { * Throws an AssertionError, like node.js */ fail(actual?: any, expected?: any, message?: string, operator?: any): void; - /** - * Asserts that value is truthy - */ - isOk(value: any, message?: string): void; /** * Asserts that value is truthy */ ok(value: any, message?: string): void; - /** - * Asserts that value is falsy - */ - isNotOk(value: any, message?: string): void; /** * Asserts that value is falsy */ @@ -104,51 +96,51 @@ declare namespace adone { /** * Asserts that value > above */ - isAbove(value: any, above: any, message?: string): void; + above(value: any, above: any, message?: string): void; /** * Asserts that value >= atLeast */ - isAtLeast(value: any, atLeast: any, message?: string): void; + atLeast(value: any, atLeast: any, message?: string): void; /** * Asserts that value < below */ - isBelow(value: any, below: any, message?: string): void; + below(value: any, below: any, message?: string): void; /** * Asserts that value <= atMost */ - isAtMost(value: any, atMost: any, message?: string): void; + atMost(value: any, atMost: any, message?: string): void; /** * Asserts that value is true */ - isTrue(value: any, message?: string): void; + true(value: any, message?: string): void; /** * Asserts that value is not true */ - isNotTrue(value: any, message?: string): void; + notTrue(value: any, message?: string): void; /** * Asserts that value is false */ - isFalse(value: any, message?: string): void; + false(value: any, message?: string): void; /** * Asserts that value is not false */ - isNotFalse(value: any, message?: string): void; + notFalse(value: any, message?: string): void; /** * Asserts that value is null */ - isNull(value: any, message?: string): void; + null(value: any, message?: string): void; /** * Asserts that valus is not null */ - isNotNull(value: any, message?: string): void; + notNull(value: any, message?: string): void; /** * Asserts that value is NaN */ - isNaN(value: any, message?: string): void; + NaN(value: any, message?: string): void; /** * Asserts that value is not NaN */ - isNotNaN(value: any, message?: string): void; + NotNaN(value: any, message?: string): void; /** * Asserts that value is neither null nor undefined */ @@ -160,63 +152,63 @@ declare namespace adone { /** * Asserts that value is undefined */ - isUndefined(value: any, message?: string): void; + undefined(value: any, message?: string): void; /** * Asserts that value is not undefined */ - isDefined(value: any, message?: string): void; + defined(value: any, message?: string): void; /** * Asserts that value is a function */ - isFunction(value: any, message?: string): void; + function(value: any, message?: string): void; /** * Asserts that value is not a function */ - isNotFunction(value: any, message?: string): void; + notFunction(value: any, message?: string): void; /** * Asserts that value is an object of type Object */ - isObject(value: any, message?: string): void; + object(value: any, message?: string): void; /** * Asserts that value is not an object of type Object */ - isNotObject(value: any, message?: string): void; + notObject(value: any, message?: string): void; /** * Asserts that value is an array */ - isArray(value: any, message?: string): void; + array(value: any, message?: string): void; /** * Asserts that value is not an array */ - isNotArray(value: any, message?: string): void; + notArray(value: any, message?: string): void; /** * Asserts that value is a string */ - isString(value: any, message?: string): void; + string(value: any, message?: string): void; /** * Asserts that value is not a string */ - isNotString(value: any, message?: string): void; + notString(value: any, message?: string): void; /** * Asserts that value is a number */ - isNumber(value: any, message?: string): void; + number(value: any, message?: string): void; /** * Asserts that value is not a number */ - isNotNumber(value: any, message?: string): void; + notNumber(value: any, message?: string): void; /** * Asserts that value is a finite number */ - isFinite(value: any, message?: string): void; + finite(value: any, message?: string): void; /** * Asserts that value is a boolean */ - isBoolean(value: any, message?: string): void; + boolean(value: any, message?: string): void; /** * Asserts that value is not a boolean */ - isNotBoolean(value: any, message?: string): void; + notBoolean(value: any, message?: string): void; /** * Asserts that value's type is `type` */ @@ -562,66 +554,34 @@ declare namespace adone { * Throws an error if value is truthy */ ifError(value: any): void; - /** - * Asserts that object is extensible - */ - isExtensible(object: object, message?: string): void; /** * Asserts that object is extensible */ extensible(object: object, message?: string): void; - /** - * Asserts that object is not extensible - */ - isNotExtensible(object: object, message?: string): void; /** * Asserts that object is not extensible */ notExtensible(object: object, message?: string): void; - /** - * Asserts that object is sealed - */ - isSealed(object: object, message?: string): void; /** * Asserts that object is sealed */ sealed(object: object, message?: string): void; - /** - * Asserts that object is not sealed - */ - isNotSealed(object: object, message?: string): void; /** * Asserts that object is not sealed */ notSealed(object: object, message?: string): void; - /** - * Asserts that object is frozen - */ - isFrozen(object: object, message?: string): void; /** * Asserts that object is frozen */ frozen(object: object, message?: string): void; - /** - * Asserts that object is not frozen - */ - isNotFrozen(object: object, message?: string): void; /** * Asserts that object is not frozen */ notFrozen(object: object, message?: string): void; - /** - * Asserts that value is empty - */ - isEmpty(value: any, message?: string): void; /** * Asserts that value is empty */ empty(value: any, message?: string): void; - /** - * Asserts that value is not empty - */ - isNotEmpty(value: any, message?: string): void; /** * Asserts that value is not empty */ @@ -710,43 +670,43 @@ declare namespace adone { /** * Asserts that the target is non-strictly equal to true */ - ok: this; + ok(): this; /** * Asserts that the target is true */ - true: this; + true(): this; /** * Asserts that the target is false */ - false: this; + false(): this; /** * Asserts that the target is null */ - null: this; + null(): this; /** * Asserts that the target is undefined */ - undefined: this; + undefined(): this; /** * Asserts that the target is NaN */ - NaN: this; + NaN(): this; /** * Asserts that the target is neither null nor undefined */ - exist: this; + exist(): this; /** * Asserts that the target is empty */ - empty: this; + empty(): this; /** * Asserts that the target is an arguments object */ - arguments: this; + arguments(): this; /** * Asserts that the target is an arguments object */ - Arguments: this; + Arguments(): this; /** * Asserts that the target is strictly equal to value(===) */ @@ -976,26 +936,26 @@ declare namespace adone { /** * Asserts that the target is extensible */ - extensible: this; + extensible(): this; /** * Asserts that the target is sealed */ - sealed: this; + sealed(): this; /** * Asserts that the target is frozen */ - frozen: this; + frozen(): this; /** * Asserts that the target is a finite number */ - finite: this; + finite(): this; } interface MockAssertions extends Assertion { /** * Asserts that the spy has been called */ - called: this; + called(): this; /** * Asserts that the spy has been called n times */ @@ -1003,15 +963,15 @@ declare namespace adone { /** * Asserts that the spy has been called once */ - calledOnce: this; + calledOnce(): this; /** * Asserts that the spy has been called twice */ - calledTwice: this; + calledTwice(): this; /** * Asserts that the spy has been been called with `new` */ - calledThrice: this; + calledThrice(): this; /** * Asserts that the spy has been called before anotherSpy */ @@ -1059,7 +1019,7 @@ declare namespace adone { } } - class AssertionError extends x.Exception { + class AssertionError extends exception.Exception { constructor(message?: string, props?: object, ssf?: object) } diff --git a/types/adone/glosses/data.d.ts b/types/adone/glosses/data.d.ts index f711836bdd..a22ba10750 100644 --- a/types/adone/glosses/data.d.ts +++ b/types/adone/glosses/data.d.ts @@ -30,7 +30,12 @@ declare namespace adone { * or an array of String and Number objects that serve as a whitelist * for selecting/filtering the properties of the value object to be included in the JSON string */ - replacer?: I.Replacer + replacer?: I.Replacer, + + /** + * Wheter to append a newline + */ + newline?: boolean }): Buffer; /** @@ -84,6 +89,8 @@ declare namespace adone { */ function decode(buf: collection.I.ByteArray.Wrappable): any; + function tryDecode(buf: collection.ByteArray): any; + namespace I { type Type = string | number; // ? type DecodeFunction = (buf: collection.ByteArray) => any; @@ -153,6 +160,8 @@ declare namespace adone { * Represents a MessagePack serializer */ class Serializer { + constructor(initialCapacity?: number); + /** * Encoder instance */ @@ -211,6 +220,8 @@ declare namespace adone { * x.Exception, Error, Date, Map, Set, math.Long */ const serializer: Serializer; + + function registerCommonTypesFor(s: Serializer): void; } /** @@ -244,21 +255,32 @@ declare namespace adone { * Base64 encoder */ namespace base64 { + namespace I { + interface DecodeOptions { + buffer?: boolean; + encoding?: string; + } + + interface EncodeOptions { + buffer?: boolean; + } + } + /** * Encodes a string/Buffer to base64 */ - function encode(str: string | Buffer, options: { buffer: false }): string; - function encode(str: string | Buffer, options?: { buffer?: true }): Buffer; + function encode(str: string | Buffer, options: I.EncodeOptions & { buffer: false }): string; + function encode(str: string | Buffer, options?: I.EncodeOptions): Buffer; /** * Decodes base64 string/buffer into a buffer */ - function decode(str: string | Buffer, options: { buffer: true }): Buffer; + function decode(str: string | Buffer, options: I.DecodeOptions & { buffer: true }): Buffer; /** * Decodes base64 string/buffer into a string */ - function decode(str: string | Buffer, options?: { buffer?: false }): string; + function decode(str: string | Buffer, options?: I.DecodeOptions): string; function encodeVLQ(value: number): string; @@ -560,7 +582,7 @@ declare namespace adone { /** * Represents a YAML exception */ - class Exception extends adone.x.Exception { + class Exception extends adone.exception.Exception { reason: string; mark: Mark; diff --git a/types/adone/glosses/events.d.ts b/types/adone/glosses/events.d.ts index ecb323f925..e812624aa9 100644 --- a/types/adone/glosses/events.d.ts +++ b/types/adone/glosses/events.d.ts @@ -1,25 +1,48 @@ declare namespace adone { namespace event { - class EventEmitter { - static listenerCount(emitter: EventEmitter, event: string | symbol): number; + namespace I { + interface PropagateEventsEnder { + end(): void; + } + } + + class Emitter { + static listenerCount(emitter: Emitter, event: string | symbol): number; + static defaultMaxListeners: number; addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Array<(...args: any[]) => any>; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): Array; + listenerCount(type: string | symbol): number; + + propagateEvents(dest: Emitter, events: string[]): I.PropagateEventsEnder; + + static propagateEvents(source: Emitter, dest: Emitter, events: string[]): I.PropagateEventsEnder; } - class AsyncEmitter extends EventEmitter { + class AsyncEmitter extends Emitter { constructor(concurrency?: number); setConcurrency(max?: number): this; diff --git a/types/adone/glosses/exceptions.d.ts b/types/adone/glosses/exceptions.d.ts index 347a3c632d..1b1981f80e 100644 --- a/types/adone/glosses/exceptions.d.ts +++ b/types/adone/glosses/exceptions.d.ts @@ -1,5 +1,5 @@ declare namespace adone { - namespace x { + namespace exception { class Exception extends Error { constructor(message?: string | Error, captureStackTrace?: boolean); } diff --git a/types/adone/glosses/fast.d.ts b/types/adone/glosses/fast.d.ts index 725e0e9db3..1b04bec6d3 100644 --- a/types/adone/glosses/fast.d.ts +++ b/types/adone/glosses/fast.d.ts @@ -152,7 +152,7 @@ declare namespace adone { type SymbolicFile = File; /* tslint:disable-next-line:no-empty-interface */ - interface Stream extends stream.CoreStream { + interface Stream extends stream.core.Stream { // } } @@ -160,7 +160,7 @@ declare namespace adone { export const File: I.FileConstructor; namespace I { - type CoreStreamSource = stream.I.CoreStream.Source; + type CoreStreamSource = stream.core.I.Source; interface LocalStreamConstructorOptions { /** @@ -586,7 +586,7 @@ declare namespace adone { /** * Read JSON manifests written out by revisionHash */ - manifest?: File[] | stream.CoreStream, + manifest?: File[] | stream.core.Stream, /** * Modify the name of the unreved files before using them diff --git a/types/adone/glosses/fs.d.ts b/types/adone/glosses/fs.d.ts index 7fa8f51593..7517764faf 100644 --- a/types/adone/glosses/fs.d.ts +++ b/types/adone/glosses/fs.d.ts @@ -22,6 +22,14 @@ declare namespace adone { function readlink(path: string | Buffer | I.URL, options: { encoding: null }): Promise; function readlink(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): Promise; + /** + * Reads the value of a symbolic link + */ + function readlinkSync(path: string | Buffer | I.URL, encoding: null): Buffer; + function readlinkSync(path: string | Buffer | I.URL, encoding: I.Encoding): string; + function readlinkSync(path: string | Buffer | I.URL, options: { encoding: null }): Buffer; + function readlinkSync(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): string; + /** * Deletes a name and possibly the file it refers to */ @@ -32,6 +40,21 @@ declare namespace adone { */ function unlinkSync(path: string | Buffer | I.URL): void; + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimes(path: string | Buffer | I.URL, atime: number | string | Date, mtime: number | string | Date): Promise; + + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimesSync(path: string | Buffer | I.URL, atime: number | string | Date, mtime: number | string | Date): void; + + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimesMillis(path: string | Buffer | I.URL, atime: number, mtime: number): Promise; + /** * Changes permissions of a file */ @@ -42,6 +65,11 @@ declare namespace adone { */ function chown(path: string | Buffer | I.URL, uid: number, gid: number): Promise; + /** + * Changes ownership recursively for a given path + */ + function chownr(path: string | Buffer | I.URL, uid: number, gid: number): Promise; + /** * Deletes a directory */ @@ -63,6 +91,87 @@ declare namespace adone { function readdirSync(path: string | Buffer | I.URL, options: { encoding: null }): Buffer[]; function readdirSync(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): string[]; + namespace I { + interface ReaddirpEntry { + /** + * filename + */ + name: string; + + /** + * full path to a file + */ + fullPath: string; + + /** + * relative path to a file + */ + path: string; + + /** + * relative path to the parent dir + */ + parentDir: string; + + /** + * full path to the parent dir + */ + fullParentDir: string; + + /** + * file stats + */ + stat: fs.I.Stats; + } + + type ReaddirpFilter = string | ((entry: ReaddirpEntry) => boolean); + + interface ReaddirpOptions { + /** + * filter for files + */ + fileFilter?: ReaddirpFilter | ReaddirpFilter[]; + + /** + * filter for directories + */ + directoryFilter?: ReaddirpFilter | ReaddirpFilter[]; + + /** + * maximum recursion depth + * + * Infinity by default + */ + depth?: number; + + /** + * whether to emit files + * + * true by default + */ + files?: boolean; + + /** + * whether to emit directories + * + * true by default + */ + directories?: boolean; + + /** + * whether to use lstat for stating + * + * false by default + */ + lstat?: boolean; + } + } + + /** + * Traverses the given path + */ + function readdirp(root: string | Buffer | I.URL, options?: I.ReaddirpOptions): stream.core.Stream; + /** * Gets file status, identical to stat, except that if pathname is a symbolic link, * then it returns information about the link itself, not the file that it refers to @@ -117,6 +226,15 @@ declare namespace adone { flag?: I.Flag }): Promise; + /** + * Appends data to a file, creating the file if it does not yet exist + */ + function appendFileSync(file: string | Buffer | number, data: string | Buffer, options?: { + encoding?: I.Encoding, + mode?: number, + flag?: I.Flag + }): void; + /** * Tests a user's permissions for the file or directory specified by path */ @@ -154,6 +272,14 @@ declare namespace adone { cwd?: string }): Promise; + /** + * Recursively deletes empty directiries inside the given directory + */ + function rmEmpty(path: string, options?: { + cwd?: string; + filter?: (filename: string) => boolean + }): Promise; + namespace I { interface Access { read: boolean; @@ -460,12 +586,12 @@ declare namespace adone { /** * Copies this from this directory to the given path */ - copyTo(destPath: string, options?: I.CopyOptions): Promise; + copyTo(destPath: string, options?: I.CopyToOptions): Promise; /** * Copies files from the given path to this directory */ - copyFrom(srcPath: string, options?: I.CopyOptions): Promise; + copyFrom(srcPath: string, options?: I.CopyToOptions): Promise; /** * Creates a new directory with the given path @@ -560,7 +686,7 @@ declare namespace adone { /** * Represents a file that supports random access */ - class RandomAccessFile extends event.EventEmitter { + class RandomAccessFile extends event.Emitter { constructor(filename: string, options?: I.RandomAccessFile.ConstructorOptions); /** @@ -602,7 +728,7 @@ declare namespace adone { /** * Represents an abstract random access reader */ - class AbstractRandomAccessReader extends event.EventEmitter { + class AbstractRandomAccessReader extends event.Emitter { /** * Increments the reference counter */ @@ -826,7 +952,7 @@ declare namespace adone { }>; } - type Stream = stream.CoreStream; + type Stream = stream.core.Stream; interface EmitterConstructor { new(pattern: string, optons: Options, callback?: (error: any, matches: string[]) => void): Emitter; @@ -835,7 +961,7 @@ declare namespace adone { prototype: Emitter; } - interface Emitter extends event.EventEmitter { + interface Emitter extends event.Emitter { isIgnored(path: string): boolean; /** @@ -999,7 +1125,7 @@ declare namespace adone { /** * Represents a file watcher */ - class Watcher extends event.EventEmitter { + class Watcher extends event.Emitter { constructor(options?: I.Watcher.ConstructorOptions); /** @@ -1128,214 +1254,209 @@ declare namespace adone { function whichSync(cmd: string, options?: I.Which.Options): string; /** - * Functions to work with files using file descriptors + * Opens and possibly creates a file */ - namespace fd { - /** - * Opens and possibly create a file - */ - function open(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): Promise; + function open(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): Promise; - /** - * Opens and possibly create a file - */ - function openSync(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): I.FD; + /** + * Opens and possibly creates a file + */ + function openSync(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): I.FD; - /** - * Closes a file descriptor - */ - function close(fd: I.FD): Promise; + /** + * Closes a file descriptor + */ + function close(fd: I.FD): Promise; - /** - * Closes a file descriptor - */ - function closeSync(fd: I.FD): void; + /** + * Closes a file descriptor + */ + function closeSync(fd: I.FD): void; - /** - * Changes the file timestamps of a file referenced by the supplied file descriptor - */ - function utimes(fd: I.FD, atime: number, mtime: number): Promise; + /** + * Changes the file timestamps of a file referenced by the supplied file descriptor + */ + function futimes(fd: I.FD, atime: number, mtime: number): Promise; - /** - * Changes the file timestamps of a file referenced by the supplied file descriptor - */ - function utimesSync(fd: I.FD, atime: number, mtime: number): void; + /** + * Changes the file timestamps of a file referenced by the supplied file descriptor + */ + function futimesSync(fd: I.FD, atime: number, mtime: number): void; - /** - * Gets file status - */ - function stat(fd: I.FD): Promise; + /** + * Gets file status + */ + function fstat(fd: I.FD): Promise; - /** - * Gets file status - */ - function statSync(fd: I.FD): I.Stats; + /** + * Gets file status + */ + function fstatSync(fd: I.FD): I.Stats; - /** - * Truncates a file to a specified length - */ - function truncate(fd: I.FD, length?: number): Promise; + /** + * Truncates a file to a specified length + */ + function ftruncate(fd: I.FD, length?: number): Promise; - /** - * Truncates a file to a specified length - */ - function truncateSync(fd: I.FD, length?: number): void; + /** + * Truncates a file to a specified length + */ + function ftruncateSync(fd: I.FD, length?: number): void; + /** + * Read data from the file specified by fd + */ + function read( + fd: I.FD, /** - * Read data from the file specified by fd + * The buffer that the data will be written to */ - function read( - fd: I.FD, - /** - * The buffer that the data will be written to - */ - buffer: Buffer | Uint8Array, - /** - * The offset in the buffer to start writing at - */ - offset: number, - /** - * An integer specifying the number of bytes to read - */ - length: number, - /** - * An argument specifying where to begin reading from in the file - */ - position: number - ): Promise; - - function readSync( - fd: I.FD, - /** - * The buffer that the data will be written to - */ - buffer: Buffer | Uint8Array, - /** - * The offset in the buffer to start writing at - */ - offset: number, - /** - * An integer specifying the number of bytes to read - */ - length: number, - /** - * An argument specifying where to begin reading from in the file - */ - position: number - ): number; - + buffer: Buffer | Uint8Array, /** - * Writes buffer to the file specified by fd + * The offset in the buffer to start writing at */ - function write( - fd: I.FD, - buffer: Buffer | Uint8Array, - /** - * Determines the part of the buffer to be written - */ - offset?: number, - /** - * An integer specifying the number of bytes to write - */ - length?: number, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number - ): Promise; - + offset: number, /** - * Writes string to the file specified by fd + * An integer specifying the number of bytes to read */ - function write( - fd: I.FD, - string: string, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number, - /** - * The expected string encoding - */ - encoding?: I.Encoding - ): Promise; - + length: number, /** - * Writes buffer to the file specified by fd + * An argument specifying where to begin reading from in the file */ - function writeSync( - fd: I.FD, - buffer: Buffer | Uint8Array, - /** - * Determines the part of the buffer to be written - */ - offset?: number, - /** - * An integer specifying the number of bytes to write - */ - length?: number, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number - ): number; + position: number + ): Promise; + function readSync( + fd: I.FD, /** - * Writes string to the file specified by fd + * The buffer that the data will be written to */ - function writeSync( - fd: I.FD, - string: string, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number, - /** - * The expected string encoding - */ - encoding?: I.Encoding - ): number; + buffer: Buffer | Uint8Array, + /** + * The offset in the buffer to start writing at + */ + offset: number, + /** + * An integer specifying the number of bytes to read + */ + length: number, + /** + * An argument specifying where to begin reading from in the file + */ + position: number + ): number; + /** + * Writes buffer to the file specified by fd + */ + function write( + fd: I.FD, + buffer: Buffer | Uint8Array, /** - * Synchronizes a file's in-core state with storage + * Determines the part of the buffer to be written */ - function sync(fd: I.FD): Promise; + offset?: number, + /** + * An integer specifying the number of bytes to write + */ + length?: number, + /** + * The offset from the beginning of the file where this data should be written + */ + position?: number + ): Promise; + /** + * Writes string to the file specified by fd + */ + function write( + fd: I.FD, + string: string, /** - * Synchronizes a file's in-core state with storage + * The offset from the beginning of the file where this data should be written */ - function syncSync(fd: I.FD): void; + position?: number, + /** + * The expected string encoding + */ + encoding?: I.Encoding + ): Promise; + /** + * Writes buffer to the file specified by fd + */ + function writeSync( + fd: I.FD, + buffer: Buffer | Uint8Array, /** - * Changes ownership of a file + * Determines the part of the buffer to be written */ - function chown(fd: I.FD, uid: number, gid: number): Promise; + offset?: number, + /** + * An integer specifying the number of bytes to write + */ + length?: number, + /** + * The offset from the beginning of the file where this data should be written + */ + position?: number + ): number; + /** + * Writes string to the file specified by fd + */ + function writeSync( + fd: I.FD, + string: string, /** - * Changes ownership of a file + * The offset from the beginning of the file where this data should be written */ - function chownSync(fd: I.FD, uid: number, gid: number): void; + position?: number, + /** + * The expected string encoding + */ + encoding?: I.Encoding + ): number; - /** - * Changes permissions of a file - */ - function chmod(fd: I.FD, mode: number): Promise; + /** + * Synchronizes a file's in-core state with storage + */ + function fsync(fd: I.FD): Promise; - /** - * Changes permissions of a file - */ - function chmodSync(fd: I.FD, mode: number): void; + /** + * Synchronizes a file's in-core state with storage + */ + function fsyncSync(fd: I.FD): void; - /** - * Repositions read/write file offset - */ - function seek(fd: I.FD, offset: number, whence: number): Promise; + /** + * Changes ownership of a file + */ + function fchown(fd: I.FD, uid: number, gid: number): Promise; - /** - * Applies or removes an advisory lock on an open file - */ - function lock(fd: I.FD, flags: "sh" | "ex" | "shnb" | "exnb" | "un" | number): Promise; - } + /** + * Changes ownership of a file + */ + function fchownSync(fd: I.FD, uid: number, gid: number): void; + + /** + * Changes permissions of a file + */ + function fchmod(fd: I.FD, mode: number): Promise; + + /** + * Changes permissions of a file + */ + function fchmodSync(fd: I.FD, mode: number): void; + + /** + * Repositions read/write file offset + */ + function seek(fd: I.FD, offset: number, whence: number): Promise; + + /** + * Applies or removes an advisory lock on an open file + */ + function flock(fd: I.FD, flags: "sh" | "ex" | "shnb" | "exnb" | "un" | number): Promise; namespace constants { const F_OK: number; @@ -1475,12 +1596,63 @@ declare namespace adone { function existsSync(path: string | Buffer | I.URL): boolean; /** - * Creates a new directory and any necessary subdirectories + * Creates a new directory */ function mkdir(path: string, mode?: number): Promise; + /** + * Creates a new directory + */ + function mkdirSync(path: string, mode?: number): Promise; + + /** + * Creates a new directory and any necessary subdirectories + */ + function mkdirp(path: string, mode?: number): Promise; + + /** + * Creates a new directory and any necessary subdirectories + */ + function mkdirpSync(path: string, mode?: number): Promise; + namespace I { interface CopyOptions { + /** + * regexp or function against which each filename is tested whether to copy it or not + */ + filter?: RegExp | ((src: string, dst: string) => boolean); + + /** + * transform function which applies when files are streamed + */ + transform?( + readStream: NodeJS.ReadableStream, + writeStream: NodeJS.WritableStream, + file: { + name: string, + mode: number, + mtime: Date, + atime: Date, + stats: adone.fs.I.Stats + } + ): void; + + /** + * Whether to overwrite destination files if they exist. + * + * true by default + */ + clobber?: boolean; // ??? + + /** + * Whether to overwrite destination files if they exist. + * + * true by default + */ + overwrite?: boolean; + } + + interface CopyToOptions { /** * Do not replace existing files */ @@ -1494,10 +1666,15 @@ declare namespace adone { } /** - * Copies all files from src to dst + * Recursively copies all the files from src to dst */ function copy(src: string, dst: string, options?: I.CopyOptions): Promise; + /** + * Copies all files from src to dst + */ + function copyTo(src: string, dst: string, options?: I.CopyToOptions): Promise; + /** * Renames a file */ @@ -1514,8 +1691,32 @@ declare namespace adone { /** * Returns the last lines of a file + * + * @param path path to a file + * @param n number of lines to return */ - function tail(path: string, n: number, options?: { separator?: string, chunkLength?: number }): Promise; + function tail(path: string, n: number, options?: { + /** + * Line separator + * + * By default "\r\n" for windows and "\n" for others + */ + separator?: string, + + /** + * The number of bytes to read at once + * + * By default 4096 + */ + chunkLength?: number + + /** + * Position from which to start reading (from the end) + * + * By default stats.size of the file + */ + pos?: number + }): Promise; namespace I { interface StatVFS { @@ -1667,11 +1868,6 @@ declare namespace adone { */ function lookup(path: string): Promise; - /** - * Recursively changes ownership of files - */ - function chownr(path: string, uid: number, gid: number): Promise; - namespace I.TailWatcher { interface ConstructorOptions { /** @@ -1709,7 +1905,7 @@ declare namespace adone { * Represents an event emitter that watches for a file growing, * emits "line" event for each new line in a file */ - class TailWatcher extends event.EventEmitter { + class TailWatcher extends event.Emitter { constructor(filename: string, options?: I.TailWatcher.ConstructorOptions); /** diff --git a/types/adone/glosses/is.d.ts b/types/adone/glosses/is.d.ts index 335439a0bf..7df9559524 100644 --- a/types/adone/glosses/is.d.ts +++ b/types/adone/glosses/is.d.ts @@ -6,13 +6,13 @@ declare namespace adone { /** * Checks whether the given object is `null` */ - function _null(obj: any): boolean; + function _null(obj: any): obj is null; export { _null as null }; /** * Checks whether the given object is `undefined` */ - export function undefined(obj: any): boolean; + export function undefined(obj: any): obj is undefined; /** * Checks whether the given object is nither `undefined` nor `null` @@ -22,52 +22,54 @@ declare namespace adone { /** * Checks whether the given object is either `undefined` or `null` */ - export function nil(obj: any): boolean; + export function nil(obj: any): obj is undefined | null; /** * Checks whether the given object is a number */ - export function number(obj: any): boolean; + export function number(obj: any): obj is number; /** * Checks whether the given object is a finite number or a string represents a finite number */ - export function numeral(obj: any): boolean; + export function numeral(obj: number): obj is number; + export function numeral(obj: string): obj is string; + export function numeral(obj: any): obj is number | string; /** * Checks whether the given object is either +Infinity or -Inginity */ - export function infinite(obj: any): boolean; + export function infinite(obj: any): obj is number; /** * Checks whether the given object is an odd number */ - export function odd(obj: any): boolean; + export function odd(obj: any): obj is number; /** * Checks whether the given object is an even number */ - export function even(obj: any): boolean; + export function even(obj: any): obj is number; /** * Checks whether the given object is a float */ - export function float(obj: any): boolean; + export function float(obj: any): obj is number; /** * Checks whether the given object is -0 */ - export function negativeZero(obj: any): boolean; + export function negativeZero(obj: any): obj is number; /** * Checks whether the given object is a string */ - export function string(obj: any): boolean; + export function string(obj: any): obj is string; /** - * Checks whether the given object is an empty string + * Checks whether the given object is an empty string, i.e. a string with only whitespace characters */ - export function emptyString(obj: any): boolean; + export function emptyString(obj: any): obj is string; /** * Checks whether the first string is a substring of the second string from the given offset @@ -87,7 +89,7 @@ declare namespace adone { /** * Checks whether the given object is a boolean */ - export function boolean(obj: any): boolean; + export function boolean(obj: any): obj is boolean; /** * Checks whether the given object is a string with ".json" extension or an object @@ -215,7 +217,7 @@ declare namespace adone { /** * Checks whether the given string is a glob */ - export function glob(str: string): boolean; + export function glob(str: any): str is string; /** * Checks whether the given path is not a dot-file path (.secret) @@ -236,7 +238,7 @@ declare namespace adone { /** * Checks whether the given object is a promise */ - export function promise(obj: any): boolean; + export function promise(obj: any): obj is PromiseLike; /** * Checks whether the given string is a valid date-string @@ -246,7 +248,7 @@ declare namespace adone { /** * Checks whether the given object is a buffer */ - export function buffer(obj: any): boolean; + export function buffer(obj: any): obj is Buffer; /** * Checks whether the given object is a callback function, i.e. it has a common function name @@ -266,27 +268,27 @@ declare namespace adone { /** * Checks whether the given object is a finite number */ - export function finite(obj: any): boolean; + export function finite(obj: any): obj is number; /** * Checks whether the given object is an integer */ - export function integer(obj: any): boolean; + export function integer(obj: any): obj is number; /** * Checks whether the given object is a safe integer */ - export function safeInteger(obj: any): boolean; + export function safeInteger(obj: any): obj is number; /** * Checks whether the given object is an array */ - export function array(obj: any): boolean; + export function array(obj: any): obj is any[]; /** * Checks whether the given object is a Uint8 array */ - export function uint8Array(obj: any): boolean; + export function uint8Array(obj: any): obj is Uint8Array; /** * Checks whether the given object is an adone configuration @@ -296,22 +298,22 @@ declare namespace adone { /** * Checks whether the given object is an instance of adone.math.Long */ - export function long(obj: any): boolean; + export function long(obj: any): obj is adone.math.Long; /** * Checks whether the given object is an instance of adone.math.BigNumber */ - export function bigNumber(obj: any): boolean; + export function bigNumber(obj: any): obj is adone.math.BigNumber; /** * Checks whether the given object is an instance of adone.collection.ByteArray */ - export function byteArray(obj: any): boolean; + export function byteArray(obj: any): obj is adone.collection.ByteArray; /** * Checks whether the given object is an instance of adone.datetime */ - export function datetime(obj: any): boolean; + export function datetime(obj: any): obj is adone.I.datetime.Datetime; export function transform(obj: any): boolean; @@ -498,17 +500,17 @@ declare namespace adone { /** * Checks whether the given object is an array buffer */ - export function arrayBuffer(obj: any): boolean; + export function arrayBuffer(obj: any): obj is ArrayBuffer; /** * Checks whether the given object is an array buffer view */ - export function arrayBufferView(obj: any): boolean; + export function arrayBufferView(obj: any): obj is ArrayBufferView; /** * Checks whether the given object is a date */ - export function date(obj: any): boolean; + export function date(obj: any): obj is Date; /** * Checks whether the given object is an error, instance of Error @@ -518,27 +520,22 @@ declare namespace adone { /** * Checks whether the given object is a map */ - export function map(obj: any): boolean; + export function map(obj: any): obj is Map; /** * Checks whether the given object is a regexp */ - export function regexp(obj: any): boolean; + export function regexp(obj: any): obj is RegExp; /** * Checks whether the given object is a set */ - export function set(obj: any): boolean; + export function set(obj: any): obj is Set; /** * Checks whether the given object is a symbol */ - export function symbol(obj: any): boolean; - - /** - * Checks whether the given buffer a valid UTF-8 encoded text - */ - export function validUTF8(obj: Buffer): boolean; + export function symbol(obj: any): obj is symbol; /** * Checks whether the given object is a vault valuable @@ -549,5 +546,131 @@ declare namespace adone { * Checks whether the given object is an adone task */ export function task(obj: any): boolean; + + namespace I { + interface FQDNOptions { + /** + * Whether to require top-level domain, default `true` + */ + requireTld?: boolean; + + /** + * Whether to allow underscores("_"), default `false` + */ + allowUnderscores?: boolean; + + /** + * Whether to allow trailing dot, default `false` + */ + allowTrailingDot?: boolean; + } + } + + /** + * Checks whether the given object(string) is a fully qualified domain name (e.g. domain.com). + */ + export function fqdn(obj: any, options?: I.FQDNOptions): obj is string; + + /** + * Checks whether the given object(string) is a url + */ + export function url(obj: any, options?: I.FQDNOptions & { + /** + * List of valid protocols. + * Used when requireValidProtocol is `true`. + * Default ["http", "https", "ftp"] + */ + protocols?: string[], + + /** + * Whether to require protocol, default `true` + */ + requireProtocol?: boolean, + + /** + * Whether to require host, default `true` + */ + requireHost?: boolean, + + /** + * Whether to require valid protocol defined in `protocols` options, default `true` + */ + requireValidProtocol?: boolean, + + /** + * Whether to allow urls like "//example.com", default `false` + */ + allowProtocolRelativeUrls?: boolean + }): obj is string; + + /** + * Checks whether the given object(string) is a valid email address + */ + export function email(obj: any, options?: { + /** + * Whether to allow email addresses with display names ("Name "") + */ + allowDisplayName?: boolean, + + /** + * Whether to require display name + */ + requireDisplayName?: boolean, + + /** + * Whether to allow UTF8 characters in the local part + */ + allowUtf8LocalPart?: boolean, + + /** + * Whether to require top-level domain, default `true` + */ + requireTld?: boolean + }): obj is string; + + /** + * Checks whether the given object is a valid IPv4 address + */ + export function ip(obj: any, version: 4): boolean; + + /** + * Checks whether the given object is a valid IPv6 address + */ + export function ip(obj: any, version: 6): boolean; + + /** + * Checks whether the given object in a valid IPv4 or IPv6 address + */ + export function ip(obj: any): boolean; + + /** + * Checks whether the given object is a valid UUIDv1 identifier + */ + export function uuid(obj: any, version: 1): obj is string; + + /** + * Checks whether the given object is a valid UUIDv2 identifier + */ + export function uuid(obj: any, version: 2): obj is string; + + /** + * Checks whether the given object is a valid UUIDv3 identifier + */ + export function uuid(obj: any, version: 3): obj is string; + + /** + * Checks whether the given object is a valid UUIDv4 identifier + */ + export function uuid(obj: any, version: 4): obj is string; + + /** + * Checks whether the given object is a valid UUIDv5 identifier + */ + export function uuid(obj: any, version: 5): obj is string; + + /** + * Checks whether the given object is a valid UUID identifier (v1, v2, v3, v4 or v5) + */ + export function uuid(obj: any, version?: "all"): obj is string; } } diff --git a/types/adone/glosses/meta.d.ts b/types/adone/glosses/meta.d.ts new file mode 100644 index 0000000000..bc96c1e148 --- /dev/null +++ b/types/adone/glosses/meta.d.ts @@ -0,0 +1,13 @@ +declare namespace adone { + namespace meta { + namespace I { + type PossibleTypes = "object" | "class" | "null" | "global" | "Array" | "RegExp" | "Date" + | "Promise" | "Set" | "Map" | "WeakSet" | "DataView" | "Map Iterator" | "Set Iterator" + | "Array Iterator" | "String Iterator" | "Object" | "function" | "boolean" | "number" + | "undefined" | "string" | "symbol"; + } + + function typeOf(obj: any): I.PossibleTypes; + function typeOf(obj: any): string; + } +} diff --git a/types/adone/glosses/promise.d.ts b/types/adone/glosses/promise.d.ts index cdfe0ec2f5..cc0eac9c73 100644 --- a/types/adone/glosses/promise.d.ts +++ b/types/adone/glosses/promise.d.ts @@ -125,5 +125,36 @@ declare namespace adone { */ function _finally(promise: Promise, onFinally?: (...args: any[]) => void): Promise; export { _finally as finally }; + + namespace I { + type ResolvableProps = object & {[K in keyof T]: PromiseLike | T[K]}; + } + + /** + * Returns a promise that is fulfilled when all the object's values are fulfilled + */ + export function props(obj: I.ResolvableProps): Promise; + + namespace I { + interface _RetryOptions { + max: number; + + timeout: number; + + match: (string | RegExp | Error) | Array; + + backOffBase: number; + + backOffExponent: number; + + report: (message: string, options: _RetryOptions, err: any) => void; + + name: string; + } + + type RetryOptions = Partial<_RetryOptions>; + } + + export function retry(fn: (info: { current: number }) => PromiseLike | T, options?: number | I.RetryOptions): Promise; } } diff --git a/types/adone/glosses/shani.d.ts b/types/adone/glosses/shani.d.ts index 0b79633f78..5bc2d0153f 100644 --- a/types/adone/glosses/shani.d.ts +++ b/types/adone/glosses/shani.d.ts @@ -94,6 +94,11 @@ declare namespace adone { * Mark this block as exclusive */ skip: DescribeFunction; + + /** + * Mark this block as todo + */ + todo: DescribeFunction; } interface TestOptions { @@ -146,6 +151,11 @@ declare namespace adone { * Mark this test as exclusive */ skip: TestFunction; + + /** + * Mark this test as todo + */ + todo: TestFunction; } interface HookRuntimeContext { @@ -172,7 +182,7 @@ declare namespace adone { | "end before each hook" | "end after each hook" | "end before test hook" | "end after test hook"; - interface Emitter extends event.EventEmitter { + interface Emitter extends event.Emitter { on(event: "enter block", listener: (event: { block: Block }) => void): this; on(event: "exit block", listener: (event: { block: Block }) => void): this; on(event: "start test", listener: (event: { block: Block, test: Test }) => void): this; @@ -267,6 +277,11 @@ declare namespace adone { */ only(): this; + /** + * Marks this test as todo + */ + todo(): this; + /** * Returns the timeout of the test */ @@ -355,6 +370,11 @@ declare namespace adone { */ only(): this; + /** + * Marks this block as todo + */ + todo(): this; + /** * Returns the timeout of the block */ @@ -1423,7 +1443,7 @@ declare namespace adone { /** * Requires the value to be of the given type */ - typeOf(type: adone.util.I.PossibleTypes): Matcher; + typeOf(type: adone.meta.I.PossibleTypes): Matcher; typeOf(type: string): Matcher; /** diff --git a/types/adone/glosses/streams.d.ts b/types/adone/glosses/streams.d.ts index 012a6aadc3..e4d07065b6 100644 --- a/types/adone/glosses/streams.d.ts +++ b/types/adone/glosses/streams.d.ts @@ -1,223 +1,225 @@ declare namespace adone { namespace stream { - namespace I.CoreStream { - interface ConstructorOptions { - /** - * Whether the initial stream is asynchronous - */ - async?: boolean; + namespace core { + namespace I { + interface ConstructorOptions { + /** + * Whether the initial stream is asynchronous + */ + async?: boolean; - /** - * Whether the initial stream is synchronous - */ - sync?: boolean; + /** + * Whether the initial stream is synchronous + */ + sync?: boolean; - /** - * The initial transform (passthrough is default) - */ - transform?: TransformFunction; + /** + * The initial transform (passthrough is default) + */ + transform?: TransformFunction; - /** - * The initial flush function - */ - flush?: FlushFunction; + /** + * The initial flush function + */ + flush?: FlushFunction; + } + + type Source = S[] | Stream; + + interface TransformContext { + /** + * Pushes the given value into the stream + */ + push(value: T): boolean; + } + + type TransformFunction = (this: TransformContext, value: S) => void; + type FlushFunction = (this: TransformContext) => void; } - type Source = S[] | CoreStream; + /** + * Represents a chain of transform streams + */ + class Stream implements PromiseLike { + constructor(source?: I.Source, options?: I.ConstructorOptions); + + /** + * Writes the given value into the stream + */ + write(value: S): boolean; - interface TransformContext { /** * Pushes the given value into the stream */ push(value: T): boolean; + + /** + * Ends the stream + */ + end(): this; + + /** + * Destroys the stream + */ + destroy(): this; + + /** + * Pauses the stream + */ + pause(): this; + + /** + * Resumes the stream + */ + resume(): this; + + /** + * Whether the stream is paused + */ + isPaused(): boolean; + + /** + * Whether the stream is ended + */ + isEnded(): boolean; + + /** + * Pipes this stream to another + */ + pipe(stream: T, options?: { end?: boolean }): T; + + /** + * Adds a new synchronous transform stream into the chain + */ + throughSync(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new asynchronous transform stream into the chain + */ + throughAsync(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new transform stream into the chain + */ + through(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new map transform into the chain. + * + * Note: synchronous functions create a synchronous transform. + * If your function returns a promise use an asynchronous function if you don't want to pass a promise through the stream + */ + map(callback: (value: T) => R | Promise): Stream; + + /** + * Adds a new conditional map transform into the chain + */ + mapIf(condition: (value: T) => boolean | Promise, callback: (value: T) => R): Stream; + + /** + * Adds a new filter transform into the chain + */ + filter(callback: (value: T) => boolean | Promise): this; + + /** + * Adds a new transform that calls the given callback for each value from the stream. + * + * This method resumes the stream. + */ + forEach(callback: (value: T) => void, options?: { + /** + * Whethe to wait for asynchronous functions (await) + */ + wait?: boolean, + + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that calls the given callback when the underlying stream ends. + * + * This method resumes the stream. + */ + done(callback: () => void, options?: { + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that gather all the read values into an array and calls the given callback + * when the underlying stream ends. + * + * This method resumes the stream. + */ + toArray(callback: (result: T[]) => void, options?: { + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that filters the values by their uniqueness + * + * @param prop callback that calculates value's hash which is used in uniqueness checks + */ + unique(prop?: (value: T) => any): this; + + /** + * Adds a new transform that filters the values using the given given function with ability to restore the filtered values + */ + stash(name: string, filter: (value: T) => boolean): this; + stash(filter: (value: T) => boolean): this; + + /** + * Adds a new transform that restores the previous stashed values + */ + unstash(name?: string): Stream; // ?? + + /** + * Flattens all the read array values + */ + flatten(): Stream; // ?? + + /** + * Merges the given stream into a core stream + */ + static merge(streams: Array | nodestd.stream.Transform | nodestd.stream.Readable | nodestd.stream.Duplex>, options?: { + /** + * Whether to end the stream when all the given streams end + */ + end?: boolean, + + /** + * Options for the initial core stream + */ + sourceOptions?: I.ConstructorOptions + }): Stream; + + /** + * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. + * + * This method resumes the stream. + */ + then(onResolve?: (value: T[]) => T1 | PromiseLike, onReject?: (reason: any) => T2 | PromiseLike): Promise; + + /** + * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. + * + * This method resumes the stream. + */ + catch(onReject?: (reason: any) => T1 | PromiseLike): Promise; } - type TransformFunction = (this: TransformContext, value: S) => void; - type FlushFunction = (this: TransformContext) => void; + /** + * Creates a CoreStream instance + */ + function create(source?: I.Source, options?: I.ConstructorOptions): Stream; } - - /** - * Represents a chain of transform streams - */ - class CoreStream implements PromiseLike { - constructor(source?: I.CoreStream.Source, options?: I.CoreStream.ConstructorOptions); - - /** - * Writes the given value into the stream - */ - write(value: S): boolean; - - /** - * Pushes the given value into the stream - */ - push(value: T): boolean; - - /** - * Ends the stream - */ - end(): this; - - /** - * Destroys the stream - */ - destroy(): this; - - /** - * Pauses the stream - */ - pause(): this; - - /** - * Resumes the stream - */ - resume(): this; - - /** - * Whether the stream is paused - */ - isPaused(): boolean; - - /** - * Whether the stream is ended - */ - isEnded(): boolean; - - /** - * Pipes this stream to another - */ - pipe(stream: T, options?: { end?: boolean }): T; - - /** - * Adds a new synchronous transform stream into the chain - */ - throughSync(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new asynchronous transform stream into the chain - */ - throughAsync(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new transform stream into the chain - */ - through(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new map transform into the chain. - * - * Note: synchronous functions create a synchronous transform. - * If your function returns a promise use an asynchronous function if you don't want to pass a promise through the stream - */ - map(callback: (value: T) => R | Promise): CoreStream; - - /** - * Adds a new conditional map transform into the chain - */ - mapIf(condition: (value: T) => boolean | Promise, callback: (value: T) => R): CoreStream; - - /** - * Adds a new filter transform into the chain - */ - filter(callback: (value: T) => boolean | Promise): this; - - /** - * Adds a new transform that calls the given callback for each value from the stream. - * - * This method resumes the stream. - */ - forEach(callback: (value: T) => void, options?: { - /** - * Whethe to wait for asynchronous functions (await) - */ - wait?: boolean, - - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that calls the given callback when the underlying stream ends. - * - * This method resumes the stream. - */ - done(callback: () => void, options?: { - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that gather all the read values into an array and calls the given callback - * when the underlying stream ends. - * - * This method resumes the stream. - */ - toArray(callback: (result: T[]) => void, options?: { - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that filters the values by their uniqueness - * - * @param prop callback that calculates value's hash which is used in uniqueness checks - */ - unique(prop?: (value: T) => any): this; - - /** - * Adds a new transform that filters the values using the given given function with ability to restore the filtered values - */ - stash(name: string, filter: (value: T) => boolean): this; - stash(filter: (value: T) => boolean): this; - - /** - * Adds a new transform that restores the previous stashed values - */ - unstash(name?: string): CoreStream; // ?? - - /** - * Flattens all the read array values - */ - flatten(): CoreStream; // ?? - - /** - * Merges the given stream into a core stream - */ - static merge(streams: Array | nodestd.stream.Transform | nodestd.stream.Readable | nodestd.stream.Duplex>, options?: { - /** - * Whether to end the stream when all the given streams end - */ - end?: boolean, - - /** - * Options for the initial core stream - */ - sourceOptions?: I.CoreStream.ConstructorOptions - }): CoreStream; - - /** - * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. - * - * This method resumes the stream. - */ - then(onResolve?: (value: T[]) => T1 | PromiseLike, onReject?: (reason: any) => T2 | PromiseLike): Promise; - - /** - * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. - * - * This method resumes the stream. - */ - catch(onReject?: (reason: any) => T1 | PromiseLike): Promise; - } - - /** - * Creates a CoreStream instance - */ - function core(source?: I.CoreStream.Source, options?: I.CoreStream.ConstructorOptions): CoreStream; } } diff --git a/types/adone/glosses/utils.d.ts b/types/adone/glosses/utils.d.ts index 6a05273ffd..480c2354ce 100644 --- a/types/adone/glosses/utils.d.ts +++ b/types/adone/glosses/utils.d.ts @@ -16,10 +16,6 @@ declare namespace adone { function functionName(fn: (...args: any[]) => any): string; - function mapArguments(argmap: (...args: any[]) => any): (...args: any[]) => any; - function mapArguments(argmap: number): (...args: T[]) => T[]; - function mapArguments(...args: any[]): (x: T) => T; - namespace I { interface ParseMsResult { days: number; @@ -33,8 +29,6 @@ declare namespace adone { function pluralizeWord(str: string, plural?: string, count?: number): string; - function functionParams(func: (...args: any[]) => any): string[]; - function randomChoice(arrayLike: ArrayLike, from?: number, to?: number): T; function shuffleArray(array: T[]): T[]; @@ -70,19 +64,8 @@ declare namespace adone { function globParent(str: string): string; - namespace I { - interface ByResult { - (a: S, b: S): R; - compare(a: T, b: T): R; - by(a: S): T; - } - } - function by(by: (a: S) => T, compare?: (a: T, b: T) => R): I.ByResult; - function toFastProperties(object: object): object; - function stripBom(x: string): string; - namespace I { interface SortKeysOptions { deep?: boolean; @@ -118,12 +101,42 @@ declare namespace adone { namespace I { interface CloneOptions { + /** + * Clone recursively + * + * `true` by default + */ deep?: boolean; + + /** + * Clone non-plain object, they will be plain objects + * + * `false` by default + */ + nonPlainObjects?: boolean; + + /** + * Clone only enumerable properties + * + * `true` by default + */ + onlyEnumerable?: boolean; } } - function clone(object: object, options?: I.CloneOptions): object; - function toUTF8Array(str: string): number[]; + class Cloner { + /** + * Clones the given object + */ + clone(obj: any, options?: I.CloneOptions): any; + + /** + * Returns a clone function that is binded to this cloner + */ + binding(): (obj: any, options?: I.CloneOptions) => any; + } + + function clone(object: any, options?: I.CloneOptions): any; function asyncIter(array: T[], iter: (elem: T, index: number, cb: () => void) => any, cb: () => void): void; @@ -150,20 +163,31 @@ declare namespace adone { function assignDeep(target: T, ...sources: object[]): T; namespace I { - interface MatchOptions { + interface MatchPathOptions { index?: boolean; start?: number; end?: number; dot?: boolean; } } - function match(criteria: any, options?: I.MatchOptions): (value: any, options?: I.MatchOptions) => number | boolean; - function match(criteria: any, value: any, options?: I.MatchOptions): number | boolean; + function matchPath(criteria: any, options?: I.MatchPathOptions): (value: any, options?: I.MatchPathOptions) => number | boolean; + function matchPath(criteria: any, value: any, options?: I.MatchPathOptions): number | boolean; namespace I { + class Sorter { + edges: string[]; + + add(item: string, deps: string | string[]): void; + + sort(): string[]; + + clear(): void; + } + interface ToposortFunction { - (edges: Array<[T, T]>): T[]; - array(nodes: T[], edges: Array<[T, T]>): T[]; + (edges: Array<[string, string]>): string[]; + array(nodes: string[], edges: Array<[string, string]>): string[]; + Sorter: typeof Sorter; } } const toposort: I.ToposortFunction; @@ -188,16 +212,6 @@ declare namespace adone { } function jsesc(argument: any, options?: I.JSEscOptions): string; - namespace I { - type PossibleTypes = "object" | "class" | "null" | "global" | "Array" | "RegExp" | "Date" - | "Promise" | "Set" | "Map" | "WeakSet" | "DataView" | "Map Iterator" | "Set Iterator" - | "Array Iterator" | "String Iterator" | "Object" | "function" | "boolean" | "number" - | "undefined" | "string" | "symbol"; - } - - function typeOf(obj: any): I.PossibleTypes; - function typeOf(obj: any): string; - namespace memcpy { function utou(target: Buffer, targetOffset: number, source: Buffer, sourceStart: number, sourceEnd: number): number; function atoa(target: ArrayBuffer, targetOffset: number, source: ArrayBuffer, sourceStart: number, sourceEnd: number): number; @@ -217,12 +231,12 @@ declare namespace adone { function v1(options?: I.V1Options): string; function v1(options: I.V1Options, buf: any[], offset?: number): number[]; - function v4(options?: any): string; - function v4(options: any, buf: any[], offset?: number): number[]; - function v3(name: string | number[], namespace: string | number[]): string; function v3(name: string | number[], namespace: string | number[], buf: any[], offset?: number): number[]; + function v4(options?: any): string; + function v4(options: any, buf: any[], offset?: number): number[]; + function v5(name: string | number[], namespace: string | number[]): string; function v5(name: string | number[], namespace: string | number[], buf: any[], offset?: number): number[]; } @@ -237,40 +251,6 @@ declare namespace adone { } function delegate(object: object, property: string): I.Delegator; - namespace I { - interface GlobExpOptions { - nocomment?: boolean; - nonegate?: boolean; - nobrace?: boolean; - noglobstar?: boolean; - nocase?: boolean; - dot?: boolean; - noext?: boolean; - matchBase?: boolean; - flipNegate?: boolean; - } - } - - class GlobExp { - constructor(pattern: string, options?: I.GlobExpOptions); - - hasMagic(): boolean; - - static hasMagic(pattern: string, options?: I.GlobExpOptions): boolean; - - expandBraces(): string[]; - - static expandBraces(pattern: string, options?: I.GlobExpOptions): string[]; - - makeRe(): RegExp; - - static makeRe(pattern: string, options?: I.GlobExpOptions): RegExp; - - static test(p: string, pattern: string, options?: I.GlobExpOptions): boolean; - - test(p: string): boolean; - } - namespace iconv { // TODO: need to normalize source code } @@ -278,9 +258,6 @@ declare namespace adone { namespace sqlstring { function escapeId(val: string | string[], forbidQualified?: boolean): string; function dateToString(date: any, timeZone?: string): string; - function arrayToList(array: any[]): string; - function bufferToString(buffer: Buffer): string; - function objectToValues(object: object, timeZone?: string): string; function escape(value: any, stringifyObjects?: boolean, timeZone?: string): string; function format(sql: string, values?: any, stringifyObjects?: boolean, timeZone?: string): string; } @@ -316,49 +293,71 @@ declare namespace adone { } const binarySearch: I.BinarySearchFunction; + /** + * buffer tools + */ namespace buffer { - function concat(list: Buffer[], totalLength: number): Buffer; - function mask(buffer: Buffer, mask: Buffer, output: Buffer, offset: number, length: number): void; - function unmask(buffer: Buffer, mask: Buffer): void; + /** + * Converts the given Buffer to ArrayBuffer + */ + function toArrayBuffer(buf: Buffer): ArrayBuffer; + + /** + * Returns a new buffer that represents a^b + * + * If the lengths are not equal, it assumes missing bytes as 0x00 + * + * @param length length of the result buffer. max(a.length, b.length) by default + */ + function xor(a: Buffer, b: Buffer, length?: number): Buffer; } function shebang(str: string): string | null; - class ReInterval { - constructor(callback: (...args: any[]) => void, interval: number, args?: any[]); - - reschedule(interval: number): void; - - clear(): void; - - destroy(): void; - } - - class RateLimiter { - constructor(tokensPerInterval?: number, interval?: number, fireImmediately?: boolean); - - removeTokens(count: number): Promise; - - tryRemoveTokens(count: number): boolean; - - getTokensRemaining(): number; - } - namespace I { - interface ThrottleOptions { - max?: number; - interval?: number; - ordered?: boolean; - waitForReturn?: boolean; + interface ReInterval { + reschedule(interval: number): void; + + clear(): void; + + destroy(): void; } } - function throttle(fn: () => R, options?: I.ThrottleOptions): () => Promise; - function throttle(fn: (a: T1) => R, options?: I.ThrottleOptions): (a: T1) => Promise; - function throttle(fn: (a: T1, b: T2) => R, options?: I.ThrottleOptions): (a: T1, b: T2) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3, d: T4) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3, d: T4) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3, d: T4, e: T5) => Promise; - function throttle(fn: (...args: any[]) => R, options?: I.ThrottleOptions): (...args: any[]) => Promise; + + function reinterval(callback: (...args: any[]) => void, interval: number, args?: any[]): I.ReInterval; + + namespace throttle { + namespace I { + interface Options { + max?: number; + interval?: number; + ordered?: boolean; + waitForReturn?: boolean; + onDone?: () => void; + drop?: boolean; + dropLast?: boolean; + } + } + function create(fn: () => R, options?: I.Options): () => Promise; + function create(fn: (a: T1) => R, options?: I.Options): (a: T1) => Promise; + function create(fn: (a: T1, b: T2) => R, options?: I.Options): (a: T1, b: T2) => Promise; + function create(fn: (a: T1, b: T2, c: T3) => R, options?: I.Options): (a: T1, b: T2, c: T3) => Promise; + function create(fn: (a: T1, b: T2, c: T3, d: T4) => R, options?: I.Options): (a: T1, b: T2, c: T3, d: T4) => Promise; + function create(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, options?: I.Options): (a: T1, b: T2, c: T3, d: T4, e: T5) => Promise; + function create(fn: (...args: any[]) => R, options?: I.Options): (...args: any[]) => Promise; + + class RateLimiter { + constructor(tokensPerInterval?: number, interval?: number, fireImmediately?: boolean); + + removeTokens(count: number): Promise; + + tryRemoveTokens(count: number): boolean; + + getTokensRemaining(): number; + } + + const DROPPED: symbol; + } namespace I.fakeClock { interface Timer { @@ -475,36 +474,6 @@ declare namespace adone { function lowerBoundKey(range: I.Range): T | undefined; } - /** - * Utils for uid/gid - */ - namespace userid { - /** - * Returns uid by the given username - */ - function uid(username: string): { uid: number, gid: number }; - - /** - * Returns gid by the given groupname - */ - function gid(groupname: string): number; - - /** - * Returns username by the given uid - */ - function username(uid: number): string; - - /** - * Returns groupname by the given gid - */ - function groupname(gid: number): string; - - /** - * Returns gids the given user belongs - */ - function gids(username: string): number[]; - } - /** * Represents a log file rotator */ @@ -572,5 +541,598 @@ declare namespace adone { function debounce(fn: (a: T1, b: T2, c: T3, d: T4) => R, timeout: number, options?: I.DebounceOptions): (a: T1, b: T2, c: T3, d: T4) => R; function debounce(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, timeout: number, options?: I.DebounceOptions): (a: T1, b: T2, c: T3, d: T4, e: T5) => R; function debounce(fn: (...args: any[]) => R, timeout: number, options?: I.DebounceOptions): (...args: any[]) => R; + + /** + * Finds difference between the given arrays + */ + function arrayDiff(...arrays: T[][]): T[]; + + namespace I { + type FillRangeTransform = () => void; + + interface FillRangeOptions { + /** + * The increment to use for the range. Can be used with letters or numbers + */ + step?: number; + + /** + * By default, null is returned when an invalid range is passed. + * Enable this option to throw a RangeError on invalid ranges + * + * false by default + */ + strictRanges?: boolean; + + /** + * Cast all returned values to strings. + * + * By default, integers are returned as numbers. + */ + stringify?: boolean; + + /** + * Create a regex-compatible source string, instead of expanding values to an array. + * + * false by default + */ + toRegex?: boolean; + + /** + * Customize each value in the returned array (or string) + */ + transform?: FillRangeTransform; + } + } + + /** + * Expands numbers and letters + */ + function fillRange(from: number, to: number, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: number, to: number, options: I.FillRangeOptions & { stringify: true }): string[]; + function fillRange(from: number, to: number, options?: I.FillRangeOptions): number[]; + + function fillRange(from: string, to: string, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: string, to: string, options?: I.FillRangeOptions): string[]; + + function fillRange(from: string | number, to: string | number, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: string | number, to: string | number, options?: I.FillRangeOptions): Array; + + namespace inflection { + function singularizeWord(str: string, singular?: string): string; + function pluralizeWord(str: string, plural?: string): string; + function underscore(str: string, allUpperCase?: boolean): string; + } + + function machineId(original?: boolean): Promise; + + namespace I { + interface MergeOptions { + plainObjects?: boolean; + allowPrototypes?: boolean; + } + } + + function merge(target: any, source: any, options?: I.MergeOptions): any; + + function omit(obj: any, props: ((v: string) => boolean) | string[] | string): object; + + function parseTime(val: number): number; + function parseTime(val: any): number | null; + + function pick(obj: any, props: Iterable): object; + + // pool: TODO + + namespace querystring { + function escape(str: string): string; + + const formats: { + RFC1738: "RFC1738" + RFC3986: "RFC3986", + default: string, + formatters: { + RFC1738(val: string): string, + RFC3986(val: string): string + } + }; + + namespace I { + interface ParseOptions { + ignoreQueryPrefix?: boolean; + delimiter?: string; + depth?: number; + arrayLimit?: number; + parseArrays?: boolean; + decoder?: (str: string, defaultDecoder: (str: string) => string) => string; + allowDots?: boolean; + plainObjects?: boolean; + allowPrototypes?: boolean; + parameterLimit?: number; + strictNullHandling?: boolean; + } + + interface StringifyOptions { + delimiter?: string; + strictNullHandling?: boolean; + skipNulls?: boolean; + encode?: boolean; + encoder?: (str: string) => any; + filter?: Array | ((prefix: string, value: any) => any); + arrayFormat?: "indices" | "brackets" | "repeat"; + indices?: boolean; + sort?: (a: any, b: any) => number; + serializeDate?: (d: Date) => string; + format?: "RFC1738" | "RFC3986"; + encodeValuesOnly?: boolean; + addQueryPrefix?: boolean; + allowDots?: boolean; + } + } + + function parse(str: string, options?: I.ParseOptions): any; + + function stringify(obj: any, options?: I.StringifyOptions): string; + + function unescape(str: string): string; + } + + namespace I { + interface RegexNotOptions { + contains?: boolean; + } + } + + function regexNot(pattern: string, options?: I.RegexNotOptions): RegExp; + + function repeat(item: T, n: number): T[]; + + // retry: TODO + + function signalNameToCode(signame: string): number; + + function splitBuffer(buf: string | Buffer, splitBuf: string | Buffer, includeDelim?: boolean): Buffer[]; + + namespace I { + type SplitStringSplitFunction = (token: { + val: string; + idx: number; + arr: string[]; + str: string; + }) => void; + + interface SplitStringOptions { + braces?: object | boolean; + keepEscaping?: boolean; + keepQuotes?: boolean; + keepDoubleQuotes?: boolean; + keepSingleQuotes?: boolean; + separator?: string; + split?: SplitStringSplitFunction; + } + } + + function splitString(str: string): string[]; + function splitString(str: string, options: I.SplitStringOptions): string[]; + function splitString(str: string, splitter: I.SplitStringSplitFunction): string[]; + function splitString(str: string, options: I.SplitStringOptions, splitter: I.SplitStringSplitFunction): string[]; + + // terraformer: TODO + + namespace I { + interface ToRegexOptions { + contains?: boolean; + negate?: boolean; + nocase?: boolean; + flags?: string; + cache?: boolean; + } + } + + function toRegex(patterns: string | string[], options?: I.ToRegexOptions): RegExp; + + namespace I { + interface ToRegexRangeOptions { + capture?: boolean; + shorthand?: boolean; + relaxZeros?: boolean; + } + } + + function toRegexRange(min: string | number, max: string | number, options?: I.ToRegexRangeOptions): RegExp; + + namespace xorDistance { + function compare(a: Buffer, b: Buffer): boolean; + + function create(a: Buffer, b: Buffer): Buffer; + + function gt(a: Buffer, b: Buffer): boolean; + + function lt(a: Buffer, b: Buffer): boolean; + + function eq(a: Buffer, b: Buffer): boolean; + } + + namespace I { + interface BracesOptions { + /** + * Generate an "expanded" brace pattern (this option is unncessary with the `.expand` method, which does the same thing). + * + * @default undefined + */ + expand?: boolean; + + /** + * Enabled by default. + * + * @default true + */ + optimize?: boolean; + + /** + * Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options + * + * @default true + */ + nodupes?: boolean; + + /** + * When `braces.expand()` is used, or `options.expand` is true, brace patterns will automatically be [optimized](#optionsoptimize) + * when the difference between the range minimum and range maximum exceeds the `rangeLimit`. + * This is to prevent huge ranges from freezing your application. + * + * You can set this to any number, or change `options.rangeLimit` to `Inifinity` to disable this altogether. + * + * @default 250 + */ + rangeLimit?: number; + + /** + * Customize range expansion. + * + * @default undefined + */ + transform?: (str: string) => string; + + /** + * In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + * + * Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + * + * The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) + * are defined in the given pattern, and not to try to expand them as lists. + * + * @default undefined + */ + quantifiers?: boolean; + + /** + * Strip backslashes that were used for escaping from the result. + * + * @default undefined + */ + unescape?: boolean; + } + interface BracesFunction { + (pattern: string, options?: BracesOptions): string[]; + expand(pattern: string, options?: BracesOptions): string[]; + MAX_LENGTH: number; + clearCache(): void; + resizeCache(newSize: number): void; + getCache(): object; // TODO + makeRe(pattern: string, options?: BracesOptions): RegExp; + } + } + + const braces: I.BracesFunction; + + namespace I { + interface MatchOptions { + /** + * Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. + * + * @default false + */ + basename?: boolean; + + /** + * Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. + * Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. + * Instead, the star is treated the same as an other star. + * + * @default true + */ + bash?: boolean; + + /** + * Disable regex and function memoization. + * + * @default undefined + */ + cache?: boolean; + + /** + * Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `dot`. + * + * @default false + */ + dot?: boolean; + + /** + * Similar to the `--failglob` behavior in Bash, throws an error when no matches are found. + * + * @default undefined + */ + failglob?: boolean; + + /** + * String or array of glob patterns to match files to ignore. + * + * @default undefined + */ + ignore?: string | string[]; + + /** + * Alias for [options.basename](#options-basename). + */ + matchBase?: boolean; + + /** + * Disable expansion of brace patterns. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nobrace`. + * + * @default undefined + */ + nobrace?: boolean; + + /** + * Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). + * + * @default undefined + */ + nocase?: boolean; + + /** + * Remove duplicate elements from the result array. + * + * @default undefined + */ + nodupes?: boolean; + + /** + * Disable extglob support, so that extglobs are regarded as literal characters. + * + * @default undefined + */ + noext?: boolean; + + /** + * Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. + * + * @default undefined + */ + nonegate?: boolean; + + /** + * Disable matching with globstars (`**`). + * + * @default undefined + */ + noglobstar?: boolean; + + /** + * Alias for [options.nullglob](#options-nullglob). + */ + nonull?: boolean; + + /** + * If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. + * Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. + * + * @default undefined + */ + nullglob?: boolean; + + /** + * Pass your own instance of [snapdragon](https://github.com/jonschlinkert/snapdragon), to customize parsers or compilers. + * + * @default undefined + */ + snapdragon?: object; + + /** + * Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods. + * + * _(Note that sourcemaps are currently not enabled for brace patterns)_ + */ + sourcemap?: boolean; + + /** + * Remove backslashes from returned matches. + * + * @default undefined + */ + unescape?: boolean; + + /** + * Convert path separators on returned files to posix/unix-style forward slashes. + * + * @default true + */ + unixify?: boolean; + } + + interface MatchFunction { + /** + * The main function takes a list of strings and one or more glob patterns to use for matching. + * + * @param list A list of strings to match + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of matches + */ + (list: string[], patterns: string | string[], options?: MatchOptions): string[]; + + /** + * Similar to the main function, but `pattern` must be a string. + * + * @param list Array of strings to match + * @param pattern Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of matches + */ + match(list: string[], pattern: string, options?: MatchOptions): string[]; + + /** + * Returns true if the specified `string` matches the given glob `pattern`. + * + * @param string String to match + * @param pattern Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if the string matches the glob pattern. + */ + isMatch(string: string, pattern: string, options?: MatchOptions): boolean; + + /** + * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + * + * @param list The string or array of strings to test. Returns as soon as the first match is found. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + some(list: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if every string in the given `list` matches any of the given glob `patterns`. + * + * @param list The string or array of strings to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + every(list: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * @param str The string to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + any(str: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if **all** of the given `patterns` match the specified string. + * + * @param str The string to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + all(str: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * @param list Array of strings to match. + * @param patterns One or more glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of strings that **do not match** the given patterns. + */ + not(list: string[], patterns: string | string[], options?: MatchOptions): string[]; + + /** + * Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * @param str The string to match. + * @param patterns Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if the patter matches any part of `str`. + */ + contains(str: string, patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. + * If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. + * + * @param object The object with keys to filter. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an object with only keys that match the given patterns. + */ + matchKeys(object: T, patterns: string | string[], options?: MatchOptions): Partial; + + /** + * Returns a memoized matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns true if the string is a match. + * + * @param pattern Glob pattern + * @param options See available options for changing how matches are performed. + * @returns Returns a matcher function. + */ + matcher(pattern: string | string[], options?: MatchOptions): (str: string) => boolean; + + /** + * Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. + * + * @param pattern Glob pattern to use for matching. + * @param string String to match + * @param options See available options for changing how matches are performed + * @returns Returns an array of captures if the string matches the glob pattern, otherwise `null`. + */ + capture(pattern: string, string: string, options?: MatchOptions): string[] | null; + + /** + * Create a regular expression from the given glob `pattern`. + * + * @param pattern A glob pattern to convert to regex. + * @param options See available options for changing how matches are performed. + * @returns Returns a regex created from the given pattern. + */ + makeRe(pattern: string, options?: MatchOptions): RegExp; + + /** + * Expand the given brace `pattern`. + * + * @param pattern String with brace pattern to expand. + * @param options Any options to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options. + */ + braces(pattern: string, options?: MatchOptions): string[]; + + /** + * Parses the given glob `pattern` and returns an array of abstract syntax trees (ASTs), with the compiled `output` and optional source `map` on each AST. + * + * @param pattern Glob pattern to parse and compile. + * @param options Any options to change how parsing and compiling is performed. + * @returns Returns an object with the parsed AST, compiled string and optional source map. + */ + create(pattern: string, options?: MatchOptions): object; + + /** + * Parse the given `str` with the given `options`. + * + * @returns Returns an AST + */ + parse(str: string, options?: MatchOptions): object; + + /** + * Compile the given `ast` or string with the given `options`. + * + * @returns Returns an object that has an `output` property with the compiled string. + */ + compile(ast: object | string, options?: MatchOptions): object; + + MAX_LENGTH: number; + + clearCache(): void; + + resizeCache(newSize: number): void; + + getCache(): object; // TODO + } + } + + const match: I.MatchFunction; } } diff --git a/types/adone/index.d.ts b/types/adone/index.d.ts index 74883c2185..ad0645f04d 100644 --- a/types/adone/index.d.ts +++ b/types/adone/index.d.ts @@ -18,6 +18,7 @@ /// /// /// +/// /// /// /// diff --git a/types/adone/test/glosses/application.ts b/types/adone/test/glosses/application.ts new file mode 100644 index 0000000000..38c5b0c8ff --- /dev/null +++ b/types/adone/test/glosses/application.ts @@ -0,0 +1,1663 @@ +namespace applicationTests { + const { + CliApplication, + DApplication, + DSubsystem, + DCliCommand, + DMainCliCommand, + Subsystem, + runCli, + Application + } = adone.application; + + namespace DApplicationTests { + { + @DApplication() + class App extends CliApplication {} + } + { + @DApplication({}) + class App extends CliApplication {} + } + { + @DApplication({ + name: "hello" + }) + class App extends CliApplication {} + } + { + @DApplication({ + description: "hello" + }) + class App extends CliApplication {} + } + { + @DApplication({ + subsystems: [ + { + name: "hello", + subsystem: "a.js" + } + ] + }) + class App extends CliApplication {} + } + { + @DApplication({ + subsystems: [ + { + name: "hello", + subsystem: "a.js", + transpile: true + } + ] + }) + class App extends CliApplication {} + } + { + @DApplication({ + commandsGroups: [{ + name: "a", + description: "b" + }] + }) + class App extends CliApplication {} + } + } + + namespace DSubsystemTests { + { + @DSubsystem() + class App extends Subsystem {} + } + { + @DSubsystem({}) + class App extends Subsystem {} + } + { + @DSubsystem({ + name: "hello" + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + description: "hello" + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + subsystems: [ + { + name: "hello", + subsystem: "a.js" + } + ] + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + subsystems: [ + { + name: "hello", + subsystem: "a.js", + transpile: true + } + ] + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + commandsGroups: [{ + name: "a", + description: "b" + }] + }) + class App extends Subsystem {} + } + } + + namespace DMainCliCommandTests { + { + class App extends CliApplication { + @DMainCliCommand() + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({}) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({}) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + blindMode: true + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + description: "a" + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + match: (arg) => arg.startsWith("hello") + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + optionsGroups: [{ + description: "a", + name: "a" + }] + }) + main() {} + } + } + + namespace argumentsTests { + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: ["hello"] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: ["hello"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "append" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "count" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "set" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_const" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_false" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_true" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + appendChoicesHelpMessage: true + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + appendDefaultMessage: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + default: null + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + description: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + enabled: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + help: "asd" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + holder: "a" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + holder: ["a"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: 1 + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "*" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "+" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "?" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + required: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: String + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: [/^abc$/] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + verify: (args, opts) => { + return true; + } + }] + }) + main() {} + } + } + } + + namespace optionsTests { + { + class App extends CliApplication { + @DMainCliCommand({ + options: ["--hello"] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: ["hello"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "append" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "count" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "set" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_const" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_false" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_true" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + appendChoicesHelpMessage: true + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + appendDefaultMessage: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + default: null + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + description: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + enabled: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + help: "asd" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + holder: "a" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + holder: ["a"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: 1 + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "*" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "+" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "?" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + required: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: String + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: [/^abc$/] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + verify: (args, opts) => { + return true; + } + }] + }) + main() {} + } + } + } + } + + namespace DCliCommandTests { + { + class App extends CliApplication { + @DCliCommand() + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({}) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({}) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + blindMode: true + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + description: "a" + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + match: (arg) => arg.startsWith("hello") + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + optionsGroups: [{ + description: "a", + name: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + name: "cmdd" + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + group: "asdasd" + }) + cmd() {} + } + } + + namespace argumentsTests { + { + class App extends CliApplication { + @DCliCommand({ + arguments: ["hello"] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: ["hello"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "append" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "count" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "set" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_const" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_false" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_true" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + appendChoicesHelpMessage: true + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + appendDefaultMessage: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + default: null + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + description: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + enabled: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + help: "asd" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + holder: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + holder: ["a"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: 1 + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "*" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "+" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "?" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + required: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: String + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: [/^abc$/] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + verify: (args, opts) => { + return true; + } + }] + }) + cmd() {} + } + } + } + + namespace optionsTests { + { + class App extends CliApplication { + @DCliCommand({ + options: ["--hello"] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: ["hello"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "append" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "count" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "set" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_const" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_false" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_true" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + appendChoicesHelpMessage: true + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + appendDefaultMessage: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + default: null + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + description: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + enabled: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + help: "asd" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + holder: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + holder: ["a"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: 1 + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "*" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "+" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "?" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + required: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: String + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: [/^abc$/] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + verify: (args, opts) => { + return true; + } + }] + }) + cmd() {} + } + } + } + } + + namespace subsystemTests { + new Subsystem().name; + new Subsystem().root; + new Subsystem().setRoot(new Subsystem()); + new Subsystem().parent; + new Subsystem().state + 2; + new Subsystem().isOwned === true; + new Subsystem().setState(1); + new Subsystem().waitForState(2).then(() => {}); + new Subsystem().waitForState(2, 100).then(() => {}); + new Subsystem().configure(); + new Subsystem().initialize(); + new Subsystem().uninitialize(); + new Subsystem().configureSubsystems().then(() => {}); + new Subsystem().uninitializeSubsystems().then(() => {}); + new Subsystem().reinitializeSubsystems().then(() => {}); + new Subsystem().configureSubsystem("a").then(() => {}); + new Subsystem().loadSubsystem("a").then(() => {}); + new Subsystem().loadSubsystem(new Subsystem()).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), {}).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { description: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { group: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { name: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { transpile: false }).then(() => {}); + new Subsystem().unloadSubsystem("a").then(() => {}); + new Subsystem().initializeSubsystem("a").then(() => {}); + new Subsystem().uninitializeSubsystem("a").then(() => {}); + new Subsystem().getSubsystem("a").waitForState(2).then(() => {}); + new Subsystem().hasSubsystem("a") === true; + new Subsystem().hasSubsystem("a") === true; + new Subsystem().hasSubsystems() === true; + new Subsystem().addSubsystem({ subsystem: "ppp" }); + new Subsystem().addSubsystem({ subsystem: "ppp", bind: true }); + new Subsystem().addSubsystem({ subsystem: "ppp", bind: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", configureArgs: [1] }); + new Subsystem().addSubsystem({ subsystem: "ppp", description: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", group: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", name: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", transpile: false }); + new Subsystem().addSubsystem({ subsystem: "ppp", useFilename: true }); + { + const sysInfo = new Subsystem().addSubsystem({ subsystem: "ppp" }); + sysInfo.configureArgs[0]; + sysInfo.description.charCodeAt(10); + sysInfo.group.charCodeAt(10); + sysInfo.instance.waitForState(2, 30).then(() => {}); + sysInfo.name.charCodeAt(100); + sysInfo.path.charCodeAt(100); + } + { + const sysInfo = new Subsystem().addSubsystem({ subsystem: new Subsystem() }); + sysInfo.configureArgs[0]; + sysInfo.description.charCodeAt(10); + sysInfo.group.charCodeAt(10); + sysInfo.instance.waitForState(2, 30).then(() => {}); + sysInfo.name.charCodeAt(100); + sysInfo.path === null; + } + new Subsystem().addSubsystemsFrom("asd", {}); + new Subsystem().addSubsystemsFrom("asd", { filter: ["a"] }); + new Subsystem().addSubsystemsFrom("asd", { filter: (file) => file.charCodeAt(100) === 100 }); + new Subsystem().addSubsystemsFrom("asd", { filter: async (file) => file.charCodeAt(100) === 100 }); + new Subsystem().addSubsystemsFrom("asd", { bind: "a" }); + new Subsystem().addSubsystemsFrom("asd", { bind: true }); + new Subsystem().addSubsystemsFrom("asd", { configureArgs: [1] }); + new Subsystem().addSubsystemsFrom("asd", { description: "a" }); + new Subsystem().addSubsystemsFrom("asd", { group: "a" }); + new Subsystem().addSubsystemsFrom("asd", { name: "a" }); + new Subsystem().addSubsystemsFrom("asd", { transpile: true }); + new Subsystem().addSubsystemsFrom("asd", { useFilename: true }); + + new Subsystem().instantiateSubsystem("asd").waitForState(2, 200).then(() => {}); + new Subsystem().instantiateSubsystem(new Subsystem()).waitForState(2, 200).then(() => {}); + new Subsystem().instantiateSubsystem(new Subsystem(), { transpile: false }).waitForState(2, 200).then(() => {}); + new Subsystem().deleteSubsystem("name"); + new Subsystem().deleteSubsystem("name", true); + new Subsystem().getSubsystemInfo("name").configureArgs[0]; + new Subsystem().getSubsystems()[0].configureArgs[0]; + } + + namespace applicationTests { + new Application().isMain === true; + new Application().main(); + new Application().enableReport(); + new Application().enableReport({}); + new Application().enableReport({ directory: "a" }); + new Application().enableReport({ events: "a" }); + new Application().enableReport({ filename: "a" }); + new Application().enableReport({ signal: "a" }); + new Application().run().then(() => {}); + new Application().exit().then(() => {}); + new Application().exit(1).then(() => {}); + new Application().exitOnSignal("SIGINT", "SIGUSR1"); + new Application().removeProcesshandlers(); + new Application()._uncaughtException; + new Application()._unhandledRejection; + new Application()._rejectionHandled; + new Application()._signalExit("asd"); + } + + namespace cliApplicationTests { + new CliApplication().run({ ignoreArgs: true }).then(() => {}); + new CliApplication().getVersion().then(() => {}); + new CliApplication().exposeCliInterface(); + new CliApplication().mainCommand; + new CliApplication().defineMainCommand({ + arguments: [{ + name: "a", + default: 100500, + nargs: 100, + required: false + }], + options: [{ + name: "--a", + default: 1000, + nargs: 101231 + }], + optionsGroups: [{ + name: "a", + description: "a" + }] + }); + new CliApplication().defineCommand({ + name: "a", + arguments: [{ + name: "a", + default: 100500, + nargs: 100, + required: false + }], + options: [{ + name: "--a", + default: 1000, + nargs: 101231 + }], + optionsGroups: [{ + name: "a", + description: "a" + }] + }); + new CliApplication().defineCommandFromSubsystem({ + configureArgs: [1], + description: "a", + lazily: true, + subsystem: "a", + group: "a", + name: "a", + transpile: false + }); + new CliApplication().defineOption({ + name: "--a", + action: "store" + }); + new CliApplication().defineOptionsGroup({ + name: "a", + description: "b" + }); + new CliApplication().defineCommandsGroup({ + name: "a", + description: "b" + }); + new CliApplication().option("a"); + new CliApplication().option("a", { value: true }); + } +} diff --git a/types/adone/test/glosses/assertion.ts b/types/adone/test/glosses/assertion.ts index 4d07c78182..3e457dc876 100644 --- a/types/adone/test/glosses/assertion.ts +++ b/types/adone/test/glosses/assertion.ts @@ -3,9 +3,9 @@ namespace assertionTests { namespace assertionInterface { namespace exception { - const a: adone.x.Exception = new assertion.AssertionError(); - const b: adone.x.Exception = new assertion.AssertionError("hello"); - const c: adone.x.Exception = new assertion.AssertionError("hello", { actual: 2, expected: 3 }, () => {}); + const a: adone.exception.Exception = new assertion.AssertionError(); + const b: adone.exception.Exception = new assertion.AssertionError("hello"); + const c: adone.exception.Exception = new assertion.AssertionError("hello", { actual: 2, expected: 3 }, () => {}); } namespace config { @@ -38,11 +38,11 @@ namespace assertionTests { assert.fail(1, 2, "hello"); assert.fail(1, 2, "hello", "<"); - assert.isOk(1); - assert.isOk(1, "hello"); + assert.ok(1); + assert.ok(1, "hello"); - assert.isNotOk(1); - assert.isNotOk(1, "hello"); + assert.notOk(1); + assert.notOk(1, "hello"); assert.equal(1, 2); assert.equal(1, 2, "hello"); @@ -68,38 +68,38 @@ namespace assertionTests { assert.notDeepEqual(1, 2); assert.notDeepEqual(1, 2, "hello"); - assert.isAbove(1, 2); - assert.isAbove(1, 2, "hello"); + assert.above(1, 2); + assert.above(1, 2, "hello"); - assert.isAtLeast(1, 2); - assert.isAtLeast(1, 2, "hello"); + assert.atLeast(1, 2); + assert.atLeast(1, 2, "hello"); - assert.isBelow(1, 2); - assert.isBelow(1, 2, "hello"); + assert.below(1, 2); + assert.below(1, 2, "hello"); - assert.isAtMost(1, 2); - assert.isAtMost(1, 2, "hello"); + assert.atMost(1, 2); + assert.atMost(1, 2, "hello"); - assert.isTrue(1); - assert.isTrue(1, "hello"); + assert.true(1); + assert.true(1, "hello"); - assert.isNotTrue(1); - assert.isNotTrue(1, "hello"); + assert.notTrue(1); + assert.notTrue(1, "hello"); - assert.isFalse(1); - assert.isFalse(1, "hello"); + assert.false(1); + assert.false(1, "hello"); - assert.isNotFalse(1); - assert.isNotFalse(1, "hello"); + assert.notFalse(1); + assert.notFalse(1, "hello"); - assert.isNull(1); - assert.isNull(1, "hello"); + assert.null(1); + assert.null(1, "hello"); - assert.isNaN(1); - assert.isNaN(1, "hello"); + assert.NaN(1); + assert.NaN(1, "hello"); - assert.isNotNaN(1); - assert.isNotNaN(1, "hello"); + assert.NotNaN(1); + assert.NotNaN(1, "hello"); assert.exists(1); assert.exists(1, "hello"); @@ -107,49 +107,49 @@ namespace assertionTests { assert.notExists(1); assert.notExists(1, "hello"); - assert.isUndefined(1); - assert.isUndefined(1, "hello"); + assert.undefined(1); + assert.undefined(1, "hello"); - assert.isDefined(1); - assert.isDefined(1, "hello"); + assert.defined(1); + assert.defined(1, "hello"); - assert.isFunction(1); - assert.isFunction(1, "hello"); + assert.function(1); + assert.function(1, "hello"); - assert.isNotFunction(1); - assert.isNotFunction(1, "hello"); + assert.notFunction(1); + assert.notFunction(1, "hello"); - assert.isObject(1); - assert.isObject(1, "hello"); + assert.object(1); + assert.object(1, "hello"); - assert.isNotObject(1); - assert.isNotObject(1, "hello"); + assert.notObject(1); + assert.notObject(1, "hello"); - assert.isArray(1); - assert.isArray(1, "hello"); + assert.array(1); + assert.array(1, "hello"); - assert.isNotArray(1); - assert.isNotArray(1, "hello"); + assert.notArray(1); + assert.notArray(1, "hello"); - assert.isString(1, "hello"); + assert.string(1, "hello"); - assert.isNotString(1); - assert.isNotString(1, "hello"); + assert.notString(1); + assert.notString(1, "hello"); - assert.isNumber(1); - assert.isNumber(1, "hello"); + assert.number(1); + assert.number(1, "hello"); - assert.isNotNumber(1); - assert.isNotNumber(1, "hello"); + assert.notNumber(1); + assert.notNumber(1, "hello"); - assert.isFinite(1); - assert.isFinite(1, "hello"); + assert.finite(1); + assert.finite(1, "hello"); - assert.isBoolean(1); - assert.isBoolean(1, "hello"); + assert.boolean(1); + assert.boolean(1, "hello"); - assert.isNotBoolean(1); - assert.isNotBoolean(1, "hello"); + assert.notBoolean(1); + assert.notBoolean(1, "hello"); assert.typeOf(1, "string"); assert.typeOf(1, "number", "hello"); @@ -457,26 +457,26 @@ namespace assertionTests { assert.ifError(1); - assert.isExtensible({}); - assert.isExtensible({}, "hello"); + assert.extensible({}); + assert.extensible({}, "hello"); - assert.isNotExtensible({}); - assert.isNotExtensible({}, "hello"); + assert.notExtensible({}); + assert.notExtensible({}, "hello"); - assert.isSealed({}); - assert.isSealed({}, "hello"); + assert.sealed({}); + assert.sealed({}, "hello"); - assert.isNotSealed({}); - assert.isNotSealed({}, "hello"); + assert.notSealed({}); + assert.notSealed({}, "hello"); - assert.isFrozen({}); - assert.isFrozen({}, "hello"); + assert.frozen({}); + assert.frozen({}, "hello"); - assert.isNotFrozen({}); - assert.isNotFrozen({}, "hello"); + assert.notFrozen({}); + assert.notFrozen({}, "hello"); - assert.isEmpty({}); - assert.isEmpty({}, "hello"); + assert.empty({}); + assert.empty({}, "hello"); } const { expect } = assertion; @@ -499,16 +499,16 @@ namespace assertionTests { expect(1).to.contain(2, "hello").and; expect(1).but.contains(2).and; expect(1).but.contains(2, "hello").and; - expect(1).to.ok.not.ok; - expect(1).to.be.true.but.false; - expect(1).to.be.false.but.true; - expect(1).to.be.null.and.null; - expect(1).to.be.undefined.and.true; - expect(1).to.be.NaN.and.null; - expect(1).to.exist.and.be.null; - expect(1).to.be.empty.and.true; - expect(1).to.be.arguments.and.a("number"); - expect(1).to.be.Arguments.and.false; + expect(1).to.ok().and.a("string"); + expect(1).to.be.true().but.false(); + expect(1).to.be.false().but.true(); + expect(1).to.be.null().and.null(); + expect(1).to.be.undefined().and.true(); + expect(1).to.be.NaN().and.null(); + expect(1).to.exist().and.be.null(); + expect(1).to.be.empty().and.true(); + expect(1).to.be.arguments().and.a("number"); + expect(1).to.be.Arguments().and.false(); expect(1).to.be.equal(2).and; expect(1).to.be.equal(2, "hello").and; expect(1).but.equals(2).and; @@ -624,19 +624,19 @@ namespace assertionTests { expect(() => {}).but.decreases({}, "a", "hello").and; expect(() => {}).to.decreases({}).by(2).and; expect(() => {}).to.decreases({}).by(2, "hello").and; - expect({}).to.be.extensible.and; - expect({}).to.be.sealed.and; - expect({}).to.be.frozen.and; - expect({}).to.be.finite.and; + expect({}).to.be.extensible().and; + expect({}).to.be.sealed().and; + expect({}).to.be.frozen().and; + expect({}).to.be.finite().and; namespace mockTests { const s1 = adone.shani.util.spy(); const s2 = adone.shani.util.spy(); - expect(s1).to.have.been.called; - expect(s1).to.have.been.calledOnce; - expect(s1).to.have.been.calledTwice; - expect(s1).to.have.been.calledThrice; + expect(s1).to.have.been.called(); + expect(s1).to.have.been.calledOnce(); + expect(s1).to.have.been.calledTwice(); + expect(s1).to.have.been.calledThrice(); expect(s1).to.have.callCount(100); expect(s1).to.have.been.calledBefore(s2); expect(s1).to.have.been.calledAfter(s2); diff --git a/types/adone/test/glosses/data.ts b/types/adone/test/glosses/data.ts index e8ccedddcc..e9ef88d14b 100644 --- a/types/adone/test/glosses/data.ts +++ b/types/adone/test/glosses/data.ts @@ -11,6 +11,7 @@ namespace dataTests { { const a: Buffer = json.encode(1, { replacer: ["a", "b", "c"] }); } { const a: Buffer = json.encode(1, { replacer: (k: string, v: any) => null }); } { const a: Buffer = json.encode(1, { space: " " }); } + { const a: Buffer = json.encode(1, { newline: true }); } json.decode("123"); json.decode(Buffer.from("123")); @@ -52,6 +53,8 @@ namespace dataTests { mpak.decode(new Uint8Array(10)); mpak.decode(new ArrayBuffer(10)); + mpak.tryDecode(new adone.collection.ByteArray()); + new mpak.Encoder([]); new mpak.Encoder([{ type: 10, @@ -73,6 +76,9 @@ namespace dataTests { new mpak.Decoder([]).decode(new ArrayBuffer(10)); new mpak.Decoder([]).tryDecode(adone.collection.ByteArray.wrap("hello")); + new mpak.Serializer(); + new mpak.Serializer(100); + mpak.registerCommonTypesFor(new mpak.Serializer()); { const a: adone.data.mpak.Encoder = new mpak.Serializer().encoder; } { const a: adone.data.mpak.Decoder = new mpak.Serializer().decoder; } { const a: adone.data.mpak.Serializer = new mpak.Serializer().registerEncoder(10, (x) => true, (x) => new adone.collection.ByteArray(10)); } @@ -125,6 +131,7 @@ namespace dataTests { { const a: string = base64.decode("string", {}); } { const a: string = base64.decode("string", { buffer: false }); } { const a: Buffer = base64.decode("string", { buffer: true }); } + { const a: string = base64.decode("string", { encoding: "utf8" }); } { const a: string = base64.encodeVLQ(123); } { const a: number = base64.decodeVLQ("H"); } diff --git a/types/adone/test/glosses/events.ts b/types/adone/test/glosses/events.ts index 7f31089b52..448867951e 100644 --- a/types/adone/test/glosses/events.ts +++ b/types/adone/test/glosses/events.ts @@ -1,76 +1,86 @@ namespace eventsTests { namespace EventEmitter { namespace static { - const a: number = adone.event.EventEmitter.listenerCount(new adone.event.EventEmitter(), "event"); - const b: number = adone.event.EventEmitter.defaultMaxListeners; + const a: number = adone.event.Emitter.listenerCount(new adone.event.Emitter(), "event"); + const b: number = adone.event.Emitter.defaultMaxListeners; } namespace addListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().addListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().addListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().addListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().addListener(Symbol("event"), () => { }); } namespace on { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().on("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().on(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().on("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().on(Symbol("event"), () => { }); } namespace once { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().once("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().once(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().once("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().once(Symbol("event"), () => { }); } namespace prependListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().prependListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().prependListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().prependListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().prependListener(Symbol("event"), () => { }); } namespace prependOnceListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().prependOnceListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().prependOnceListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().prependOnceListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().prependOnceListener(Symbol("event"), () => { }); } namespace removeListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().removeListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().removeListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().removeListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().removeListener(Symbol("event"), () => { }); } namespace removeAllListeners { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().removeAllListeners("event"); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().removeAllListeners(Symbol("event")); + const a: adone.event.Emitter = new adone.event.Emitter().removeAllListeners("event"); + const b: adone.event.Emitter = new adone.event.Emitter().removeAllListeners(Symbol("event")); } namespace setMaxListeners { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().setMaxListeners(10); + const a: adone.event.Emitter = new adone.event.Emitter().setMaxListeners(10); } namespace getMaxListeners { - const a: number = new adone.event.EventEmitter().getMaxListeners(); + const a: number = new adone.event.Emitter().getMaxListeners(); } namespace listeners { - const a: Array<(...args: any[]) => any> = new adone.event.EventEmitter().listeners("event"); - const b: Array<(...args: any[]) => any> = new adone.event.EventEmitter().listeners(Symbol("event")); + const a: Array<(...args: any[]) => any> = new adone.event.Emitter().listeners("event"); + const b: Array<(...args: any[]) => any> = new adone.event.Emitter().listeners(Symbol("event")); } namespace emit { - const a: boolean = new adone.event.EventEmitter().emit("event", 1, 2, 3); - const b: boolean = new adone.event.EventEmitter().emit(Symbol("event"), 1, 2, 3); + const a: boolean = new adone.event.Emitter().emit("event", 1, 2, 3); + const b: boolean = new adone.event.Emitter().emit(Symbol("event"), 1, 2, 3); } namespace eventNames { - const a: Array = new adone.event.EventEmitter().eventNames(); - const b: Array = new adone.event.EventEmitter().eventNames(); + const a: Array = new adone.event.Emitter().eventNames(); + const b: Array = new adone.event.Emitter().eventNames(); } namespace listenerCount { - const a: number = new adone.event.EventEmitter().listenerCount("event"); - const b: number = new adone.event.EventEmitter().listenerCount(Symbol("event")); + const a: number = new adone.event.Emitter().listenerCount("event"); + const b: number = new adone.event.Emitter().listenerCount(Symbol("event")); + } + + namespace propagateEvents { + const e = new adone.event.Emitter().propagateEvents(new adone.event.Emitter(), ["a"]); + e.end(); + } + + namespace staticPropagateEvents { + const e = adone.event.Emitter.propagateEvents(new adone.event.Emitter(), new adone.event.Emitter(), ["a"]); + e.end(); } } namespace AsyncEmitter { - const a: adone.event.EventEmitter = new adone.event.AsyncEmitter(); + const a: adone.event.Emitter = new adone.event.AsyncEmitter(); new adone.event.AsyncEmitter(10); namespace setConcurrency { diff --git a/types/adone/test/glosses/exceptions.ts b/types/adone/test/glosses/exceptions.ts index e13dc3fff7..d9694990d0 100644 --- a/types/adone/test/glosses/exceptions.ts +++ b/types/adone/test/glosses/exceptions.ts @@ -1,36 +1,36 @@ namespace ExcetpionsTests { - { const a: Error = new adone.x.Exception(); } - { const a: Error = new adone.x.Exception("message"); } - { const a: Error = new adone.x.Exception(new Error()); } - { const a: Error = new adone.x.Exception(new Error(), true); } - { const a: adone.x.Exception = new adone.x.Runtime(); } - { const a: adone.x.Exception = new adone.x.IncompleteBufferError(); } - { const a: adone.x.Exception = new adone.x.NotImplemented(); } - { const a: adone.x.Exception = new adone.x.IllegalState(); } - { const a: adone.x.Exception = new adone.x.NotValid(); } - { const a: adone.x.Exception = new adone.x.Unknown(); } - { const a: adone.x.Exception = new adone.x.NotExists(); } - { const a: adone.x.Exception = new adone.x.Exists(); } - { const a: adone.x.Exception = new adone.x.Empty(); } - { const a: adone.x.Exception = new adone.x.InvalidAccess(); } - { const a: adone.x.Exception = new adone.x.NotSupported(); } - { const a: adone.x.Exception = new adone.x.InvalidArgument(); } - { const a: adone.x.Exception = new adone.x.InvalidNumberOfArguments(); } - { const a: adone.x.Exception = new adone.x.NotFound(); } - { const a: adone.x.Exception = new adone.x.Timeout(); } - { const a: adone.x.Exception = new adone.x.Incorrect(); } - { const a: adone.x.Exception = new adone.x.NotAllowed(); } - { const a: adone.x.Exception = new adone.x.LimitExceeded(); } - { const a: adone.x.Exception = new adone.x.Encoding(); } - { const a: adone.x.Exception = new adone.x.Network(); } - { const a: adone.x.Exception = new adone.x.Bind(); } - { const a: adone.x.Exception = new adone.x.Connect(); } - { const a: adone.x.Exception = new adone.x.Database(); } - { const a: adone.x.Exception = new adone.x.DatabaseInitialization(); } - { const a: adone.x.Exception = new adone.x.DatabaseOpen(); } - { const a: adone.x.Exception = new adone.x.DatabaseRead(); } - { const a: adone.x.Exception = new adone.x.DatabaseWrite(); } - { const a: adone.x.Exception = new adone.x.NetronIllegalState(); } - { const a: adone.x.Exception = new adone.x.NetronPeerDisconnected(); } - { const a: adone.x.Exception = new adone.x.NetronTimeout(); } + { const a: Error = new adone.exception.Exception(); } + { const a: Error = new adone.exception.Exception("message"); } + { const a: Error = new adone.exception.Exception(new Error()); } + { const a: Error = new adone.exception.Exception(new Error(), true); } + { const a: adone.exception.Exception = new adone.exception.Runtime(); } + { const a: adone.exception.Exception = new adone.exception.IncompleteBufferError(); } + { const a: adone.exception.Exception = new adone.exception.NotImplemented(); } + { const a: adone.exception.Exception = new adone.exception.IllegalState(); } + { const a: adone.exception.Exception = new adone.exception.NotValid(); } + { const a: adone.exception.Exception = new adone.exception.Unknown(); } + { const a: adone.exception.Exception = new adone.exception.NotExists(); } + { const a: adone.exception.Exception = new adone.exception.Exists(); } + { const a: adone.exception.Exception = new adone.exception.Empty(); } + { const a: adone.exception.Exception = new adone.exception.InvalidAccess(); } + { const a: adone.exception.Exception = new adone.exception.NotSupported(); } + { const a: adone.exception.Exception = new adone.exception.InvalidArgument(); } + { const a: adone.exception.Exception = new adone.exception.InvalidNumberOfArguments(); } + { const a: adone.exception.Exception = new adone.exception.NotFound(); } + { const a: adone.exception.Exception = new adone.exception.Timeout(); } + { const a: adone.exception.Exception = new adone.exception.Incorrect(); } + { const a: adone.exception.Exception = new adone.exception.NotAllowed(); } + { const a: adone.exception.Exception = new adone.exception.LimitExceeded(); } + { const a: adone.exception.Exception = new adone.exception.Encoding(); } + { const a: adone.exception.Exception = new adone.exception.Network(); } + { const a: adone.exception.Exception = new adone.exception.Bind(); } + { const a: adone.exception.Exception = new adone.exception.Connect(); } + { const a: adone.exception.Exception = new adone.exception.Database(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseInitialization(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseOpen(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseRead(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseWrite(); } + { const a: adone.exception.Exception = new adone.exception.NetronIllegalState(); } + { const a: adone.exception.Exception = new adone.exception.NetronPeerDisconnected(); } + { const a: adone.exception.Exception = new adone.exception.NetronTimeout(); } } diff --git a/types/adone/test/glosses/fs.ts b/types/adone/test/glosses/fs.ts index 8b7e765c9f..e7c5333624 100644 --- a/types/adone/test/glosses/fs.ts +++ b/types/adone/test/glosses/fs.ts @@ -11,6 +11,15 @@ namespace fsTests { fs.readlink("file", null).then((x: Buffer) => x); fs.readlink("file", "hex").then((x: string) => x); fs.readlink("file").then((x: string) => x); + fs.readlinkSync("file"); + fs.readlinkSync(Buffer.from("file")); + fs.readlinkSync(new URL("file://file")); + { const a: string = fs.readlinkSync("file", {}); } + { const a: string = fs.readlinkSync("file", { encoding: "utf8" }); } + { const a: Buffer = fs.readlinkSync("file", { encoding: null }); } + { const a: Buffer = fs.readlinkSync("file", null); } + { const a: string = fs.readlinkSync("file", "hex"); } + { const a: string = fs.readlinkSync("file"); } } namespace unlinkTests { @@ -22,6 +31,24 @@ namespace fsTests { fs.unlinkSync(new URL("file://file")); } + namespace utimesTests { + fs.utimes("hello", 100, 100).then(() => {}); + fs.utimes(Buffer.from("hello"), 100, 100).then(() => {}); + fs.utimes(new URL("hello"), 100, 100).then(() => {}); + fs.utimes("hello", "100", "100").then(() => {}); + fs.utimes("hello", new Date(100), new Date(100)).then(() => {}); + + fs.utimesSync("hello", 100, 100); + fs.utimesSync(Buffer.from("hello"), 100, 100); + fs.utimesSync(new URL("hello"), 100, 100); + fs.utimesSync("hello", "100", "100"); + fs.utimesSync("hello", new Date(100), new Date(100)); + + fs.utimesMillis("hello", 100, 100); + fs.utimesMillis(Buffer.from("hello"), 100, 100); + fs.utimesMillis(new URL("hello"), 100, 100); + } + namespace chmodTests { fs.chmod("file", 0o333).then(() => {}); fs.chmod(Buffer.from("file"), 0o333).then(() => {}); @@ -60,6 +87,87 @@ namespace fsTests { const e: Buffer[] = fs.readdirSync("file", { encoding: null }); } + namespace readdirpTests { + fs.readdirp("hello").forEach((entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + }); + + fs.readdirp(Buffer.from("hello")); + fs.readdirp(new URL("hello")); + fs.readdirp("hello", {}); + fs.readdirp("hello", { depth: 100 }); + fs.readdirp("hello", { directories: true }); + fs.readdirp("hello", { directoryFilter: () => true }); + fs.readdirp("hello", { + directoryFilter: (entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + } + }); + fs.readdirp("hello", { + directoryFilter: [(entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + }] + }); + fs.readdirp("hello", { + directoryFilter: ["*"] + }); + fs.readdirp("hello", { + directoryFilter: "*" + }); + fs.readdirp("hello", { fileFilter: () => true }); + fs.readdirp("hello", { + fileFilter: (entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + } + }); + fs.readdirp("hello", { + fileFilter: [(entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + }] + }); + fs.readdirp("hello", { + fileFilter: ["*"] + }); + fs.readdirp("hello", { + fileFilter: "*" + }); + fs.readdirp("hello", { + files: false + }); + fs.readdirp("hello", { + lstat: true + }); + } + namespace lstatTests { fs.lstat("file").then((x: nodestd.fs.Stats) => {}); fs.lstat(Buffer.from("file")).then((x: nodestd.fs.Stats) => {}); @@ -119,6 +227,15 @@ namespace fsTests { fs.appendFile("file", "hello", { encoding: "utf8" }).then(() => {}); fs.appendFile("file", "hello", { mode: 0o755 }).then(() => {}); fs.appendFile("file", "hello", { flag: "w" }).then(() => {}); + + fs.appendFileSync("file", "hello"); + fs.appendFileSync(Buffer.from("file"), "hello"); + fs.appendFileSync(10, "hello"); + fs.appendFileSync("file", Buffer.from("hello")); + fs.appendFileSync("file", "hello", {}); + fs.appendFileSync("file", "hello", { encoding: "utf8" }); + fs.appendFileSync("file", "hello", { mode: 0o755 }); + fs.appendFileSync("file", "hello", { flag: "w" }); } namespace accessTests { @@ -153,6 +270,12 @@ namespace fsTests { fs.rm("file", { cwd: __dirname }).then((x) => {}); } + namespace rmEmptyTests { + fs.rmEmpty("file").then(() => {}); + fs.rmEmpty("file", { cwd: "a" }).then(() => {}); + fs.rmEmpty("file", { filter: (filename) => filename.charCodeAt(0) === 100 }).then(() => {}); + } + namespace ModeTests { const stat = fs.statSync("file"); const mode = new fs.Mode(stat); @@ -513,37 +636,36 @@ namespace fsTests { } namespace fdTests { - const { fd } = fs; - fd.open("hello", "r+").then((x: number) => {}); - fd.open(Buffer.from("hello"), "r+").then((x: number) => {}); - fd.open(new URL("file://hello"), "r+").then((x: number) => {}); - { const a: number = fd.openSync("hello", "r+"); } - { const a: number = fd.openSync(Buffer.from("hello"), "r+"); } - { const a: number = fd.openSync(new URL("file://hello"), "r+"); } - fd.close(10).then(() => {}); - fd.closeSync(10); - fd.utimes(10, 100500, 100500).then(() => {}); - fd.utimesSync(10, 100500, 100500); - fd.stat(10).then((x: adone.fs.I.Stats) => {}); - { const a: adone.fs.I.Stats = fd.statSync(10); } - fd.truncate(10).then(() => {}); - fd.truncate(10, 10).then(() => {}); - fd.truncateSync(10); - fd.truncateSync(10, 10); - fd.read(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); - { const a: number = fd.readSync(10, Buffer.alloc(10), 0, 10, 10); } - fd.write(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); - { const a: number = fd.writeSync(10, Buffer.alloc(10), 0, 10, 10); } - fd.write(10, "hello", 10, "utf8").then((x: number) => {}); - { const a: number = fd.writeSync(10, "hello", 10, "utf8"); } - fd.sync(10).then(() => {}); - fd.syncSync(10); - fd.chown(10, 0, 0).then(() => {}); - fd.chownSync(10, 0, 0); - fd.chmod(10, 0o755).then(() => {}); - fd.chmodSync(10, 0o755); - fd.seek(10, 100, 0).then((x: number) => {}); - fd.lock(10, "sh").then(() => {}); + fs.open("hello", "r+").then((x: number) => {}); + fs.open(Buffer.from("hello"), "r+").then((x: number) => {}); + fs.open(new URL("file://hello"), "r+").then((x: number) => {}); + { const a: number = fs.openSync("hello", "r+"); } + { const a: number = fs.openSync(Buffer.from("hello"), "r+"); } + { const a: number = fs.openSync(new URL("file://hello"), "r+"); } + fs.close(10).then(() => {}); + fs.closeSync(10); + fs.futimes(10, 100500, 100500).then(() => {}); + fs.futimesSync(10, 100500, 100500); + fs.fstat(10).then((x: adone.fs.I.Stats) => {}); + { const a: adone.fs.I.Stats = fs.fstatSync(10); } + fs.ftruncate(10).then(() => {}); + fs.ftruncate(10, 10).then(() => {}); + fs.ftruncateSync(10); + fs.ftruncateSync(10, 10); + fs.read(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); + { const a: number = fs.readSync(10, Buffer.alloc(10), 0, 10, 10); } + fs.write(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); + { const a: number = fs.writeSync(10, Buffer.alloc(10), 0, 10, 10); } + fs.write(10, "hello", 10, "utf8").then((x: number) => {}); + { const a: number = fs.writeSync(10, "hello", 10, "utf8"); } + fs.fsync(10).then(() => {}); + fs.fsyncSync(10); + fs.fchown(10, 0, 0).then(() => {}); + fs.fchownSync(10, 0, 0); + fs.fchmod(10, 0o755).then(() => {}); + fs.fchmodSync(10, 0o755); + fs.seek(10, 100, 0).then((x: number) => {}); + fs.flock(10, "sh").then(() => {}); } namespace constantsTests { @@ -668,13 +790,44 @@ namespace fsTests { namespace mkdirTests { fs.mkdir("/path/to/some/dir").then(() => {}); fs.mkdir("/path/to/some/dir", 0o755).then(() => {}); + + fs.mkdirSync("/path/to/some/dir").then(() => {}); + fs.mkdirSync("/path/to/some/dir", 0o755).then(() => {}); + } + + namespace mkdirTests { + fs.mkdirp("/path/to/some/dir").then(() => {}); + fs.mkdirp("/path/to/some/dir", 0o755).then(() => {}); + + fs.mkdirpSync("/path/to/some/dir").then(() => {}); + fs.mkdirpSync("/path/to/some/dir", 0o755).then(() => {}); } namespace copyTests { fs.copy("a", "b").then(() => {}); - fs.copy("a", "b", {}).then(() => {}); - fs.copy("a", "b", { cwd: "/tmp" }).then(() => {}); - fs.copy("a", "b", { ignoreExisting: true }).then(() => {}); + fs.copy("a", "b", {}); + fs.copy("a", "b", { clobber: true }).then(() => {}); + fs.copy("a", "b", { overwrite: true }).then(() => {}); + fs.copy("a", "b", { filter: /asd/ }).then(() => {}); + fs.copy("a", "b", { filter: () => true }).then(() => {}); + fs.copy("a", "b", { filter: (a) => a.charCodeAt(0) === 100 }).then(() => {}); + fs.copy("a", "b", { + transform(r, w, file) { + file.atime.getDay(); + file.mtime.getDay(); + file.mode.toExponential(); + file.name.charCodeAt(0); + file.stats.atimeMs.toExponential(); + r.pipe(w); + } + }).then(() => {}); + } + + namespace copyTests { + fs.copyTo("a", "b").then(() => {}); + fs.copyTo("a", "b", {}); + fs.copyTo("a", "b", { cwd: "/tmp" }).then(() => {}); + fs.copyTo("a", "b", { ignoreExisting: true }).then(() => {}); } namespace renameTests { @@ -689,6 +842,7 @@ namespace fsTests { fs.tail("file", 10, {}).then((x: Buffer[]) => {}); fs.tail("file", 10, { separator: "\n" }).then((x: Buffer[]) => {}); fs.tail("file", 10, { chunkLength: 4096 }).then((x: Buffer[]) => {}); + fs.tail("file", 10, { pos: 10 }).then((x: Buffer[]) => {}); } namespace statVFSTests { diff --git a/types/adone/test/glosses/is.ts b/types/adone/test/glosses/is.ts index 2734824822..13b00530d7 100644 --- a/types/adone/test/glosses/is.ts +++ b/types/adone/test/glosses/is.ts @@ -1,115 +1,411 @@ namespace isTests { - { const a: boolean = adone.is.null({}); } - { const a: boolean = adone.is.undefined({}); } - { const a: boolean = adone.is.exist({}); } - { const a: boolean = adone.is.nil({}); } - { const a: boolean = adone.is.number({}); } - { const a: boolean = adone.is.numeral({}); } - { const a: boolean = adone.is.infinite({}); } - { const a: boolean = adone.is.odd({}); } - { const a: boolean = adone.is.even({}); } - { const a: boolean = adone.is.float({}); } - { const a: boolean = adone.is.negativeZero({}); } - { const a: boolean = adone.is.string({}); } - { const a: boolean = adone.is.emptyString({}); } - { const a: boolean = adone.is.substring("abc", "abcdef"); } - { const a: boolean = adone.is.substring("abc", "abcdef", 0); } - { const a: boolean = adone.is.prefix("abc", "abcdef"); } - { const a: boolean = adone.is.suffix("def", "abbdef"); } - { const a: boolean = adone.is.boolean({}); } - { const a: boolean = adone.is.json({}); } - { const a: boolean = adone.is.object({}); } - { const a: boolean = adone.is.plainObject({}); } - { const a: boolean = adone.is.class({}); } - { const a: boolean = adone.is.emptyObject({}); } - { const a: boolean = adone.is.propertyOwned({}, "a"); } - { const a: boolean = adone.is.propertyDefined({}, "a"); } - { const a: boolean = adone.is.conforms({}, {}); } - { const a: boolean = adone.is.conforms({}, {}, true); } - { const a: boolean = adone.is.arrayLikeObject({}); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3]); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3], 0); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3], 0, (a, b) => a === b); } - { const a: boolean = adone.is.sameType({}, {}); } - { const a: boolean = adone.is.primitive({}); } - { const a: boolean = adone.is.equalArrays([], []); } - { const a: boolean = adone.is.deepEqual({}, {}); } - { const a: boolean = adone.is.shallowEqual({}, {}); } - { const a: boolean = adone.is.stream({}); } - { const a: boolean = adone.is.writableStream({}); } - { const a: boolean = adone.is.readableStream({}); } - { const a: boolean = adone.is.duplexStream({}); } - { const a: boolean = adone.is.transformStream({}); } - { const a: boolean = adone.is.utf8(Buffer.alloc(10)); } - { const a: boolean = adone.is.win32PathAbsolute("abc"); } - { const a: boolean = adone.is.posixPathAbsolute("abc"); } - { const a: boolean = adone.is.pathAbsolute("abc"); } - { const a: boolean = adone.is.glob("abc"); } - { const a: boolean = adone.is.dotfile("abc"); } - { const a: boolean = adone.is.function(() => { }); } - { const a: boolean = adone.is.asyncFunction(async () => { }); } - { const a: boolean = adone.is.promise({}); } - { const a: boolean = adone.is.validDate("07.08.2017"); } - { const a: boolean = adone.is.buffer({}); } - { const a: boolean = adone.is.callback({}); } - { const a: boolean = adone.is.generator({}); } - { const a: boolean = adone.is.nan({}); } - { const a: boolean = adone.is.finite({}); } - { const a: boolean = adone.is.integer({}); } - { const a: boolean = adone.is.safeInteger({}); } - { const a: boolean = adone.is.array({}); } - { const a: boolean = adone.is.uint8Array({}); } - { const a: boolean = adone.is.configuration({}); } - { const a: boolean = adone.is.long({}); } - { const a: boolean = adone.is.bigNumber({}); } - { const a: boolean = adone.is.byteArray({}); } - { const a: boolean = adone.is.datetime({}); } - { const a: boolean = adone.is.transform({}); } - { const a: boolean = adone.is.subsystem({}); } - { const a: boolean = adone.is.application({}); } - { const a: boolean = adone.is.logger({}); } - { const a: boolean = adone.is.coreStream({}); } - { const a: boolean = adone.is.fastStream({}); } - { const a: boolean = adone.is.fastLocalStream({}); } - { const a: boolean = adone.is.fastLocalMapStream({}); } - { const a: boolean = adone.is.genesisNetron({}); } - { const a: boolean = adone.is.genesisPeer({}); } - { const a: boolean = adone.is.netronAdapter({}); } - { const a: boolean = adone.is.netron({}); } - { const a: boolean = adone.is.netronPeer({}); } - { const a: boolean = adone.is.netronDefinition({}); } - { const a: boolean = adone.is.netronDefinitions({}); } - { const a: boolean = adone.is.netronReference({}); } - { const a: boolean = adone.is.netronInterface({}); } - { const a: boolean = adone.is.netronContext({}); } - { const a: boolean = adone.is.netronIMethod({}, "hello"); } - { const a: boolean = adone.is.netronIProperty({}, "hello"); } - { const a: boolean = adone.is.netronStub({}); } - { const a: boolean = adone.is.netronRemoteStub({}); } - { const a: boolean = adone.is.netronStream({}); } - { const a: boolean = adone.is.iterable({}); } - { const a: boolean = adone.is.windows; } - { const a: boolean = adone.is.linux; } - { const a: boolean = adone.is.freebsd; } - { const a: boolean = adone.is.darwin; } - { const a: boolean = adone.is.sunos; } - { const a: boolean = adone.is.uppercase("abc"); } - { const a: boolean = adone.is.lowercase("abc"); } - { const a: boolean = adone.is.digits("012"); } - { const a: boolean = adone.is.identifier("someMethod"); } - { const a: boolean = adone.is.binaryExtension("mp3"); } - { const a: boolean = adone.is.binaryPath("a.mp3"); } - { const a: boolean = adone.is.ip4("192.168.1.1"); } - { const a: boolean = adone.is.ip6("::192.168.1.1"); } - { const a: boolean = adone.is.arrayBuffer({}); } - { const a: boolean = adone.is.arrayBufferView({}); } - { const a: boolean = adone.is.date({}); } - { const a: boolean = adone.is.error({}); } - { const a: boolean = adone.is.map({}); } - { const a: boolean = adone.is.regexp({}); } - { const a: boolean = adone.is.set({}); } - { const a: boolean = adone.is.symbol({}); } - { const a: boolean = adone.is.validUTF8(Buffer.from("hello")); } - { const a: boolean = adone.is.vaultValuable({}); } - { const a: boolean = adone.is.task({}); } + const { + is + } = adone; + { + const a: boolean = is.null({}); + const b: any = 2; + if (is.null(b)) { + const c: null = b; + } + } + { + const a: boolean = is.undefined({}); + const b: any = 2; + if (is.undefined(b)) { + const c: undefined = b; + } + } + { const a: boolean = is.exist({}); } + { + const a: boolean = is.nil({}); + const b: any = 2; + if (is.nil(b)) { + const c: null | undefined = b; + } + } + { + const a: boolean = is.number({}); + const b: any = 2; + if (is.number(b)) { + b.toExponential(); + } + } + { + const a: boolean = is.numeral({}); + const b: any = 2; + if (is.numeral(b)) { + const c: string | number = b; + } + } + { + const a: boolean = is.infinite({}); + const b: any = 2; + if (is.infinite(b)) { + b.toPrecision(); + } + } + { + const a: boolean = is.odd({}); + const b: any = 2; + if (is.odd(b)) { + b.toFixed(2); + } + } + { + const a: boolean = is.even({}); + const b: any = 2; + if (is.even(b)) { + b.toFixed(2); + } + } + { + const a: boolean = is.float({}); + const b: any = 2; + if (is.float(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.negativeZero({}); + const b: any = 2; + if (is.negativeZero(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.string({}); + const b: any = 2; + if (is.string(b)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.emptyString({}); + const b: any = 2; + if (is.emptyString(b)) { + b.charCodeAt(0); + } + } + { const a: boolean = is.substring("abc", "abcdef"); } + { const a: boolean = is.substring("abc", "abcdef", 0); } + { const a: boolean = is.prefix("abc", "abcdef"); } + { const a: boolean = is.suffix("def", "abbdef"); } + { + const a: boolean = is.boolean({}); + const b: any = 2; + if (is.boolean(b)) { + b === true; + } + } + { const a: boolean = is.json({}); } + { const a: boolean = is.object({}); } + { const a: boolean = is.plainObject({}); } + { const a: boolean = is.class({}); } + { const a: boolean = is.emptyObject({}); } + { const a: boolean = is.propertyOwned({}, "a"); } + { const a: boolean = is.propertyDefined({}, "a"); } + { const a: boolean = is.conforms({}, {}); } + { const a: boolean = is.conforms({}, {}, true); } + { const a: boolean = is.arrayLikeObject({}); } + { const a: boolean = is.inArray(1, [1, 2, 3]); } + { const a: boolean = is.inArray(1, [1, 2, 3], 0); } + { const a: boolean = is.inArray(1, [1, 2, 3], 0, (a, b) => a === b); } + { const a: boolean = is.sameType({}, {}); } + { const a: boolean = is.primitive({}); } + { const a: boolean = is.equalArrays([], []); } + { const a: boolean = is.deepEqual({}, {}); } + { const a: boolean = is.shallowEqual({}, {}); } + { const a: boolean = is.stream({}); } + { const a: boolean = is.writableStream({}); } + { const a: boolean = is.readableStream({}); } + { const a: boolean = is.duplexStream({}); } + { const a: boolean = is.transformStream({}); } + { const a: boolean = is.utf8(Buffer.alloc(10)); } + { const a: boolean = is.win32PathAbsolute("abc"); } + { const a: boolean = is.posixPathAbsolute("abc"); } + { const a: boolean = is.pathAbsolute("abc"); } + { + const a: boolean = is.glob("abc"); + const b: any = 2; + if (is.glob(b)) { + b.charCodeAt(0); + } + } + { const a: boolean = is.dotfile("abc"); } + { const a: boolean = is.function(() => { }); } + { const a: boolean = is.asyncFunction(async () => { }); } + { + const a: boolean = is.promise({}); + const b: any = 2; + if (is.promise(b)) { + b.then(() => {}); + } + const c = Promise.resolve(2); + if (is.promise(c)) { + c.then((x) => x.toFixed(2)); + } + } + { const a: boolean = is.validDate("07.08.2017"); } + { + const a: boolean = is.buffer({}); + const b: any = 2; + if (is.buffer(b)) { + b.writeDoubleBE(10, 10); + } + } + { const a: boolean = is.callback({}); } + { const a: boolean = is.generator({}); } + { const a: boolean = is.nan({}); } + { + const a: boolean = is.finite({}); + const b: any = 2; + if (is.finite(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.integer({}); + const b: any = 2; + if (is.integer(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.safeInteger({}); + const b: any = 2; + if (is.safeInteger(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.array({}); + const b: any = 2; + if (is.array(b)) { + b.length + b[0]; + } + const c = [1, 2, 3]; + if (is.array(c)) { + c[0].toFixed(0); + } + } + { + const a: boolean = is.uint8Array({}); + const b: any = 2; + if (is.uint8Array(b)) { + b.copyWithin(1, 2); + } + } + { const a: boolean = is.configuration({}); } + { + const a: boolean = is.long({}); + const b: any = 2; + if (is.long(b)) { + b.getHighBitsUnsigned(); + } + } + { + const a: boolean = is.bigNumber({}); + const b: any = 2; + if (is.bigNumber(b)) { + b.add(b).isBitSet(10); + } + } + { + const a: boolean = is.byteArray({}); + const b: any = 2; + if (is.byteArray(b)) { + b.toBuffer(); + } + } + { + const a: boolean = is.datetime({}); + const b: any = 2; + if (is.datetime(b)) { + b.add(2, "hours"); + } + } + { const a: boolean = is.transform({}); } + { const a: boolean = is.subsystem({}); } + { const a: boolean = is.application({}); } + { const a: boolean = is.logger({}); } + { const a: boolean = is.coreStream({}); } + { const a: boolean = is.fastStream({}); } + { const a: boolean = is.fastLocalStream({}); } + { const a: boolean = is.fastLocalMapStream({}); } + { const a: boolean = is.genesisNetron({}); } + { const a: boolean = is.genesisPeer({}); } + { const a: boolean = is.netronAdapter({}); } + { const a: boolean = is.netron({}); } + { const a: boolean = is.netronPeer({}); } + { const a: boolean = is.netronDefinition({}); } + { const a: boolean = is.netronDefinitions({}); } + { const a: boolean = is.netronReference({}); } + { const a: boolean = is.netronInterface({}); } + { const a: boolean = is.netronContext({}); } + { const a: boolean = is.netronIMethod({}, "hello"); } + { const a: boolean = is.netronIProperty({}, "hello"); } + { const a: boolean = is.netronStub({}); } + { const a: boolean = is.netronRemoteStub({}); } + { const a: boolean = is.netronStream({}); } + { const a: boolean = is.iterable({}); } + { const a: boolean = is.windows; } + { const a: boolean = is.linux; } + { const a: boolean = is.freebsd; } + { const a: boolean = is.darwin; } + { const a: boolean = is.sunos; } + { const a: boolean = is.uppercase("abc"); } + { const a: boolean = is.lowercase("abc"); } + { const a: boolean = is.digits("012"); } + { const a: boolean = is.identifier("someMethod"); } + { const a: boolean = is.binaryExtension("mp3"); } + { const a: boolean = is.binaryPath("a.mp3"); } + { const a: boolean = is.ip4("192.168.1.1"); } + { const a: boolean = is.ip6("::192.168.1.1"); } + { + const a: boolean = is.arrayBuffer({}); + const b: any = 2; + if (is.arrayBuffer(b)) { + b.slice(10); + } + } + { + const a: boolean = is.arrayBufferView({}); + const b: any = 2; + if (is.arrayBufferView(b)) { + b.byteLength + b.byteOffset; + } + } + { + const a: boolean = is.date({}); + const b: any = 2; + if (is.date(b)) { + b.getMonth() + b.getDate(); + } + } + { const a: boolean = is.error({}); } + { + const a: boolean = is.map({}); + const b: any = 2; + if (is.map(b)) { + b.has("asd"); + b.set(1, 2); + b.set("1", 2); + } + } + { + const a: boolean = is.regexp({}); + const b: any = 2; + if (is.regexp(b)) { + b.test("hello"); + } + } + { + const a: boolean = is.set({}); + const b: any = 2; + if (is.set(b)) { + b.add("h"); + b.has(1); + } + } + { const a: boolean = is.symbol({}); } + { const a: boolean = is.vaultValuable({}); } + { const a: boolean = is.task({}); } + { + const a: boolean = is.fqdn(1); + const b: any = 2; + if (is.fqdn(b)) { + b.charCodeAt(0); + } + if (is.fqdn(b, {})) { + b.charCodeAt(0); + } + is.fqdn(1, { + allowTrailingDot: false + }); + is.fqdn(1, { + allowUnderscores: false + }); + is.fqdn(1, { + requireTld: true + }); + } + { + const a: boolean = is.email(1); + const b: any = 2; + if (is.email(b)) { + b.charCodeAt(0); + } + if (is.email(b, {})) { + b.charCodeAt(0); + } + is.email(1, { + allowDisplayName: false + }); + is.email(1, { + allowUtf8LocalPart: false + }); + is.email(1, { + requireDisplayName: false + }); + is.email(1, { + requireTld: false + }); + } + { + const a: boolean = is.uuid(2); + const b: any = 2; + if (is.uuid(b)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, "all"); + const b: any = 2; + if (is.uuid(b, "all")) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, "all"); + const b: any = 2; + if (is.uuid(b, "all")) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 1); + const b: any = 2; + if (is.uuid(b, 1)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 2); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 3); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 4); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 5); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } } diff --git a/types/adone/test/glosses/meta.ts b/types/adone/test/glosses/meta.ts new file mode 100644 index 0000000000..fbcde09b1a --- /dev/null +++ b/types/adone/test/glosses/meta.ts @@ -0,0 +1,7 @@ +namespace metaTests { + const { meta } = adone; + + namespace typeOf { + const a: string = meta.typeOf(1); + } +} diff --git a/types/adone/test/glosses/promise.ts b/types/adone/test/glosses/promise.ts index a8866d95a1..9df672cae8 100644 --- a/types/adone/test/glosses/promise.ts +++ b/types/adone/test/glosses/promise.ts @@ -106,4 +106,34 @@ namespace promiseTests { namespace _finally { promise.finally(Promise.resolve(2), () => 2).then((x: number) => {}); } + + namespace props { + promise.props({ a: Promise.resolve(2) }).then((x) => x.a); + } + + namespace retry { + promise.retry((info) => { + { const a: number = info.current; } + }); + + promise.retry(() => {}, {}); + promise.retry(() => {}, { backOffBase: 1000 }); + promise.retry(() => {}, { backOffExponent: 2 }); + promise.retry(() => {}, { match: "a" }); + promise.retry(() => {}, { match: ["a"] }); + promise.retry(() => {}, { match: [/abc/] }); + promise.retry(() => {}, { match: /abc/ }); + promise.retry(() => {}, { match: [new Error()] }); + promise.retry(() => {}, { match: new Error() }); + promise.retry(() => {}, { max: 100 }); + promise.retry(() => {}, { name: "asd" }); + promise.retry(() => {}, { + report(msg: string, opts) { + opts.backOffBase < 100; + } + }); + promise.retry(() => {}, { + timeout: 100 + }); + } } diff --git a/types/adone/test/glosses/streams.ts b/types/adone/test/glosses/streams.ts index bd090dc467..caa278955a 100644 --- a/types/adone/test/glosses/streams.ts +++ b/types/adone/test/glosses/streams.ts @@ -2,82 +2,82 @@ namespace streamsTests { const { stream } = adone; namespace CoreStreamTests { - const { CoreStream } = stream; + const { core: { Stream } } = stream; - new CoreStream(); - new CoreStream(undefined); - new CoreStream(undefined, {}); - new CoreStream(undefined, { async: true }); - new CoreStream(undefined, { sync: true }); - new CoreStream(undefined, { + new Stream(); + new Stream(undefined); + new Stream(undefined, {}); + new Stream(undefined, { async: true }); + new Stream(undefined, { sync: true }); + new Stream(undefined, { transform(x) { this.push(x); } }); - new CoreStream(undefined, { + new Stream(undefined, { flush() { this.push(1); } }); - new CoreStream([]); - new CoreStream(new CoreStream([])); + new Stream([]); + new Stream(new Stream([])); - { const a: boolean = new CoreStream().write(1); } - { const a: boolean = new CoreStream().push(1); } - { const a: adone.stream.CoreStream = new CoreStream().end(); } - { const a: adone.stream.CoreStream = new CoreStream().destroy(); } - { const a: adone.stream.CoreStream = new CoreStream().pause(); } - { const a: adone.stream.CoreStream = new CoreStream().resume(); } - { const a: boolean = new CoreStream().isPaused(); } - { const a: boolean = new CoreStream().isEnded(); } - { const a: nodestd.stream.Transform = new CoreStream().pipe(new adone.std.stream.Transform()); } - { const a: adone.stream.CoreStream = new CoreStream().throughSync(function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughSync(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughAsync(function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughAsync(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().through(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream([1, 2, 3]).map((x) => `${x}`); } - { const a: adone.stream.CoreStream = new CoreStream().mapIf((x) => x === "1", () => 1); } - { const a: adone.stream.CoreStream = new CoreStream().mapIf(async (x) => x === "1", () => 1); } - { const a: adone.stream.CoreStream = new CoreStream().filter((x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().filter(async (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, {}); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, { wait: true }); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}, {}); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}, {}); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().unique(); } - { const a: adone.stream.CoreStream = new CoreStream().unique((x) => x + 1); } - { const a: adone.stream.CoreStream = new CoreStream().stash((x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().stash("hello", (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().unstash("hello"); } - { const a: adone.stream.CoreStream = new CoreStream().unstash(); } - { const a: adone.stream.CoreStream = new CoreStream().flatten(); } - { const a: Promise = new CoreStream().then(); } - { const a: Promise = new CoreStream().then(() => "1"); } - { const a: Promise = new CoreStream().then(() => 1, () => 2); } - { const a: Promise = new CoreStream().catch(); } - { const a: Promise = new CoreStream().catch(() => 1); } - { const a: adone.stream.CoreStream = CoreStream.merge([new CoreStream()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Readable()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Transform()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Transform()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Duplex()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([], {}); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { end: true }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: {} }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { async: true } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { sync: false } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { transform(x) { this.push(x); } } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { flush() { this.push(1); } } }); } + { const a: boolean = new Stream().write(1); } + { const a: boolean = new Stream().push(1); } + { const a: adone.stream.core.Stream = new Stream().end(); } + { const a: adone.stream.core.Stream = new Stream().destroy(); } + { const a: adone.stream.core.Stream = new Stream().pause(); } + { const a: adone.stream.core.Stream = new Stream().resume(); } + { const a: boolean = new Stream().isPaused(); } + { const a: boolean = new Stream().isEnded(); } + { const a: nodestd.stream.Transform = new Stream().pipe(new adone.std.stream.Transform()); } + { const a: adone.stream.core.Stream = new Stream().throughSync(function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughSync(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughAsync(function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughAsync(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().through(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream([1, 2, 3]).map((x) => `${x}`); } + { const a: adone.stream.core.Stream = new Stream().mapIf((x) => x === "1", () => 1); } + { const a: adone.stream.core.Stream = new Stream().mapIf(async (x) => x === "1", () => 1); } + { const a: adone.stream.core.Stream = new Stream().filter((x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().filter(async (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, {}); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, { wait: true }); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}, {}); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}, {}); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().unique(); } + { const a: adone.stream.core.Stream = new Stream().unique((x) => x + 1); } + { const a: adone.stream.core.Stream = new Stream().stash((x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().stash("hello", (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().unstash("hello"); } + { const a: adone.stream.core.Stream = new Stream().unstash(); } + { const a: adone.stream.core.Stream = new Stream().flatten(); } + { const a: Promise = new Stream().then(); } + { const a: Promise = new Stream().then(() => "1"); } + { const a: Promise = new Stream().then(() => 1, () => 2); } + { const a: Promise = new Stream().catch(); } + { const a: Promise = new Stream().catch(() => 1); } + { const a: adone.stream.core.Stream = Stream.merge([new Stream()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Readable()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Transform()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Transform()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Duplex()]); } + { const a: adone.stream.core.Stream = Stream.merge([], {}); } + { const a: adone.stream.core.Stream = Stream.merge([], { end: true }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: {} }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { async: true } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { sync: false } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { transform(x) { this.push(x); } } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { flush() { this.push(1); } } }); } (async () => { - const res = await new CoreStream([1, 2, 3, 4, 5]) + const res = await new Stream([1, 2, 3, 4, 5]) .map((x: number) => `${x}`) .mapIf((x: string) => x[0] === "1", (x) => x.slice(1)) .map((x) => [x, x, x]) @@ -91,13 +91,13 @@ namespace streamsTests { } namespace coreTests { - { const a: adone.stream.CoreStream = stream.core(); } - { const a: adone.stream.CoreStream = stream.core([1, 2, 3]); } - { const a: adone.stream.CoreStream = stream.core(stream.core([])); } - { const a: adone.stream.CoreStream = stream.core(undefined, {}); } - { const a: adone.stream.CoreStream = stream.core(undefined, { async: true }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { sync: false }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { transform(x) { this.push(Number(x)); } }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { flush() { this.push(1); } }); } + { const a: adone.stream.core.Stream = stream.core.create(); } + { const a: adone.stream.core.Stream = stream.core.create([1, 2, 3]); } + { const a: adone.stream.core.Stream = stream.core.create(stream.core.create([])); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, {}); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { async: true }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { sync: false }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { transform(x) { this.push(Number(x)); } }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { flush() { this.push(1); } }); } } } diff --git a/types/adone/test/glosses/utils.ts b/types/adone/test/glosses/utils.ts index 33698bfb29..1ffabbd59b 100644 --- a/types/adone/test/glosses/utils.ts +++ b/types/adone/test/glosses/utils.ts @@ -34,13 +34,6 @@ namespace utilTests { const b: string = util.functionName((a, b, c) => { }); } - namespace mapArguments { - const a: (...args: any[]) => any = util.mapArguments(() => { }); - const b: (...args: T[]) => T[] = util.mapArguments(1); - const c: (...args: any[]) => any = util.mapArguments([1]); - const d: (x: T) => T = util.mapArguments(); - } - namespace parseMs { const result: { days: number; @@ -56,10 +49,6 @@ namespace utilTests { const c: string = util.pluralizeWord("day", "days", 1); } - namespace functionParams { - const a: string[] = util.functionParams((a: any, b: any, c: any) => { }); - } - namespace randomChoice { const a: number = util.randomChoice([1, 2, 3]); const b: string = util.randomChoice(["1", "2", "3"]); @@ -174,19 +163,10 @@ namespace utilTests { const a: string = util.globParent("a/b/c/**"); } - namespace by { - const a: (a: number, b: number) => any = util.by((x: number): number => x); - const b: (a: number, b: number) => number = util.by((x: number): string => `${x}`, (a: string, b: string) => a.length - b.length); - } - namespace toFastProperties { const a: object = util.toFastProperties({}); } - namespace stripBom { - const a: string = util.stripBom("123"); - } - namespace sortKeys { const a: object = util.sortKeys({}); const b: object = util.sortKeys({}, {}); @@ -234,16 +214,27 @@ namespace utilTests { const b: number | null = util.parseSize("123Kb"); } + namespace Cloner { + const a = new util.Cloner(); + a.clone({}); + a.clone({}, {}); + a.clone({}, { deep: true }); + a.clone({}, { nonPlainObjects: false }); + a.clone({}, { onlyEnumerable: true }); + const c = a.binding(); + c({}); + c({}, {}); + c({}, { deep: true }); + c({}, { onlyEnumerable: false }); + c({}, { nonPlainObjects: true }); + } + namespace clone { const a: object = util.clone({}); const b: object = util.clone({}, {}); const c: object = util.clone({}, { deep: true }); } - namespace toUTF8Array { - const a: number[] = util.toUTF8Array("hello"); - } - namespace asyncIter { util.asyncIter([1, 2, 3], () => { }, () => { }); } @@ -298,28 +289,34 @@ namespace utilTests { const a: object = util.assignDeep({ a: 1 }, { a: 2 }); } - namespace match { - const a: number | boolean = util.match(["a", "b", "c"], "a"); - const b: (a: any, b: any) => number | boolean = util.match("a", { index: true }); - const c: number | boolean = util.match(["a", "b", "c"], "a", { dot: true }); - const d: (a: any, b: any) => number | boolean = util.match("a", { end: 2 }); - const e: (a: any, b: any) => number | boolean = util.match("a", { start: 2 }); - const f: (a: any, b: any) => number | boolean = util.match("a"); + namespace matchPath { + const a: number | boolean = util.matchPath(["a", "b", "c"], "a"); + const b: (a: any, b: any) => number | boolean = util.matchPath("a", { index: true }); + const c: number | boolean = util.matchPath(["a", "b", "c"], "a", { dot: true }); + const d: (a: any, b: any) => number | boolean = util.matchPath("a", { end: 2 }); + const e: (a: any, b: any) => number | boolean = util.matchPath("a", { start: 2 }); + const f: (a: any, b: any) => number | boolean = util.matchPath("a"); } namespace toposort { - const a: number[] = util.toposort([ - [0, 1], - [2, 3], - [4, 5], - [6, 7] + const a: string[] = util.toposort([ + ["0", "1"], + ["2", "3"], + ["4", "5"], + ["6", "7"] ]); - const b: number[] = util.toposort.array([0, 1, 2], [ - [0, 1], - [2, 3], - [4, 5], - [6, 7] + const b: string[] = util.toposort.array(["0", "1", "2"], [ + ["0", "1"], + ["2", "3"], + ["4", "5"], + ["6", "7"] ]); + const sorter = new util.toposort.Sorter(); + sorter.add("a", "b"); + sorter.add("a", ["c"]); + const c: string[] = sorter.sort(); + sorter.clear(); + sorter.edges[0][0].charCodeAt(100); } namespace jsesc { @@ -340,10 +337,6 @@ namespace utilTests { const o: string = util.jsesc({ a: 1 }, { __inline2__: true }); } - namespace typeOf { - const a: string = util.typeOf(1); - } - namespace memcpy { const a: number = util.memcpy.utou(Buffer.alloc(10), 0, Buffer.alloc(10), 0, 10); const b: number = util.memcpy.atoa(new ArrayBuffer(10), 0, new ArrayBuffer(10), 0, 10); @@ -394,73 +387,6 @@ namespace utilTests { a.getter("a").access("b").method("c").setter("d"); } - namespace GlobExp { - { - const glob = new util.GlobExp("*.js"); - const a: boolean = glob.hasMagic(); - const b: string[] = glob.expandBraces(); - const c: RegExp = glob.makeRe(); - const d: boolean = glob.test("a.js"); - } - { - const a: boolean = util.GlobExp.hasMagic("*.js"); - const b: string[] = util.GlobExp.expandBraces("*.js"); - const c: RegExp = util.GlobExp.makeRe("*.js"); - const d: boolean = util.GlobExp.test("*.js", "a.js"); - } - new util.GlobExp(""); - new util.GlobExp("", {}); - new util.GlobExp("", { dot: true }); - new util.GlobExp("", { flipNegate: true }); - new util.GlobExp("", { matchBase: true }); - new util.GlobExp("", { nobrace: true }); - new util.GlobExp("", { nocase: true }); - new util.GlobExp("", { nocomment: true }); - new util.GlobExp("", { noext: true }); - new util.GlobExp("", { noglobstar: true }); - new util.GlobExp("", { nonegate: true }); - util.GlobExp.hasMagic("", {}); - util.GlobExp.hasMagic("", { dot: true }); - util.GlobExp.hasMagic("", { flipNegate: true }); - util.GlobExp.hasMagic("", { matchBase: true }); - util.GlobExp.hasMagic("", { nobrace: true }); - util.GlobExp.hasMagic("", { nocase: true }); - util.GlobExp.hasMagic("", { nocomment: true }); - util.GlobExp.hasMagic("", { noext: true }); - util.GlobExp.hasMagic("", { noglobstar: true }); - util.GlobExp.hasMagic("", { nonegate: true }); - util.GlobExp.expandBraces("", {}); - util.GlobExp.expandBraces("", { dot: true }); - util.GlobExp.expandBraces("", { flipNegate: true }); - util.GlobExp.expandBraces("", { matchBase: true }); - util.GlobExp.expandBraces("", { nobrace: true }); - util.GlobExp.expandBraces("", { nocase: true }); - util.GlobExp.expandBraces("", { nocomment: true }); - util.GlobExp.expandBraces("", { noext: true }); - util.GlobExp.expandBraces("", { noglobstar: true }); - util.GlobExp.expandBraces("", { nonegate: true }); - util.GlobExp.makeRe("", {}); - util.GlobExp.makeRe("", { dot: true }); - util.GlobExp.makeRe("", { flipNegate: true }); - util.GlobExp.makeRe("", { matchBase: true }); - util.GlobExp.makeRe("", { nobrace: true }); - util.GlobExp.makeRe("", { nocase: true }); - util.GlobExp.makeRe("", { nocomment: true }); - util.GlobExp.makeRe("", { noext: true }); - util.GlobExp.makeRe("", { noglobstar: true }); - util.GlobExp.makeRe("", { nonegate: true }); - util.GlobExp.test("a", "b", {}); - util.GlobExp.test("a", "b", { dot: true }); - util.GlobExp.test("a", "b", { flipNegate: true }); - util.GlobExp.test("a", "b", { matchBase: true }); - util.GlobExp.test("a", "b", { nobrace: true }); - util.GlobExp.test("a", "b", { nocase: true }); - util.GlobExp.test("a", "b", { nocomment: true }); - util.GlobExp.test("a", "b", { noext: true }); - util.GlobExp.test("a", "b", { noglobstar: true }); - util.GlobExp.test("a", "b", { nonegate: true }); - } - namespace iconv { // TODO } @@ -477,19 +403,6 @@ namespace utilTests { const b: string = util.sqlstring.dateToString(123, "local"); } - namespace arrayToList { - const a: string = util.sqlstring.arrayToList(["1", "a"]); - } - - namespace bufferToString { - const a: string = util.sqlstring.bufferToString(Buffer.alloc(10)); - } - - namespace objectToValues { - const a: string = util.sqlstring.objectToValues({ a: 1 }); - const b: string = util.sqlstring.objectToValues({ a: 1 }, "local"); - } - namespace escape { const a: string = util.sqlstring.escape(1); const b: string = util.sqlstring.escape(1, true); @@ -532,44 +445,55 @@ namespace utilTests { } namespace buffer { - const a: Buffer = util.buffer.concat([Buffer.alloc(10), Buffer.alloc(20)], 30); - util.buffer.mask(Buffer.alloc(10), Buffer.alloc(10), Buffer.alloc(10), 0, 10); - util.buffer.unmask(Buffer.alloc(10), Buffer.alloc(10)); + namespace toArrayBuffer { + const a = util.buffer.toArrayBuffer(Buffer.from("hello")); + a.slice(10); + } + + namespace xor { + const a = util.buffer.xor(Buffer.from("hello"), Buffer.from("world")); + a.writeUInt32LE(20, 1); + } } namespace shebang { const a: string | null = util.shebang("#!/bin/sh"); } - namespace ReInterval { - new util.ReInterval(() => { }, 1000); - new util.ReInterval(() => { }, 1000, [1]); - const a = new util.ReInterval(() => { }, 1000); + namespace reinterval { + util.reinterval(() => { }, 1000); + util.reinterval(() => { }, 1000, [1]); + const a = util.reinterval(() => { }, 1000); a.reschedule(400); a.clear(); a.destroy(); } - namespace RateLimiter { - new util.RateLimiter(); - new util.RateLimiter(1); - new util.RateLimiter(1, 1000); - new util.RateLimiter(1, 1000, true); - const a = new util.RateLimiter(); - a.removeTokens(1).then((x: number) => { }); - const b: boolean = a.tryRemoveTokens(10); - const c: number = a.getTokensRemaining(); - } - namespace throttle { - const a: () => Promise = util.throttle(() => 42); - const b: (a: number) => Promise = util.throttle((a: number) => `${a}`); - const c: (a: number, b: string) => Promise = util.throttle((a: number, b: string) => String(a) + b); - const d = util.throttle(() => { }, {}); - const e = util.throttle(() => { }, { interval: 1000 }); - const f = util.throttle(() => { }, { max: 10 }); - const g = util.throttle(() => { }, { ordered: true }); - const h = util.throttle(() => { }, { waitForReturn: true }); + namespace RateLimiter { + new util.throttle.RateLimiter(); + new util.throttle.RateLimiter(1); + new util.throttle.RateLimiter(1, 1000); + new util.throttle.RateLimiter(1, 1000, true); + const a = new util.throttle.RateLimiter(); + a.removeTokens(1).then((x: number) => { }); + const b: boolean = a.tryRemoveTokens(10); + const c: number = a.getTokensRemaining(); + } + + const a: () => Promise = util.throttle.create(() => 42); + const b: (a: number) => Promise = util.throttle.create((a: number) => `${a}`); + const c: (a: number, b: string) => Promise = util.throttle.create((a: number, b: string) => String(a) + b); + const d = util.throttle.create(() => { }, {}); + const e = util.throttle.create(() => { }, { interval: 1000 }); + const f = util.throttle.create(() => { }, { max: 10 }); + const g = util.throttle.create(() => { }, { ordered: true }); + const h = util.throttle.create(() => { }, { waitForReturn: true }); + const i = util.throttle.create(() => { }, { onDone() {} }); + const j = util.throttle.create(() => { }, { drop: true }); + const k = util.throttle.create(() => { }, { dropLast: true }); + + const l: symbol = util.throttle.DROPPED; } namespace fakeClock { @@ -741,17 +665,6 @@ namespace utilTests { } } - namespace userid { - const { userid } = util; - - { const a: number = userid.uid("someone").gid; } - { const a: number = userid.uid("someone").uid; } - { const a: number = userid.gid("someone"); } - { const a: string = userid.username(1000); } - { const a: string = userid.groupname(1000); } - { const gids: number[] = userid.gids("someone"); } - } - namespace LogRotator { const { LogRotator } = util; new LogRotator("file.log"); @@ -766,4 +679,679 @@ namespace utilTests { new LogRotator("file.log").start(); new LogRotator("file.log").stop(); } + + namespace arrayDiff { + const { arrayDiff } = util; + + arrayDiff([1, 2, 3], [4, 5, 6])[0].toFixed(); + arrayDiff(["1"])[0].charCodeAt(100); + } + + namespace fillRange { + const { fillRange } = util; + + { const a: number[] = fillRange(1, 2); } + { const a: string[] = fillRange(1, 2, { stringify: true }); } + { const a: string = fillRange(1, 2, { toRegex: true }); } + { const a: string[] = fillRange("1", "2"); } + { const a: string = fillRange("1", "2", { toRegex: true }); } + } + + namespace inflection { + const { inflection } = util; + + { const a: string = inflection.singularizeWord("hello"); } + { const a: string = inflection.singularizeWord("hello", "aaaa"); } + { const a: string = inflection.pluralizeWord("hello"); } + { const a: string = inflection.pluralizeWord("hello", "aaaa"); } + { const a: string = inflection.underscore("hello"); } + } + + namespace machineId { + const { machineId } = util; + + (async () => { + const a: string = await machineId(); + }); + } + + namespace merge { + const { merge } = util; + + merge({}, {}); + merge({}, {}, { allowPrototypes: true }); + merge({}, {}, { plainObjects: false }); + } + + namespace omit { + const { omit } = util; + + omit({}, ["a"]); + omit({}, "a"); + omit({}, (x) => x === "a"); + } + + namespace parseTime { + const { parseTime } = util; + + { const a: number = parseTime(123); } + { const a: number | null = parseTime("12"); } + } + + namespace pick { + const { pick } = util; + + pick({}, ["a", "b", "c"]); + pick({}, new Set(["a", "b", "c"])); + } + + namespace querystring { + const { querystring: qs } = util; + + { const a: string = qs.escape("asd"); } + { const a: string = qs.formats.default; } + { const a: string = qs.formats.RFC1738; } + { const a: string = qs.formats.RFC3986; } + { const a: string = qs.formats.formatters.RFC1738("ha"); } + { const a: string = qs.formats.formatters.RFC3986("ha"); } + { const a: object = qs.parse("asdasd"); } + { const a: object = qs.parse("asdasd", {}); } + { const a: object = qs.parse("asdasd", { allowDots: false }); } + { const a: object = qs.parse("asdasd", { allowPrototypes: false }); } + { const a: object = qs.parse("asdasd", { arrayLimit: 100 }); } + { const a: object = qs.parse("asdasd", { decoder: (s) => s }); } + { const a: object = qs.parse("asdasd", { decoder: (s, d) => d(s) }); } + { const a: object = qs.parse("asdasd", { delimiter: "a" }); } + { const a: object = qs.parse("asdasd", { depth: 100 }); } + { const a: object = qs.parse("asdasd", { ignoreQueryPrefix: false }); } + { const a: object = qs.parse("asdasd", { parameterLimit: 100 }); } + { const a: object = qs.parse("asdasd", { parseArrays: false }); } + { const a: object = qs.parse("asdasd", { plainObjects: true }); } + { const a: object = qs.parse("asdasd", { strictNullHandling: false }); } + { const a: string = qs.stringify({}); } + { const a: string = qs.stringify({}, {}); } + { const a: string = qs.stringify({}, { addQueryPrefix: false }); } + { const a: string = qs.stringify({}, { allowDots: false }); } + { const a: string = qs.stringify({}, { arrayFormat: "indices" }); } + { const a: string = qs.stringify({}, { arrayFormat: "brackets" }); } + { const a: string = qs.stringify({}, { arrayFormat: "repeat" }); } + { const a: string = qs.stringify({}, { delimiter: "1" }); } + { const a: string = qs.stringify({}, { encode: true }); } + { const a: string = qs.stringify({}, { encoder: (s) => s }); } + { const a: string = qs.stringify({}, { encodeValuesOnly: false }); } + { const a: string = qs.stringify({}, { filter: [1, 2, 3] }); } + { const a: string = qs.stringify({}, { filter: ["1", "2", "3"] }); } + { const a: string = qs.stringify({}, { filter: (prefix: string, value: any) => value === 1 }); } + { const a: string = qs.stringify({}, { indices: false }); } + { const a: string = qs.stringify({}, { serializeDate(d) { return String(d.getTime()); } }); } + { const a: string = qs.stringify({}, { skipNulls: false }); } + { const a: string = qs.stringify({}, { sort(a, b) { return a - b; } }); } + { const a: string = qs.stringify({}, { strictNullHandling: false }); } + } + + namespace regexNot { + const { regexNot } = util; + + { const a: RegExp = regexNot("a"); } + { const a: RegExp = regexNot("a", {}); } + { const a: RegExp = regexNot("a", { contains: false }); } + } + + namespace repeat { + const { repeat } = util; + { const a: number[] = repeat(1, 10); } + { const a: string[] = repeat("a", 10); } + { const a: number[][] = repeat([2], 10); } + } + + namespace signalNameToCode { + const { signalNameToCode } = util; + signalNameToCode("SIGINT").toFixed(2); + } + + namespace splitBuffer { + const { splitBuffer } = util; + + { const a: Buffer[] = splitBuffer(Buffer.from("asd"), Buffer.from("|")); } + { const a: Buffer[] = splitBuffer(Buffer.from("asd"), Buffer.from("|"), true); } + { const a: Buffer[] = splitBuffer("asd", Buffer.from("|"), true); } + { const a: Buffer[] = splitBuffer("asd", "|"); } + } + + namespace splitString { + const { splitString } = util; + + splitString("a"); + splitString("a", {}); + splitString("a", { braces: false }); + splitString("a", { keepDoubleQuotes: false }); + splitString("a", { keepEscaping: false }); + splitString("a", { keepQuotes: false }); + splitString("a", { keepSingleQuotes: false }); + splitString("a", { separator: "|" }); + splitString("a", { + split(token) { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + } + }); + splitString("a", (token) => { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + }); + splitString("a", {}, (token) => { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + }); + } + + namespace toRegex { + const { toRegex } = util; + + { const a: RegExp = toRegex("a"); } + { const a: RegExp = toRegex(["a"]); } + { const a: RegExp = toRegex(["a"], {}); } + { const a: RegExp = toRegex(["a"], { cache: false }); } + { const a: RegExp = toRegex(["a"], { contains: false }); } + { const a: RegExp = toRegex(["a"], { flags: "i" }); } + { const a: RegExp = toRegex(["a"], { negate: false }); } + { const a: RegExp = toRegex(["a"], { nocase: false }); } + } + + namespace toRegexRange { + const { toRegexRange } = util; + + { const a: RegExp = toRegexRange(1, 10); } + { const a: RegExp = toRegexRange("1", "10"); } + { const a: RegExp = toRegexRange(1, 10, {}); } + { const a: RegExp = toRegexRange(1, 10, { capture: false }); } + { const a: RegExp = toRegexRange(1, 10, { relaxZeros: true }); } + { const a: RegExp = toRegexRange(1, 10, { shorthand: false }); } + } + + namespace xorDistance { + const { compare, create, eq, gt, lt } = util.xorDistance; + + { const a: boolean = compare(Buffer.from("1"), Buffer.from("2")); } + { const a: Buffer = create(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = gt(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = lt(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = eq(Buffer.from("1"), Buffer.from("2")); } + } + + namespace braces { + const { braces } = util; + + { const a: string[] = braces("a"); } + { const a: string[] = braces("a", {}); } + { const a: string[] = braces("a", { expand: false }); } + { const a: string[] = braces("a", { nodupes: false }); } + { const a: string[] = braces("a", { optimize: true }); } + { const a: string[] = braces("a", { quantifiers: false }); } + { const a: string[] = braces("a", { rangeLimit: 100 }); } + { const a: string[] = braces("a", { transform: (s: string) => s }); } + { const a: string[] = braces("a", { unescape: false }); } + + { const a: string[] = braces.expand("a"); } + { const a: string[] = braces.expand("a", {}); } + { const a: string[] = braces.expand("a", { expand: false }); } + { const a: string[] = braces.expand("a", { nodupes: false }); } + { const a: string[] = braces.expand("a", { optimize: true }); } + { const a: string[] = braces.expand("a", { quantifiers: false }); } + { const a: string[] = braces.expand("a", { rangeLimit: 100 }); } + { const a: string[] = braces.expand("a", { transform: (s: string) => s }); } + { const a: string[] = braces.expand("a", { unescape: false }); } + + { const a: RegExp = braces.makeRe("a"); } + { const a: RegExp = braces.makeRe("a", {}); } + { const a: RegExp = braces.makeRe("a", { expand: false }); } + { const a: RegExp = braces.makeRe("a", { nodupes: false }); } + { const a: RegExp = braces.makeRe("a", { optimize: true }); } + { const a: RegExp = braces.makeRe("a", { quantifiers: false }); } + { const a: RegExp = braces.makeRe("a", { rangeLimit: 100 }); } + { const a: RegExp = braces.makeRe("a", { transform: (s: string) => s }); } + { const a: RegExp = braces.makeRe("a", { unescape: false }); } + + { const a: number = braces.MAX_LENGTH; } + { const a: object = braces.getCache(); } + braces.clearCache(); + braces.resizeCache(100500); + } + + namespace match { + const { match } = util; + + { const a: string[] = match(["a"], "a"); } + { const a: string[] = match(["a"], ["a"]); } + { const a: string[] = match(["a"], ["a"], {}); } + { const a: string[] = match(["a"], ["a"], { basename: false }); } + { const a: string[] = match(["a"], ["a"], { bash: false }); } + { const a: string[] = match(["a"], ["a"], { cache: false }); } + { const a: string[] = match(["a"], ["a"], { dot: true }); } + { const a: string[] = match(["a"], ["a"], { failglob: false }); } + { const a: string[] = match(["a"], ["a"], { ignore: "a" }); } + { const a: string[] = match(["a"], ["a"], { ignore: ["a"] }); } + { const a: string[] = match(["a"], ["a"], { matchBase: false }); } + { const a: string[] = match(["a"], ["a"], { nobrace: true }); } + { const a: string[] = match(["a"], ["a"], { nocase: false }); } + { const a: string[] = match(["a"], ["a"], { nodupes: true }); } + { const a: string[] = match(["a"], ["a"], { noext: false }); } + { const a: string[] = match(["a"], ["a"], { noglobstar: true }); } + { const a: string[] = match(["a"], ["a"], { nonegate: false }); } + { const a: string[] = match(["a"], ["a"], { nonull: false }); } + { const a: string[] = match(["a"], ["a"], { nullglob: false }); } + { const a: string[] = match(["a"], ["a"], { snapdragon: {} }); } + { const a: string[] = match(["a"], ["a"], { sourcemap: false }); } + { const a: string[] = match(["a"], ["a"], { unescape: false }); } + { const a: string[] = match(["a"], ["a"], { unixify: false }); } + + { const a: string[] = match.match(["a"], "a"); } + { const a: string[] = match.match(["a"], "a", {}); } + { const a: string[] = match.match(["a"], "a", { basename: false }); } + { const a: string[] = match.match(["a"], "a", { bash: false }); } + { const a: string[] = match.match(["a"], "a", { cache: false }); } + { const a: string[] = match.match(["a"], "a", { dot: true }); } + { const a: string[] = match.match(["a"], "a", { failglob: false }); } + { const a: string[] = match.match(["a"], "a", { ignore: "a" }); } + { const a: string[] = match.match(["a"], "a", { ignore: ["a"] }); } + { const a: string[] = match.match(["a"], "a", { matchBase: false }); } + { const a: string[] = match.match(["a"], "a", { nobrace: true }); } + { const a: string[] = match.match(["a"], "a", { nocase: false }); } + { const a: string[] = match.match(["a"], "a", { nodupes: true }); } + { const a: string[] = match.match(["a"], "a", { noext: false }); } + { const a: string[] = match.match(["a"], "a", { noglobstar: true }); } + { const a: string[] = match.match(["a"], "a", { nonegate: false }); } + { const a: string[] = match.match(["a"], "a", { nonull: false }); } + { const a: string[] = match.match(["a"], "a", { nullglob: false }); } + { const a: string[] = match.match(["a"], "a", { snapdragon: {} }); } + { const a: string[] = match.match(["a"], "a", { sourcemap: false }); } + { const a: string[] = match.match(["a"], "a", { unescape: false }); } + { const a: string[] = match.match(["a"], "a", { unixify: false }); } + + { const a: boolean = match.isMatch("a", "a"); } + { const a: boolean = match.isMatch("a", "a", {}); } + { const a: boolean = match.isMatch("a", "a", { basename: false }); } + { const a: boolean = match.isMatch("a", "a", { bash: false }); } + { const a: boolean = match.isMatch("a", "a", { cache: false }); } + { const a: boolean = match.isMatch("a", "a", { dot: true }); } + { const a: boolean = match.isMatch("a", "a", { failglob: false }); } + { const a: boolean = match.isMatch("a", "a", { ignore: "a" }); } + { const a: boolean = match.isMatch("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.isMatch("a", "a", { matchBase: false }); } + { const a: boolean = match.isMatch("a", "a", { nobrace: true }); } + { const a: boolean = match.isMatch("a", "a", { nocase: false }); } + { const a: boolean = match.isMatch("a", "a", { nodupes: true }); } + { const a: boolean = match.isMatch("a", "a", { noext: false }); } + { const a: boolean = match.isMatch("a", "a", { noglobstar: true }); } + { const a: boolean = match.isMatch("a", "a", { nonegate: false }); } + { const a: boolean = match.isMatch("a", "a", { nonull: false }); } + { const a: boolean = match.isMatch("a", "a", { nullglob: false }); } + { const a: boolean = match.isMatch("a", "a", { snapdragon: {} }); } + { const a: boolean = match.isMatch("a", "a", { sourcemap: false }); } + { const a: boolean = match.isMatch("a", "a", { unescape: false }); } + { const a: boolean = match.isMatch("a", "a", { unixify: false }); } + + { const a: boolean = match.some(["a"], ["a"]); } + { const a: boolean = match.some("a", "a"); } + { const a: boolean = match.some("a", "a", {}); } + { const a: boolean = match.some("a", "a", { basename: false }); } + { const a: boolean = match.some("a", "a", { bash: false }); } + { const a: boolean = match.some("a", "a", { cache: false }); } + { const a: boolean = match.some("a", "a", { dot: true }); } + { const a: boolean = match.some("a", "a", { failglob: false }); } + { const a: boolean = match.some("a", "a", { ignore: "a" }); } + { const a: boolean = match.some("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.some("a", "a", { matchBase: false }); } + { const a: boolean = match.some("a", "a", { nobrace: true }); } + { const a: boolean = match.some("a", "a", { nocase: false }); } + { const a: boolean = match.some("a", "a", { nodupes: true }); } + { const a: boolean = match.some("a", "a", { noext: false }); } + { const a: boolean = match.some("a", "a", { noglobstar: true }); } + { const a: boolean = match.some("a", "a", { nonegate: false }); } + { const a: boolean = match.some("a", "a", { nonull: false }); } + { const a: boolean = match.some("a", "a", { nullglob: false }); } + { const a: boolean = match.some("a", "a", { snapdragon: {} }); } + { const a: boolean = match.some("a", "a", { sourcemap: false }); } + { const a: boolean = match.some("a", "a", { unescape: false }); } + { const a: boolean = match.some("a", "a", { unixify: false }); } + + { const a: boolean = match.every(["a"], ["a"]); } + { const a: boolean = match.every("a", "a"); } + { const a: boolean = match.every("a", "a", {}); } + { const a: boolean = match.every("a", "a", { basename: false }); } + { const a: boolean = match.every("a", "a", { bash: false }); } + { const a: boolean = match.every("a", "a", { cache: false }); } + { const a: boolean = match.every("a", "a", { dot: true }); } + { const a: boolean = match.every("a", "a", { failglob: false }); } + { const a: boolean = match.every("a", "a", { ignore: "a" }); } + { const a: boolean = match.every("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.every("a", "a", { matchBase: false }); } + { const a: boolean = match.every("a", "a", { nobrace: true }); } + { const a: boolean = match.every("a", "a", { nocase: false }); } + { const a: boolean = match.every("a", "a", { nodupes: true }); } + { const a: boolean = match.every("a", "a", { noext: false }); } + { const a: boolean = match.every("a", "a", { noglobstar: true }); } + { const a: boolean = match.every("a", "a", { nonegate: false }); } + { const a: boolean = match.every("a", "a", { nonull: false }); } + { const a: boolean = match.every("a", "a", { nullglob: false }); } + { const a: boolean = match.every("a", "a", { snapdragon: {} }); } + { const a: boolean = match.every("a", "a", { sourcemap: false }); } + { const a: boolean = match.every("a", "a", { unescape: false }); } + { const a: boolean = match.every("a", "a", { unixify: false }); } + + { const a: boolean = match.any(["a"], ["a"]); } + { const a: boolean = match.any("a", "a"); } + { const a: boolean = match.any("a", "a", {}); } + { const a: boolean = match.any("a", "a", { basename: false }); } + { const a: boolean = match.any("a", "a", { bash: false }); } + { const a: boolean = match.any("a", "a", { cache: false }); } + { const a: boolean = match.any("a", "a", { dot: true }); } + { const a: boolean = match.any("a", "a", { failglob: false }); } + { const a: boolean = match.any("a", "a", { ignore: "a" }); } + { const a: boolean = match.any("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.any("a", "a", { matchBase: false }); } + { const a: boolean = match.any("a", "a", { nobrace: true }); } + { const a: boolean = match.any("a", "a", { nocase: false }); } + { const a: boolean = match.any("a", "a", { nodupes: true }); } + { const a: boolean = match.any("a", "a", { noext: false }); } + { const a: boolean = match.any("a", "a", { noglobstar: true }); } + { const a: boolean = match.any("a", "a", { nonegate: false }); } + { const a: boolean = match.any("a", "a", { nonull: false }); } + { const a: boolean = match.any("a", "a", { nullglob: false }); } + { const a: boolean = match.any("a", "a", { snapdragon: {} }); } + { const a: boolean = match.any("a", "a", { sourcemap: false }); } + { const a: boolean = match.any("a", "a", { unescape: false }); } + { const a: boolean = match.any("a", "a", { unixify: false }); } + + { const a: boolean = match.all("a", "a"); } + { const a: boolean = match.all("a", ["a"]); } + { const a: boolean = match.all(["a"], "a"); } + { const a: boolean = match.all(["a"], "a", {}); } + { const a: boolean = match.all(["a"], ["a"], { basename: false }); } + { const a: boolean = match.all(["a"], ["a"], { bash: false }); } + { const a: boolean = match.all(["a"], ["a"], { cache: false }); } + { const a: boolean = match.all(["a"], ["a"], { dot: true }); } + { const a: boolean = match.all(["a"], ["a"], { failglob: false }); } + { const a: boolean = match.all(["a"], ["a"], { ignore: "a" }); } + { const a: boolean = match.all(["a"], ["a"], { ignore: ["a"] }); } + { const a: boolean = match.all(["a"], ["a"], { matchBase: false }); } + { const a: boolean = match.all(["a"], ["a"], { nobrace: true }); } + { const a: boolean = match.all(["a"], ["a"], { nocase: false }); } + { const a: boolean = match.all(["a"], ["a"], { nodupes: true }); } + { const a: boolean = match.all(["a"], ["a"], { noext: false }); } + { const a: boolean = match.all(["a"], ["a"], { noglobstar: true }); } + { const a: boolean = match.all(["a"], ["a"], { nonegate: false }); } + { const a: boolean = match.all(["a"], ["a"], { nonull: false }); } + { const a: boolean = match.all(["a"], ["a"], { nullglob: false }); } + { const a: boolean = match.all(["a"], ["a"], { snapdragon: {} }); } + { const a: boolean = match.all(["a"], ["a"], { sourcemap: false }); } + { const a: boolean = match.all(["a"], ["a"], { unescape: false }); } + { const a: boolean = match.all(["a"], ["a"], { unixify: false }); } + + { const a: string[] = match.not(["a"], ["a"]); } + { const a: string[] = match.not(["a"], "a"); } + { const a: string[] = match.not(["a"], "a", {}); } + { const a: string[] = match.not(["a"], "a", { basename: false }); } + { const a: string[] = match.not(["a"], "a", { bash: false }); } + { const a: string[] = match.not(["a"], "a", { cache: false }); } + { const a: string[] = match.not(["a"], "a", { dot: true }); } + { const a: string[] = match.not(["a"], "a", { failglob: false }); } + { const a: string[] = match.not(["a"], "a", { ignore: "a" }); } + { const a: string[] = match.not(["a"], "a", { ignore: ["a"] }); } + { const a: string[] = match.not(["a"], "a", { matchBase: false }); } + { const a: string[] = match.not(["a"], "a", { nobrace: true }); } + { const a: string[] = match.not(["a"], "a", { nocase: false }); } + { const a: string[] = match.not(["a"], "a", { nodupes: true }); } + { const a: string[] = match.not(["a"], "a", { noext: false }); } + { const a: string[] = match.not(["a"], "a", { noglobstar: true }); } + { const a: string[] = match.not(["a"], "a", { nonegate: false }); } + { const a: string[] = match.not(["a"], "a", { nonull: false }); } + { const a: string[] = match.not(["a"], "a", { nullglob: false }); } + { const a: string[] = match.not(["a"], "a", { snapdragon: {} }); } + { const a: string[] = match.not(["a"], "a", { sourcemap: false }); } + { const a: string[] = match.not(["a"], "a", { unescape: false }); } + { const a: string[] = match.not(["a"], "a", { unixify: false }); } + + { const a: boolean = match.contains("a", "a"); } + { const a: boolean = match.contains("a", ["a"]); } + { const a: boolean = match.contains("a", ["a"], {}); } + { const a: boolean = match.contains("a", ["a"], { basename: false }); } + { const a: boolean = match.contains("a", ["a"], { bash: false }); } + { const a: boolean = match.contains("a", ["a"], { cache: false }); } + { const a: boolean = match.contains("a", ["a"], { dot: true }); } + { const a: boolean = match.contains("a", ["a"], { failglob: false }); } + { const a: boolean = match.contains("a", ["a"], { ignore: "a" }); } + { const a: boolean = match.contains("a", ["a"], { ignore: ["a"] }); } + { const a: boolean = match.contains("a", ["a"], { matchBase: false }); } + { const a: boolean = match.contains("a", ["a"], { nobrace: true }); } + { const a: boolean = match.contains("a", ["a"], { nocase: false }); } + { const a: boolean = match.contains("a", ["a"], { nodupes: true }); } + { const a: boolean = match.contains("a", ["a"], { noext: false }); } + { const a: boolean = match.contains("a", ["a"], { noglobstar: true }); } + { const a: boolean = match.contains("a", ["a"], { nonegate: false }); } + { const a: boolean = match.contains("a", ["a"], { nonull: false }); } + { const a: boolean = match.contains("a", ["a"], { nullglob: false }); } + { const a: boolean = match.contains("a", ["a"], { snapdragon: {} }); } + { const a: boolean = match.contains("a", ["a"], { sourcemap: false }); } + { const a: boolean = match.contains("a", ["a"], { unescape: false }); } + { const a: boolean = match.contains("a", ["a"], { unixify: false }); } + + { const a: object = match.matchKeys({}, "a"); } + { const a: object = match.matchKeys({}, ["a"]); } + { const a: object = match.matchKeys({}, ["a"], {}); } + { const a: object = match.matchKeys({}, ["a"], { basename: false }); } + { const a: object = match.matchKeys({}, ["a"], { bash: false }); } + { const a: object = match.matchKeys({}, ["a"], { cache: false }); } + { const a: object = match.matchKeys({}, ["a"], { dot: true }); } + { const a: object = match.matchKeys({}, ["a"], { failglob: false }); } + { const a: object = match.matchKeys({}, ["a"], { ignore: "a" }); } + { const a: object = match.matchKeys({}, ["a"], { ignore: ["a"] }); } + { const a: object = match.matchKeys({}, ["a"], { matchBase: false }); } + { const a: object = match.matchKeys({}, ["a"], { nobrace: true }); } + { const a: object = match.matchKeys({}, ["a"], { nocase: false }); } + { const a: object = match.matchKeys({}, ["a"], { nodupes: true }); } + { const a: object = match.matchKeys({}, ["a"], { noext: false }); } + { const a: object = match.matchKeys({}, ["a"], { noglobstar: true }); } + { const a: object = match.matchKeys({}, ["a"], { nonegate: false }); } + { const a: object = match.matchKeys({}, ["a"], { nonull: false }); } + { const a: object = match.matchKeys({}, ["a"], { nullglob: false }); } + { const a: object = match.matchKeys({}, ["a"], { snapdragon: {} }); } + { const a: object = match.matchKeys({}, ["a"], { sourcemap: false }); } + { const a: object = match.matchKeys({}, ["a"], { unescape: false }); } + { const a: object = match.matchKeys({}, ["a"], { unixify: false }); } + + { const a: (s: string) => boolean = match.matcher("a"); } + { const a: (s: string) => boolean = match.matcher(["a"]); } + { const a: (s: string) => boolean = match.matcher(["a"], {}); } + { const a: (s: string) => boolean = match.matcher(["a"], { basename: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { bash: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { cache: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { dot: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { failglob: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { ignore: "a" }); } + { const a: (s: string) => boolean = match.matcher(["a"], { ignore: ["a"] }); } + { const a: (s: string) => boolean = match.matcher(["a"], { matchBase: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nobrace: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nocase: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nodupes: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { noext: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { noglobstar: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nonegate: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nonull: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nullglob: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { snapdragon: {} }); } + { const a: (s: string) => boolean = match.matcher(["a"], { sourcemap: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { unescape: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { unixify: false }); } + + { const a: string[] | null = match.capture("a", "a"); } + { const a: string[] | null = match.capture("a", "a", {}); } + { const a: string[] | null = match.capture("a", "a", { basename: false }); } + { const a: string[] | null = match.capture("a", "a", { bash: false }); } + { const a: string[] | null = match.capture("a", "a", { cache: false }); } + { const a: string[] | null = match.capture("a", "a", { dot: true }); } + { const a: string[] | null = match.capture("a", "a", { failglob: false }); } + { const a: string[] | null = match.capture("a", "a", { ignore: "a" }); } + { const a: string[] | null = match.capture("a", "a", { ignore: ["a"] }); } + { const a: string[] | null = match.capture("a", "a", { matchBase: false }); } + { const a: string[] | null = match.capture("a", "a", { nobrace: true }); } + { const a: string[] | null = match.capture("a", "a", { nocase: false }); } + { const a: string[] | null = match.capture("a", "a", { nodupes: true }); } + { const a: string[] | null = match.capture("a", "a", { noext: false }); } + { const a: string[] | null = match.capture("a", "a", { noglobstar: true }); } + { const a: string[] | null = match.capture("a", "a", { nonegate: false }); } + { const a: string[] | null = match.capture("a", "a", { nonull: false }); } + { const a: string[] | null = match.capture("a", "a", { nullglob: false }); } + { const a: string[] | null = match.capture("a", "a", { snapdragon: {} }); } + { const a: string[] | null = match.capture("a", "a", { sourcemap: false }); } + { const a: string[] | null = match.capture("a", "a", { unescape: false }); } + { const a: string[] | null = match.capture("a", "a", { unixify: false }); } + + { const a: RegExp = match.makeRe("a"); } + { const a: RegExp = match.makeRe("a", {}); } + { const a: RegExp = match.makeRe("a", { basename: false }); } + { const a: RegExp = match.makeRe("a", { bash: false }); } + { const a: RegExp = match.makeRe("a", { cache: false }); } + { const a: RegExp = match.makeRe("a", { dot: true }); } + { const a: RegExp = match.makeRe("a", { failglob: false }); } + { const a: RegExp = match.makeRe("a", { ignore: "a" }); } + { const a: RegExp = match.makeRe("a", { ignore: ["a"] }); } + { const a: RegExp = match.makeRe("a", { matchBase: false }); } + { const a: RegExp = match.makeRe("a", { nobrace: true }); } + { const a: RegExp = match.makeRe("a", { nocase: false }); } + { const a: RegExp = match.makeRe("a", { nodupes: true }); } + { const a: RegExp = match.makeRe("a", { noext: false }); } + { const a: RegExp = match.makeRe("a", { noglobstar: true }); } + { const a: RegExp = match.makeRe("a", { nonegate: false }); } + { const a: RegExp = match.makeRe("a", { nonull: false }); } + { const a: RegExp = match.makeRe("a", { nullglob: false }); } + { const a: RegExp = match.makeRe("a", { snapdragon: {} }); } + { const a: RegExp = match.makeRe("a", { sourcemap: false }); } + { const a: RegExp = match.makeRe("a", { unescape: false }); } + { const a: RegExp = match.makeRe("a", { unixify: false }); } + + { const a: string[] = match.braces("a"); } + { const a: string[] = match.braces("a", {}); } + { const a: string[] = match.braces("a", {}); } + { const a: string[] = match.braces("a", { basename: false }); } + { const a: string[] = match.braces("a", { bash: false }); } + { const a: string[] = match.braces("a", { cache: false }); } + { const a: string[] = match.braces("a", { dot: true }); } + { const a: string[] = match.braces("a", { failglob: false }); } + { const a: string[] = match.braces("a", { ignore: "a" }); } + { const a: string[] = match.braces("a", { ignore: ["a"] }); } + { const a: string[] = match.braces("a", { matchBase: false }); } + { const a: string[] = match.braces("a", { nobrace: true }); } + { const a: string[] = match.braces("a", { nocase: false }); } + { const a: string[] = match.braces("a", { nodupes: true }); } + { const a: string[] = match.braces("a", { noext: false }); } + { const a: string[] = match.braces("a", { noglobstar: true }); } + { const a: string[] = match.braces("a", { nonegate: false }); } + { const a: string[] = match.braces("a", { nonull: false }); } + { const a: string[] = match.braces("a", { nullglob: false }); } + { const a: string[] = match.braces("a", { snapdragon: {} }); } + { const a: string[] = match.braces("a", { sourcemap: false }); } + { const a: string[] = match.braces("a", { unescape: false }); } + { const a: string[] = match.braces("a", { unixify: false }); } + + { const a: object = match.create("a"); } + { const a: object = match.create("a", {}); } + { const a: object = match.create("a", { basename: false }); } + { const a: object = match.create("a", { bash: false }); } + { const a: object = match.create("a", { cache: false }); } + { const a: object = match.create("a", { dot: true }); } + { const a: object = match.create("a", { failglob: false }); } + { const a: object = match.create("a", { ignore: "a" }); } + { const a: object = match.create("a", { ignore: ["a"] }); } + { const a: object = match.create("a", { matchBase: false }); } + { const a: object = match.create("a", { nobrace: true }); } + { const a: object = match.create("a", { nocase: false }); } + { const a: object = match.create("a", { nodupes: true }); } + { const a: object = match.create("a", { noext: false }); } + { const a: object = match.create("a", { noglobstar: true }); } + { const a: object = match.create("a", { nonegate: false }); } + { const a: object = match.create("a", { nonull: false }); } + { const a: object = match.create("a", { nullglob: false }); } + { const a: object = match.create("a", { snapdragon: {} }); } + { const a: object = match.create("a", { sourcemap: false }); } + { const a: object = match.create("a", { unescape: false }); } + { const a: object = match.create("a", { unixify: false }); } + { const a: object = match.create("a"); } + + { const a: object = match.parse("a", {}); } + { const a: object = match.parse("a", { basename: false }); } + { const a: object = match.parse("a", { bash: false }); } + { const a: object = match.parse("a", { cache: false }); } + { const a: object = match.parse("a", { dot: true }); } + { const a: object = match.parse("a", { failglob: false }); } + { const a: object = match.parse("a", { ignore: "a" }); } + { const a: object = match.parse("a", { ignore: ["a"] }); } + { const a: object = match.parse("a", { matchBase: false }); } + { const a: object = match.parse("a", { nobrace: true }); } + { const a: object = match.parse("a", { nocase: false }); } + { const a: object = match.parse("a", { nodupes: true }); } + { const a: object = match.parse("a", { noext: false }); } + { const a: object = match.parse("a", { noglobstar: true }); } + { const a: object = match.parse("a", { nonegate: false }); } + { const a: object = match.parse("a", { nonull: false }); } + { const a: object = match.parse("a", { nullglob: false }); } + { const a: object = match.parse("a", { snapdragon: {} }); } + { const a: object = match.parse("a", { sourcemap: false }); } + { const a: object = match.parse("a", { unescape: false }); } + { const a: object = match.parse("a", { unixify: false }); } + + { const a: object = match.compile("a", {}); } + { const a: object = match.compile({}, {}); } + { const a: object = match.compile("a", { basename: false }); } + { const a: object = match.compile({}, { basename: false }); } + { const a: object = match.compile("a", { bash: false }); } + { const a: object = match.compile({}, { bash: false }); } + { const a: object = match.compile("a", { cache: false }); } + { const a: object = match.compile({}, { cache: false }); } + { const a: object = match.compile("a", { dot: true }); } + { const a: object = match.compile({}, { dot: true }); } + { const a: object = match.compile("a", { failglob: false }); } + { const a: object = match.compile({}, { failglob: false }); } + { const a: object = match.compile("a", { ignore: "a" }); } + { const a: object = match.compile({}, { ignore: "a" }); } + { const a: object = match.compile("a", { ignore: ["a"] }); } + { const a: object = match.compile({}, { ignore: ["a"] }); } + { const a: object = match.compile("a", { matchBase: false }); } + { const a: object = match.compile({}, { matchBase: false }); } + { const a: object = match.compile("a", { nobrace: true }); } + { const a: object = match.compile({}, { nobrace: true }); } + { const a: object = match.compile("a", { nocase: false }); } + { const a: object = match.compile({}, { nocase: false }); } + { const a: object = match.compile("a", { nodupes: true }); } + { const a: object = match.compile({}, { nodupes: true }); } + { const a: object = match.compile("a", { noext: false }); } + { const a: object = match.compile({}, { noext: false }); } + { const a: object = match.compile("a", { noglobstar: true }); } + { const a: object = match.compile({}, { noglobstar: true }); } + { const a: object = match.compile("a", { nonegate: false }); } + { const a: object = match.compile({}, { nonegate: false }); } + { const a: object = match.compile("a", { nonull: false }); } + { const a: object = match.compile({}, { nonull: false }); } + { const a: object = match.compile("a", { nullglob: false }); } + { const a: object = match.compile({}, { nullglob: false }); } + { const a: object = match.compile("a", { snapdragon: {} }); } + { const a: object = match.compile({}, { snapdragon: {} }); } + { const a: object = match.compile("a", { sourcemap: false }); } + { const a: object = match.compile({}, { sourcemap: false }); } + { const a: object = match.compile("a", { unescape: false }); } + { const a: object = match.compile({}, { unescape: false }); } + { const a: object = match.compile("a", { unixify: false }); } + { const a: object = match.compile({}, { unixify: false }); } + + { const a: number = match.MAX_LENGTH; } + match.clearCache(); + match.resizeCache(10050); + { const a: object = match.getCache(); } + } } diff --git a/types/adone/tsconfig.json b/types/adone/tsconfig.json index c23bf82155..8d1f4040d6 100644 --- a/types/adone/tsconfig.json +++ b/types/adone/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "experimentalDecorators": true }, "files": [ "index.d.ts", @@ -23,6 +24,7 @@ "glosses/math/index.d.ts", "glosses/math/matrix.d.ts", "glosses/math/simd.d.ts", + "glosses/meta.d.ts", "glosses/std.d.ts", "glosses/utils.d.ts", "glosses/assertion.d.ts", @@ -43,9 +45,11 @@ "adone-tests.ts", "test/index.ts", "test/index-import.ts", + "test/glosses/application.ts", "test/glosses/math/index.ts", "test/glosses/math/matrix.ts", "test/glosses/math/simd.ts", + "test/glosses/meta.ts", "test/glosses/std.ts", "test/glosses/utils.ts", "test/glosses/assertion.ts", diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 7f5649befb..0b05400f6d 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -289,25 +289,25 @@ foo.then((x) => { // $q signature tests namespace TestQ { - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - interface TValue { + interface EfObject { e: number; f: boolean; } - interface TOther { + interface GhObject { g: string; h: number; } - const tResult: TResult = null; - const promiseTResult: angular.IPromise = null; - const tValue: TValue = null; - const promiseTValue: angular.IPromise = null; - const tOther: TOther = null; - const promiseTOther: angular.IPromise = null; + const abcObject: AbcObject = null; + const abcObjectPromise: angular.IPromise = null; + const efObject: EfObject = null; + const efObjectPromise: angular.IPromise = null; + const ghObject: GhObject = null; + const ghObjectPromise: angular.IPromise = null; const $q: angular.IQService = null; const promiseAny: angular.IPromise = null; @@ -316,11 +316,11 @@ namespace TestQ { // $q constructor { - let result: angular.IPromise; - result = new $q((resolve: (value: TResult) => any) => {}); - result = new $q((resolve: (value: TResult) => any, reject: (value: any) => any) => {}); - result = $q((resolve: (value: TResult) => any) => {}); - result = $q((resolve: (value: TResult) => any, reject: (value: any) => any) => {}); + let result: angular.IPromise; + result = new $q((resolve: (value: AbcObject) => any) => {}); + result = new $q((resolve: (value: AbcObject) => any, reject: (value: any) => any) => {}); + result = $q((resolve: (value: AbcObject) => any) => {}); + result = $q((resolve: (value: AbcObject) => any, reject: (value: any) => any) => {}); } // $q.all @@ -332,8 +332,8 @@ namespace TestQ { $q.all([1, $q.when(2), '3']).then(([ n1, n2, n3 ]) => n1.toFixed() + n2.toFixed() + n3.slice(1)); } { - let result: angular.IPromise; - result = $q.all([promiseAny, promiseAny]); + let result: angular.IPromise; + result = $q.all([promiseAny, promiseAny]); } { let result: angular.IPromise<{[id: string]: any; }>; @@ -356,13 +356,13 @@ namespace TestQ { // $q.defer { - let result: angular.IDeferred; - result = $q.defer(); - result.resolve(tResult); + let result: angular.IDeferred; + result = $q.defer(); + result.resolve(abcObject); const anyValue: any = null; result.reject(anyValue); result.promise.then(result => { - return $q.resolve(result); + return $q.resolve(result); }); } @@ -380,10 +380,10 @@ namespace TestQ { result = $q.resolve(); } { - let result: angular.IPromise; - result = $q.resolve(tResult); - result = $q.resolve(promiseTResult); - const result2: angular.IPromise = $q.resolve(Math.random() > 0.5 ? tResult : promiseTOther); + let result: angular.IPromise; + result = $q.resolve(abcObject); + result = $q.resolve(abcObjectPromise); + const result2: angular.IPromise = $q.resolve(Math.random() > 0.5 ? abcObject : ghObjectPromise); } // $q.when @@ -392,32 +392,32 @@ namespace TestQ { result = $q.when(); } { - let result: angular.IPromise; - let resultOther: angular.IPromise; + let result: angular.IPromise; + let resultOther: angular.IPromise; - result = $q.when(tResult); - result = $q.when(promiseTResult); + result = $q.when(abcObject); + result = $q.when(abcObjectPromise); - result = $q.when(tValue, (result: TValue) => tResult); - result = $q.when(tValue, (result: TValue) => tResult, (any) => any); - result = $q.when(tValue, (result: TValue) => tResult, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObject); + result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any, (any) => any); - result = $q.when(promiseTValue, (result: TValue) => tResult); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther, (any) => any); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => promiseTOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => promiseTOther, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); - result = $q.when(tValue, (result: TValue) => promiseTResult); - result = $q.when(tValue, (result: TValue) => promiseTResult, (any) => any); - result = $q.when(tValue, (result: TValue) => promiseTResult, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any); - result = $q.when(promiseTValue, (result: TValue) => promiseTResult); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => tOther, (any) => any); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => promiseTOther); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => promiseTOther, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObjectPromise, (any) => any); } } @@ -440,41 +440,41 @@ httpFoo.then((response: ng.IHttpResponse) => { // Deferred signature tests namespace TestDeferred { - const any: any = null; + const anything: any = null; - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - const tResult: TResult = null; + const abcObject: AbcObject = null; - const deferred: angular.IDeferred = null; + const deferred: angular.IDeferred = null; // deferred.resolve { let result: void; result = deferred.resolve(); - result = deferred.resolve(tResult); + result = deferred.resolve(abcObject); } // deferred.reject { let result: void; result = deferred.reject(); - result = deferred.reject(any); + result = deferred.reject(anything); } // deferred.notify { let result: void; result = deferred.notify(); - result = deferred.notify(any); + result = deferred.notify(anything); } // deferred.promise { - let result: angular.IPromise; + let result: angular.IPromise; result = deferred.promise; } } @@ -517,139 +517,139 @@ namespace TestInjector { // Promise signature tests namespace TestPromise { - const any: any = null; + const anything: any = null; - interface TResult { - kind: 'result'; + interface AbcObject { + kind: 'abc'; a: number; b: string; c: boolean; } - interface TOther { - kind: 'other'; + interface DefObject { + kind: 'def'; d: number; e: string; f: boolean; } - function isTResult(x: TResult | TOther): x is TResult { - return x.kind === 'result'; + function isAbcObject(x: AbcObject | DefObject): x is AbcObject { + return x.kind === 'abc'; } - const tresult: TResult = null; - const tresultPromise: ng.IPromise = null; - const tresultHttpPromise: ng.IHttpPromise = null; + const abcObject: AbcObject = null; + const abcObjectPromise: ng.IPromise = null; + const abcObjectHttpPromise: ng.IHttpPromise = null; - const tother: TOther = null; - const totherPromise: ng.IPromise = null; - const totherHttpPromise: ng.IHttpPromise = null; + const defObject: DefObject = null; + const defObjectPromise: ng.IPromise = null; + const defObjectHttpPromise: ng.IHttpPromise = null; - const promise: angular.IPromise = null; + const promise: angular.IPromise = null; const $q: angular.IQService = null; - const reject = $q.reject(); + const rejectedPromise = $q.reject(); // promise.then // $ExpectType IPromise - promise.then(result => any); + promise.then(result => anything); // $ExpectType IPromise - promise.then(result => any, any => any); + promise.then(result => anything, any => any); // $ExpectType IPromise - promise.then(result => any, any => any, any => any); + promise.then(result => anything, any => any, any => any); // $ExpectType IPromise - promise.then(result => reject); + promise.then(result => rejectedPromise); // $ExpectType IPromise - promise.then(result => reject, any => reject); + promise.then(result => rejectedPromise, any => rejectedPromise); // $ExpectType IPromise - promise.then(result => reject, any => reject, any => any); + promise.then(result => rejectedPromise, any => rejectedPromise, any => any); - // $ExpectType IPromise + // $ExpectType IPromise promise.then(result => result); - // $ExpectType IPromise - promise.then(result => tresult); - // $ExpectType IPromise - promise.then(result => tresultPromise); + // $ExpectType IPromise + promise.then(result => abcObject); + // $ExpectType IPromise + promise.then(result => abcObjectPromise); // $ExpectType IPromise promise.then(result => result, any => any); - // $ExpectType IPromise + // $ExpectType IPromise promise.then(result => result, any => Math.random()); // $ExpectType IPromise promise.then(result => result, any => any, any => any); - // $ExpectType IPromise + // $ExpectType IPromise promise.then(result => result, any => Math.random(), any => any); - // $ExpectType IPromise - promise.then(result => result, any => reject, any => any); + // $ExpectType IPromise + promise.then(result => result, any => rejectedPromise, any => any); - // $ExpectType IPromise - promise.then(result => anyOf2(reject, result)); - // $ExpectType IPromise - promise.then(result => anyOf3(result, tresultPromise, reject)); - // $ExpectType IPromise + // $ExpectType IPromise + promise.then(result => anyOf2(rejectedPromise, result)); + // $ExpectType IPromise + promise.then(result => anyOf3(result, abcObjectPromise, rejectedPromise)); + // $ExpectType IPromise promise.then( - result => anyOf3(reject, result, tresultPromise), - reason => anyOf3(reject, tresult, tresultPromise) + result => anyOf3(rejectedPromise, result, abcObjectPromise), + reason => anyOf3(rejectedPromise, abcObject, abcObjectPromise) ); - // $ExpectType IPromise> - promise.then(result => tresultHttpPromise); + // $ExpectType IPromise> + promise.then(result => abcObjectHttpPromise); - // $ExpectType IPromise - promise.then(result => result, any => tother); + // $ExpectType IPromise + promise.then(result => result, any => defObject); // These are broken and seemingly can't be made to work // with the current limitations of TypeScript. - // xExpectType IPromise - // promise.then(result => anyOf2(result, totherPromise)); - // xExpectType IPromise - // promise.then(result => anyOf3(reject, result, totherPromise)); - // xExpectType IPromise + // xExpectType IPromise + // promise.then(result => anyOf2(result, defObjectPromise)); + // xExpectType IPromise + // promise.then(result => anyOf3(rejectedPromise, result, defObjectPromise)); + // xExpectType IPromise // const a4 = promise.then( - // result => anyOf3(reject, result, totherPromise), - // reason => anyOf3(reject, tother, tresultPromise) + // result => anyOf3(rejectedPromise, result, defObjectPromise), + // reason => anyOf3(rejectedPromise, defObject, abcObjectPromise) // ); - // $ExpectType IPromise - promise.then(result => - anyOf3(tresultPromise, result, totherPromise) + // $ExpectType IPromise + promise.then(result => + anyOf3(abcObjectPromise, result, defObjectPromise) ); - // $ExpectType IPromise - promise.then(result => result, any => tother, any => any); - // $ExpectType IPromise - promise.then(result => tresultPromise, any => totherPromise); - // $ExpectType IPromise - promise.then(result => tresultPromise, any => totherPromise, any => any); - // $ExpectType IPromise | IHttpResponse> - promise.then(result => tresultHttpPromise, any => totherHttpPromise); - // $ExpectType IPromise | IHttpResponse> - promise.then(result => tresultHttpPromise, any => totherHttpPromise, any => any); + // $ExpectType IPromise + promise.then(result => result, any => defObject, any => any); + // $ExpectType IPromise + promise.then(result => abcObjectPromise, any => defObjectPromise); + // $ExpectType IPromise + promise.then(result => abcObjectPromise, any => defObjectPromise, any => any); + // $ExpectType IPromise | IHttpResponse> + promise.then(result => abcObjectHttpPromise, any => defObjectHttpPromise); + // $ExpectType IPromise | IHttpResponse> + promise.then(result => abcObjectHttpPromise, any => defObjectHttpPromise, any => any); - // $ExpectType IPromise - promise.then(result => tother); + // $ExpectType IPromise + promise.then(result => defObject); // $ExpectType IPromise - promise.then(result => tother, any => any); + promise.then(result => defObject, any => any); // $ExpectType IPromise - promise.then(result => tother, any => any, any => any); - // $ExpectType IPromise - promise.then(result => totherPromise); + promise.then(result => defObject, any => any, any => any); + // $ExpectType IPromise + promise.then(result => defObjectPromise); // $ExpectType IPromise - promise.then(result => totherPromise, any => any); + promise.then(result => defObjectPromise, any => any); // $ExpectType IPromise - promise.then(result => totherPromise, any => any, any => any); - // $ExpectType IPromise> - promise.then(result => totherHttpPromise); + promise.then(result => defObjectPromise, any => any, any => any); + // $ExpectType IPromise> + promise.then(result => defObjectHttpPromise); // $ExpectType IPromise - promise.then(result => totherHttpPromise, any => any); + promise.then(result => defObjectHttpPromise, any => any); // $ExpectType IPromise - promise.then(result => totherHttpPromise, any => any, any => any); + promise.then(result => defObjectHttpPromise, any => any, any => any); // $ExpectType IPromise promise - .then(result => tresult, any => tother) - .then(ambiguous => (isTResult(ambiguous) ? ambiguous.c : ambiguous.f)); + .then(result => abcObject, any => defObject) + .then(ambiguous => (isAbcObject(ambiguous) ? ambiguous.c : ambiguous.f)); // promise.then + $q.reject: @@ -668,38 +668,38 @@ namespace TestPromise { // $ExpectType IPromise promise.catch(err => err); // $ExpectType IPromise - promise.catch(err => any); - // $ExpectType IPromise - promise.catch(err => tresult); - // $ExpectType IPromise - promise.catch(err => anyOf2(tresult, reject)); - // $ExpectType IPromise - promise.catch(err => anyOf3(tresult, tresultPromise, reject)); - // $ExpectType IPromise - promise.catch(err => tresultPromise); - // $ExpectType IPromise> - promise.catch(err => tresultHttpPromise); - // $ExpectType IPromise - promise.catch(err => tother); - // $ExpectType IPromise - promise.catch(err => totherPromise); - // $ExpectType IPromise> - promise.catch(err => totherHttpPromise); + promise.catch(err => anything); + // $ExpectType IPromise + promise.catch(err => abcObject); + // $ExpectType IPromise + promise.catch(err => anyOf2(abcObject, rejectedPromise)); + // $ExpectType IPromise + promise.catch(err => anyOf3(abcObject, abcObjectPromise, rejectedPromise)); + // $ExpectType IPromise + promise.catch(err => abcObjectPromise); + // $ExpectType IPromise> + promise.catch(err => abcObjectHttpPromise); + // $ExpectType IPromise + promise.catch(err => defObject); + // $ExpectType IPromise + promise.catch(err => defObjectPromise); + // $ExpectType IPromise> + promise.catch(err => defObjectHttpPromise); // $ExpectType IPromise promise - .catch(err => tother) + .catch(err => defObject) .then( - ambiguous => (isTResult(ambiguous) ? ambiguous.c : ambiguous.f) + ambiguous => (isAbcObject(ambiguous) ? ambiguous.c : ambiguous.f) ); // promise.finally - // $ExpectType IPromise - promise.finally(() => any); - // $ExpectType IPromise - promise.finally(() => tresult); - // $ExpectType IPromise - promise.finally(() => tother); + // $ExpectType IPromise + promise.finally(() => anything); + // $ExpectType IPromise + promise.finally(() => abcObject); + // $ExpectType IPromise + promise.finally(() => defObject); } function test_angular_forEach() { @@ -726,12 +726,12 @@ let elementReadyFn = angular.element(() => { // $timeout signature tests namespace TestTimeout { - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - const fnTResult: (...args: any[]) => TResult = null; + const abcObjectFn: (...args: any[]) => AbcObject = null; const promiseAny: angular.IPromise = null; const $timeout: angular.ITimeoutService = null; @@ -746,13 +746,13 @@ namespace TestTimeout { result = $timeout(1, true); } { - let result: angular.IPromise; - result = $timeout(fnTResult); - result = $timeout(fnTResult, 1); - result = $timeout(fnTResult, 1, true); - result = $timeout(fnTResult, 1, true, 1); - result = $timeout(fnTResult, 1, true, 1, ''); - result = $timeout(fnTResult, 1, true, 1, '', true); + let result: angular.IPromise; + result = $timeout(abcObjectFn); + result = $timeout(abcObjectFn, 1); + result = $timeout(abcObjectFn, 1, true); + result = $timeout(abcObjectFn, 1, true, 1); + result = $timeout(abcObjectFn, 1, true, 1, ''); + result = $timeout(abcObjectFn, 1, true, 1, '', true); } // $timeout.cancel diff --git a/types/blessed/blessed-tests.ts b/types/blessed/blessed-tests.ts index c5f857146f..aa38af8985 100644 --- a/types/blessed/blessed-tests.ts +++ b/types/blessed/blessed-tests.ts @@ -1,5 +1,6 @@ import * as blessed from "blessed"; import { readFileSync } from "fs"; +import { inspect } from "util"; let screen: blessed.Widgets.Screen = null; @@ -743,3 +744,71 @@ setTimeout(() => { table.setData(data1); screen.render(); }, 3000); + +// https://github.com/chjj/blessed/blob/master/test/program-mouse.js + +const program = blessed.program({ + dump: __dirname + '/logs/mouse.log' +}); + +// program.setMouse({ +// allMotion: true, +// //utfMouse: true +// urxvtMouse: true +// }, true); + +program.alternateBuffer(); +program.enableMouse(); +program.hideCursor(); + +program.setMouse({ sendFocus: true }, true); + +program.on('mouse', function(data) { + program.cup(data.y, data.x); + program.write(' '); + program.cup(0, 0); + program.write(inspect(data)); +}); + +program.on('resize', function(data) { + setTimeout(function() { + program.clear(); + program.cup(0, 0); + program.write(inspect({ cols: program.cols, rows: program.rows })); + }, 200); +}); + +process.on('SIGWINCH', function(data) { + setTimeout(function() { + program.cup(1, 0); + program.write(inspect({ winch: true, cols: program.cols, rows: program.rows })); + }, 200); +}); + +program.on('focus', function(data) { + program.clear(); + program.cup(0, 0); + program.write('FOCUSIN'); +}); + +program.on('blur', function(data) { + program.clear(); + program.cup(0, 0); + program.write('FOCUSOUT'); +}); + +program.key(['q', 'escape', 'C-c'], function() { + program.showCursor(); + program.disableMouse(); + program.normalBuffer(); + process.exit(0); +}); + +program.on('keypress', function(ch, data) { + if (data.name === 'mouse') return; + program.clear(); + program.cup(0, 0); + program.write(inspect(data)); +}); + +program.clear(); diff --git a/types/blessed/index.d.ts b/types/blessed/index.d.ts index eff4b72d24..7dae1709d2 100644 --- a/types/blessed/index.d.ts +++ b/types/blessed/index.d.ts @@ -7,13 +7,433 @@ /// import { EventEmitter } from "events"; +import { Writable, Readable } from "stream"; import * as stream from "stream"; import * as child_process from "child_process"; -export class BlessedProgram { - hideCursor: () => void; - move: any; - showCursor: any; +export interface IBlessedProgramOptions { + input?: Readable; + output?: Writable; + log?: string; + dump?: boolean; + zero?: boolean; + buffer?: boolean; + terminal?: string; + term?: string; + tput?: string; + debug?: boolean; + resizeTimeout?: boolean; +} + +export class BlessedProgram extends EventEmitter { + type: string; + options: IBlessedProgramOptions; + input: Readable; + output: Writable; + zero: boolean; + useBuffer: boolean; + x: number; + y: number; + savedX: number; + savedY: number; + cols: number; + rows: number; + scrollTop: number; + scrollBottom: number; + isOSXTerm: boolean; + isiTerm2: boolean; + isXFCE: boolean; + isTerminator: boolean; + isLXDE: boolean; + isVTE: boolean; + isRxvt: boolean; + isXterm: boolean; + tmux: boolean; + tmuxVersion: number; + + constructor(options?: IBlessedProgramOptions); + + log(): boolean; + debug(): boolean; + setupDump(): void; + setupTput(): void; + setTerminal(terminal: string): void; + has(name: string): boolean; + term(is: string): boolean; + + listen(): void; + destroy(): void; + + key(key: string|string[], listener: Function): void; + onceKey(key: string|string[], listener: Function): void; + + unKey(key: string|string[], listener: Function): void; + removeKey(key: string|string[], listener: Function): void; + + bindMouse(): void; + enableGpm(): void; + disableGpm(): void; + bindResponse(): void; + + response(name: string, text: string, callback: Function, noBypass?: boolean): boolean; + response(name: string, callback?: Function): boolean; + + write(text: string): boolean; + flush(): void; + print(text: string, attr?: boolean): boolean; + echo(text: string, attr?: boolean): boolean; + + setx(x: number): boolean; + sety(y: number): boolean; + move(x: number, y: number): boolean; + omove(x: number, y: number): void; + rsetx(x: number): boolean; + rsety(y: number): boolean; + rmove(x: number, y: number): void; + + simpleInsert(ch: string, i?: number, attr?: boolean): boolean; + repeat(ch: string, i?: number): string; + copyToClipboard(text: string): boolean; + + cursorShape(shape: string, blink?: boolean): boolean; + cursorColor(color: string): boolean; + cursorReset(): boolean; + resetCursor(): boolean; + + getTextParams(param: string, callback: Function): boolean; + getCursorColor(callback: Function): boolean; + + nul(): boolean; + + bell(): boolean; + bel(): boolean; + + vtab(): boolean; + + form(): boolean; + ff(): boolean; + + backspace(): boolean; + kbs(): boolean; + + tab(): boolean; + ht(): boolean; + + shiftOut(): boolean; + shiftIn(): boolean; + + return(): boolean; + cr(): boolean; + + feed(): boolean; + newline(): boolean; + nl(): boolean; + + index(): boolean; + ind(): boolean; + + reverseIndex(): boolean; + reverse(): boolean; + ri(): boolean; + + nextLine(): boolean; + reset(): boolean; + tabSet(): boolean; + + saveCursor(key: string): boolean; + sc(key: string): boolean; + + restoreCursor(key?: string, hide?: boolean): boolean; + rc(key?: string, hide?: boolean): boolean; + + lsaveCursor(key?: string): void; + lrestoreCursor(key?: string, hide?: boolean): void; + + lineHeight(): boolean; + + charset(val?: string, level?: number): boolean; + + enter_alt_charset_mode(): boolean; + as(): boolean; + smacs(): boolean; + + exit_alt_charset_mode(): boolean; + ae(): boolean; + rmacs(): boolean; + + setG(val: number): boolean; + + setTitle(title: string): boolean; + + resetColors(param?: string): boolean; + + dynamicColors(param?: string): boolean; + + selData(a: string, b: string): boolean; + + cursorUp(param?: number): boolean; + cuu(param?: number): boolean; + up(param?: number): boolean; + + cursorDown(param?: number): boolean; + cud(param?: number): boolean; + down(param?: number): boolean; + + cursorForward(param?: number): boolean; + cuf(param?: number): boolean; + right(param?: number): boolean; + forward(param?: number): boolean; + + cursorBackward(param?: number): boolean; + cub(param?: number): boolean; + left(param?: number): boolean; + back(param?: number): boolean; + + cursorPos(row?: number, col?: number): boolean; + cup(row?: number, col?: number): boolean; + pos(row?: number, col?: number): boolean; + + eraseInDisplay(param?: string): boolean; + ed(param?: string): boolean; + + clear(): boolean; + + eraseInLine(param?: string): boolean; + el(param?: string): boolean; + + charAttributes(param: string, val?: boolean): boolean; + charAttributes(param: string[], val?: boolean): boolean; + + setForeground(color: string, val?: boolean): boolean; + fg(color: string, val?: boolean): boolean; + + setBackground(color: string, val?: boolean): boolean; + bg(color: string, val?: boolean): boolean; + + deviceStatuses(param?: string, callback?: Function, dec?: boolean, noBypass?: boolean): boolean; + dsr(param?: string, callback?: Function, dec?: boolean, noBypass?: boolean): boolean; + + getCursor(callback: Function): boolean; + saveReportedCursor(callback: Function): void; + + restoreReportedCursor: () => boolean; + + insertChars(param?: number): boolean; + ich(param?: number): boolean; + + cursorNextLine(param?: number): boolean; + cnl(param?: number): boolean; + + cursorPrecedingLine(param?: number): boolean; + cpl(param?: number): boolean; + + cursorCharAbsolute(param?: number): boolean; + cha(param?: number): boolean; + + insertLines(param?: number): boolean; + il(param?: number): boolean; + + deleteLines(param?: number): boolean; + dl(param?: number): boolean; + + deleteChars(param?: number): boolean; + dch(param?: number): boolean; + + eraseChars(param?: number): boolean; + ech(param?: number): boolean; + + charPosAbsolute(param?: number): boolean; + hpa(param?: number): boolean; + + HPositionRelative(param?: number): boolean; + + sendDeviceAttributes(param?: number, callback?: Function): boolean; + da(param?: number, callback?: Function): boolean; + + linePosAbsolute(param?: number): boolean; + vpa(param?: number): boolean; + + VPositionRelative(param?: number): boolean; + vpr(param?: number): boolean; + + HVPosition(row?: number, col?: number): boolean; + hvp(row?: number, col?: number): boolean; + + setMode(...args: string[]): boolean; + sm(...args: string[]): boolean; + + decset(...args: string[]): boolean; + + showCursor(): boolean; + + alternateBuffer(): boolean; + smcup(): boolean; + alternate(): boolean; + + resetMode(...args: string[]): boolean; + rm(...args: string[]): boolean; + + decrst(...args: string[]): boolean; + + hideCursor(): boolean; + civis(): boolean; + vi(): boolean; + cursor_invisible(): boolean; + dectcemh(): boolean; + + normalBuffer(): boolean; + rmcup(): boolean; + + enableMouse(): void; + disableMouse(): void; + + setMouse(opt?: {}, enable?: boolean): void; + + setScrollRegion(top: number, bottom: number): boolean; + csr(top: number, bottom: number): boolean; + decstbm(top: number, bottom: number): boolean; + + saveCursorA(): boolean; + scA(): boolean; + + restoreCursorA(): boolean; + rcA(): boolean; + + cursorForwardTab(param?: number): boolean; + cht(param?: number): boolean; + + scrollUp(param?: number): boolean; + su(param?: number): boolean; + + scrollDown(param?: number): boolean; + sd(param?: number): boolean; + + initMouseTracking(...args: string[]): boolean; + + resetTitleModes(...args: string[]): boolean; + + cursorBackwardTab(param?: number): boolean; + cbt(param?: number): boolean; + + repeatPrecedingCharacter(param?: number): boolean; + rep(param?: number): boolean; + + tabClear(param?: number): boolean; + tbc(param?: number): boolean; + + mediaCopy(...args: string[]): boolean; + mc(...args: string[]): boolean; + + mc0(): boolean; + print_screen(): boolean; + ps(): boolean; + + mc5(): boolean; + prtr_on(): boolean; + po(): boolean; + + mc4(): boolean; + prtr_off(): boolean; + pf(): boolean; + + mc5p(): boolean; + prtr_non(): boolean; + p0(): boolean; + + setResources(...args: string[]): boolean; + + disableModifieres(...args: string[]): boolean; + + setPointerMode(...args: string[]): boolean; + + softReset(): boolean; + rs2(): boolean; + decstr(): boolean; + + requestAnsiMode(param?: number): boolean; + decrqm(param?: number): boolean; + + requestPrivateMode(param?: number): boolean; + decrqmp(param?: number): boolean; + + setConformanceLevel(...args: string[]): boolean; + decscl(...args: string[]): boolean; + + loadLEDs(param?: number): boolean; + decll(param?: number): boolean; + + setCursorStyle(param?: string): boolean; + decscursr(param?: string): boolean; + + setCharProtectionAttr(param?: number): boolean; + decsca(param?: number): boolean; + + restorePrivateValues(...args: string[]): boolean; + + setAttrInRectangle(...args: string[]): boolean; + deccara(...args: string[]): boolean; + + savePrivateValues(...args: string[]): boolean; + + manipulateWindow(...args: any[]): boolean; + + getWindowSize(callback?: Function): boolean; + + reverseAttrInRectangle(...args: string[]): boolean; + decrara(...args: string[]): boolean; + + setTitleModeFeature(...args: string[]): boolean; + + setWarningBellVolume(param?: number): boolean; + decswbv(param?: number): boolean; + + setMarginBellVolume(param?: number): boolean; + + copyRectangle(...args: string[]): boolean; + deccra(...args: string[]): boolean; + + enableFilterRectangle(...args: string[]): boolean; + decefr(...args: string[]): boolean; + + requestParameters(param?: number): boolean; + decreqtparm(param: number): boolean; + + selectChangeExtent(param?: number): boolean; + decsace(param?: number): boolean; + + fillRectangle(...args: string[]): boolean; + decfra(...args: string[]): boolean; + + enableLocatorReporting(...args: string[]): boolean; + decelr(...args: string[]): boolean; + + eraseRectangle(...args: string[]): boolean; + decera(...args: string[]): boolean; + + setLocatorEvents(...args: string[]): boolean; + decsle(...args: string[]): boolean; + + selectiveEraseRectangle(...args: string[]): boolean; + decsera(...args: string[]): boolean; + + requestLocatorPosition(param?: string, callback?: Function): boolean; + reqmp(param?: string, callback?: Function): boolean; + req_mouse_pos(param?: string, callback?: Function): boolean; + decrqlp(param?: string, callback?: Function): boolean; + + insertColumns(...args: string[]): boolean; + decic(...args: string[]): boolean; + + deleteColumns(...args: string[]): boolean; + decdc(...args: string[]): boolean; + + out(param: string, ...args: any[]): boolean; + + sigtstp(callback?: Function): boolean; + + pause(callback?: Function): Function; + + resume: () => void; } export namespace Widgets { @@ -3024,6 +3444,7 @@ export function message(options?: Widgets.MessageOptions): Widgets.MessageElemen export function loading(options?: Widgets.LoadingOptions): Widgets.LoadingElement; export function log(options?: Widgets.LogOptions): Widgets.Log; export function progressbar(options?: Widgets.ProgressBarOptions): Widgets.ProgressBarElement; +export function program(options?: Widgets.IScreenOptions): BlessedProgram; export function terminal(options?: Widgets.TerminalOptions): Widgets.TerminalElement; export function layout(options?: Widgets.LayoutOptions): Widgets.LayoutElement; export function escape(item: any): any; diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index c0e220ce07..c3f0fd9d43 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -44,7 +44,7 @@ * d. target es6, latest "es20xx", e.g. "es2017" */ -import * as Bluebird from "bluebird"; +import Bluebird = require("bluebird"); declare global { /* diff --git a/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts new file mode 100644 index 0000000000..78f92fcf71 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts @@ -0,0 +1,25 @@ +// basic usage +$(document).ready(() => { + $.bootstrapGrowl('Message to show in alert'); +}); + +// with options example +let offsetOptions: BootstrapGrowlIfightcrime.OffsetOption = { + from: 'top', + amount: 20 +}; + +let options: BootstrapGrowlIfightcrime.Options = { + ele: 'body', + type: 'info', + offset: offsetOptions, + align: 'right', + width: 250, + delay: 4000, + allow_dismiss: true, + stackup_spacing: 10 +}; + +$(document).ready(() => { + $.bootstrapGrowl('Alert with options', options); +}); diff --git a/types/bootstrap-growl-ifightcrime/index.d.ts b/types/bootstrap-growl-ifightcrime/index.d.ts new file mode 100644 index 0000000000..45755682ea --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/index.d.ts @@ -0,0 +1,78 @@ +// Type definitions for Bootstrap Growl Ifightcrime 1.1 +// Project: https://github.com/ifightcrime/bootstrap-growl +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace BootstrapGrowlIfightcrime { + type OffsetPositionType = 'top' | 'bottom'; + + type AlertType = 'info' | 'danger' | 'success' | 'warning' | string | null; + + type AlignType = 'left' | 'center' | 'right'; + + interface OffsetOption { + /** + * Position: top or bottom + */ + from?: OffsetPositionType; + + /** + * Offset amount + */ + amount?: number; + } + + interface Options { + /** + * Which element to append to + */ + ele?: string; + + /** + * Values of (null, 'info', 'danger', 'success', 'warning') or another value + */ + type?: AlertType; + + /** + * Offset Options + */ + offset?: OffsetOption; + + /** + * 'left', 'right', or 'center' + */ + align?: AlignType; + + /** + * Integer + */ + width?: number; + + /** + * Time while the message will be displayed. It's not equivalent to the *demo* timeOut! + */ + delay?: number; + + /** + * If true then will display a cross to close the popup. + */ + allow_dismiss?: boolean; + + /** + * Spacing between consecutively stacked growls. + */ + stackup_spacing?: number; + } +} +interface JQueryStatic { + /** + * Show standard Bootstrap alerts into hovering "Growl-like" notifications + * @param message to show. + * @param options should be an options object. + * @returns The element. + */ + bootstrapGrowl: (message: string, options?: BootstrapGrowlIfightcrime.Options) => JQuery; +} diff --git a/types/bootstrap-growl-ifightcrime/tsconfig.json b/types/bootstrap-growl-ifightcrime/tsconfig.json new file mode 100644 index 0000000000..dbeadea241 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bootstrap-growl-ifightcrime-tests.ts" + ] +} \ No newline at end of file diff --git a/types/bootstrap-growl-ifightcrime/tslint.json b/types/bootstrap-growl-ifightcrime/tslint.json new file mode 100644 index 0000000000..4e88071852 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} diff --git a/types/catalog/catalog-tests.tsx b/types/catalog/catalog-tests.tsx new file mode 100644 index 0000000000..c77c0c1667 --- /dev/null +++ b/types/catalog/catalog-tests.tsx @@ -0,0 +1,42 @@ +import * as React from "react"; +import { Config, render, markdown, Catalog, ReactSpecimen, Page } from "catalog"; + +const config: Config = { + title: 'Test', + pages: [ + { + path: '/', + title: 'Introduction', + content: '/patd/to/file.md', + }, + { + path: '/materials', + title: 'Materials', + pages: [ + { + path: '/materials/typeface', + title: 'Typeface', + component: , + }, + ], + }, + ], + useBrowserHistory: true, + basePath: '/doc', + responsiveSizes: [ + { name: 'large', width: 978, height: 1100 }, + { name: 'medium', width: 640, height: 900 }, + { name: 'small', width: 471, height: 700 }, + ], +}; + +render(config, document.body); +; + +markdown` +# Test + +${ +
+} +`; diff --git a/types/catalog/index.d.ts b/types/catalog/index.d.ts new file mode 100644 index 0000000000..515008d7de --- /dev/null +++ b/types/catalog/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for catalog 2.1 +// Project: https://github.com/interactivethings/catalog/ +// Definitions by: Peter Gassner , Tomas Carnecky +// Definitions: https://github.com/interactivethings/catalog/ +// TypeScript Version: 2.3 + +import * as React from "react"; + +// Configuration + +// XXX: Can not name this 'Page' because there's already a 'Page' +// component here. +export interface ConfigPage { + path: string; + title: string; + + content?: any; + component?: any; + pages?: ConfigPage[]; +} + +export interface ConfigResponsiveSize { + name: string; + width: number; + height: number; +} + +export interface Config { + title: string; + pages: ConfigPage[]; + + useBrowserHistory?: boolean; + basePath?: string; + responsiveSizes?: ConfigResponsiveSize[]; +} + +export function render(config: Config, element: HTMLElement): void; +export function configure(config: any): any; +export function configureRoutes(config: any): any; +export function configureJSXRoutes(config: any): any; + +export function pageLoader(f: () => Promise): any; +export function markdown(...x: any[]): JSX.Element; + +// Components +export interface DefaultCatalogProps extends React.Props<{}> { + span?: number; + theme?: any; +} + +export class Card extends React.Component {} +export class Page extends React.Component {} +export interface SpanProps extends DefaultCatalogProps { + style?: any; +} +export class Span extends React.Component {} + +// Specimens +export class AudioSpecimen extends React.Component {} + +export interface CodeSpecimenProps extends DefaultCatalogProps { + rawBody: string; + collapsed: boolean; + lang: string; + raw: boolean; +} +export class CodeSpecimen extends React.Component {} + +export interface ColorSpecimenProps extends DefaultCatalogProps { + value: string; + name: string; +} +export class ColorSpecimen extends React.Component {} + +export interface ColorPaletteSpecimenProps extends DefaultCatalogProps { + colors: Array<{name?: string, value: string}>; + horizontal?: boolean; +} +export class ColorPaletteSpecimen extends React.Component {} + +export class HtmlSpecimen extends React.Component {} +export class HintSpecimen extends React.Component {} +export class ImageSpecimen extends React.Component {} + +export interface TypeSpecimenProps extends DefaultCatalogProps { + color?: string; + font: string; + headings: string[] | number[]; + style?: string; + weight: string; +} +export class TypeSpecimen extends React.Component {} +export class DownloadSpecimen extends React.Component {} + +export interface ReactSpecimenProps extends DefaultCatalogProps { + noSource?: boolean; + plain?: boolean; + light?: boolean; + dark?: boolean; + frame?: boolean; + state?: any; + responsive?: boolean | string | string[]; +} +export class ReactSpecimen extends React.Component {} + +export class VideoSpecimen extends React.Component {} + +export class Catalog extends React.Component {} diff --git a/types/catalog/tsconfig.json b/types/catalog/tsconfig.json new file mode 100644 index 0000000000..95f43ccaf0 --- /dev/null +++ b/types/catalog/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "catalog-tests.tsx" + ] +} diff --git a/types/catalog/tslint.json b/types/catalog/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/catalog/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/cleave.js/index.d.ts b/types/cleave.js/index.d.ts index 27fe7d8c41..eae6bc75b9 100644 --- a/types/cleave.js/index.d.ts +++ b/types/cleave.js/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for cleave.js 1.0 +// Type definitions for cleave.js 1.1 // Project: https://github.com/nosir/cleave.js -// Definitions by: C Lentfort , J Giancono +// Definitions by: C Lentfort , +// J Giancono , +// Alex Shakun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/cleave.js/react/index.d.ts b/types/cleave.js/react/index.d.ts index 6d40ea4ed5..1f50cbdbf3 100644 --- a/types/cleave.js/react/index.d.ts +++ b/types/cleave.js/react/index.d.ts @@ -6,6 +6,7 @@ type InitHandler = (owner: React.ReactInstance) => void; interface Props extends React.InputHTMLAttributes { onInit?: InitHandler; options: CleaveOptions; + htmlRef?: (i: any) => void; } declare var Cleave: React.ComponentClass; diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts new file mode 100644 index 0000000000..24c6783997 --- /dev/null +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -0,0 +1,38 @@ +import * as d3Fetch from 'd3-fetch'; +import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; + +interface MyType { + foo: string; +} + +const url = 'foo.bar'; + +const init: RequestInit = {}; + +let p1: Promise = d3Fetch.blob(url); +p1 = d3Fetch.blob(url, init); +let p2: Promise = d3Fetch.buffer(url); +p2 = d3Fetch.buffer(url, init); +let p3: Promise = d3Fetch.image(url); +p3 = d3Fetch.image(url, init); +let p4: Promise = d3Fetch.json(url); +p4 = d3Fetch.json(url, init); + +let myString: Promise; +myString = d3Fetch.text(url); +myString = d3Fetch.text(url, init); + +const parseRow = (d: {}) => { + const myType: MyType = { foo: 'foo' }; + return myType; +}; +let promise2: Promise>; +promise2 = d3Fetch.csv(url); +promise2 = d3Fetch.csv(url, init); +promise2 = d3Fetch.csv(url, init, parseRow); +promise2 = d3Fetch.dsv(';', url); +promise2 = d3Fetch.dsv(';', url, init); +promise2 = d3Fetch.dsv(';', url, init, parseRow); +promise2 = d3Fetch.tsv(url); +promise2 = d3Fetch.tsv(url, init); +promise2 = d3Fetch.tsv(url, init, parseRow); diff --git a/types/d3-fetch/index.d.ts b/types/d3-fetch/index.d.ts new file mode 100644 index 0000000000..9fd19fe8ed --- /dev/null +++ b/types/d3-fetch/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for d3-fetch 1.0 +// Project: https://d3js.org/d3-fetch/ +// Definitions by: Hugues Stefanski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; + +/** Fetches the binary file at the specified input URL as a Blob. If init is specified, it is passed along to the underlying call to fetch. */ +export function blob(url: string, init?: RequestInit): Promise; +/** Fetches the binary file at the specified input URL as an ArrayBuffer. If init is specified, it is passed along to the underlying call to fetch. */ +export function buffer(url: string, init?: RequestInit): Promise; + +/** Equivalent to d3.dsv with the comma character as the delimiter. */ +export function csv( + url: string, + init?: RequestInit, + row?: (d: DSVRowAny) => ParsedRow +): Promise>; + +/** Fetches the DSV file at the specified input URL. */ +export function dsv( + delimiter: string, + url: string, + init?: RequestInit, + row?: (d: DSVRowAny) => ParsedRow +): Promise>; + +/** Fetches the image at the specified input URL. If init is specified, it is passed along to the underlying call to fetch. */ +export function image(url: string, init?: RequestInit): Promise; + +/** Fetches the json file at the specified input URL. If init is specified, it is passed along to the underlying call to fetch. */ +export function json(url: string, init?: RequestInit): Promise<{}>; + +/** Fetches the text file at the specified input URL. If init is specified, it is passed along to the underlying call to fetch. */ +export function text(url: string, init?: RequestInit): Promise; + +/** Equivalent to d3.dsv with the tab character as the delimiter. */ +export function tsv( + url: string, + init?: RequestInit, + row?: (d: DSVRowAny) => ParsedRow +): Promise>; diff --git a/types/yfiles/tsconfig.json b/types/d3-fetch/tsconfig.json similarity index 87% rename from types/yfiles/tsconfig.json rename to types/d3-fetch/tsconfig.json index 9152563e46..f9b9d190dd 100644 --- a/types/yfiles/tsconfig.json +++ b/types/d3-fetch/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "yfiles-tests.ts" + "d3-fetch-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/d3-fetch/tslint.json b/types/d3-fetch/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/d3-fetch/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/d3-shape/d3-shape-tests.ts b/types/d3-shape/d3-shape-tests.ts index 687da79188..e668d152f8 100644 --- a/types/d3-shape/d3-shape-tests.ts +++ b/types/d3-shape/d3-shape-tests.ts @@ -17,6 +17,7 @@ import { HierarchyPointLink, HierarchyPointNode } from 'd3-hierarchy'; let context: CanvasRenderingContext2D | null = document.querySelector('canvas')!.getContext('2d'); let num: number; +let padAngleMaybe: number | undefined; let pathStringMaybe: string | null; // ----------------------------------------------------------------------------------- @@ -28,7 +29,7 @@ interface ArcDatum { oRadius: number; sAngle: number; eAngle: number; - pAngle: number; + pAngle?: number; } const arcDefaultDatum: d3Shape.DefaultArcObject = { @@ -39,6 +40,13 @@ const arcDefaultDatum: d3Shape.DefaultArcObject = { padAngle: 0.03 }; +const arcReducedDefaultDatum: d3Shape.DefaultArcObject = { + innerRadius: 40, + outerRadius: 60, + startAngle: 0, + endAngle: Math.PI / 2 +}; + const arcDatum: ArcDatum = { iRadius: 40, oRadius: 60, @@ -48,6 +56,7 @@ const arcDatum: ArcDatum = { }; let accessorArcDatumNumber: (this: any, d: ArcDatum, ...args: any[]) => number; +let accessorArcDatumNumberOrUndefined: (this: any, d: ArcDatum, ...args: any[]) => number | undefined; let accessorArcDatumNumberOrNull: ((this: any, d: ArcDatum, ...args: any[]) => number) | null; // DefaultArcObject interface ======================================================== @@ -64,7 +73,7 @@ num = defaultArcObject.innerRadius; num = defaultArcObject.outerRadius; num = defaultArcObject.startAngle; num = defaultArcObject.endAngle; -num = defaultArcObject.padAngle; +padAngleMaybe = defaultArcObject.padAngle; // arc(...) create Arc generator ===================================================== @@ -134,7 +143,7 @@ canvasArc = canvasArc.padAngle(0); svgArc = svgArc.padAngle(d => { return d.pAngle; // datum type is ArcDatum }); -accessorArcDatumNumber = svgArc.padAngle(); +accessorArcDatumNumberOrUndefined = svgArc.padAngle(); // padRadius(...) ---------------------------------------------------------------------- diff --git a/types/d3-shape/index.d.ts b/types/d3-shape/index.d.ts index 27a92a79fe..5408508683 100644 --- a/types/d3-shape/index.d.ts +++ b/types/d3-shape/index.d.ts @@ -32,9 +32,9 @@ export interface DefaultArcObject { */ endAngle: number; /** - * Pad angle of arcin radians. + * Optional. Pad angle of arcin radians. */ - padAngle: number; + padAngle?: number; } /** @@ -230,7 +230,7 @@ export interface Arc { * Returns the current pad angle accessor, which defaults to a function returning the padAngle property * of the first argument passed into it, or false if no data are passed in or the property is not defined. */ - padAngle(): (this: This, d: Datum, ...args: any[]) => number; + padAngle(): (this: This, d: Datum, ...args: any[]) => number | undefined; /** * Sets the pad angle to the specified number and returns this arc generator. * @@ -248,7 +248,7 @@ export interface Arc { * * @param angle Constant angle in radians. */ - padAngle(angle: number): this; + padAngle(angle: number | undefined): this; /** * Sets the pad angle to the specified function and returns this arc generator. * @@ -267,7 +267,7 @@ export interface Arc { * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and * receives the same arguments that were passed into the arc generator. */ - padAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; + padAngle(angle: (this: This, d: Datum, ...args: any[]) => number | undefined): this; /** * Returns the current pad radius accessor, which defaults to null, indicating that the pad radius should be automatically computed as sqrt(innerRadius * innerRadius + outerRadius * outerRadius). diff --git a/types/ed2curve/ed2curve-tests.ts b/types/ed2curve/ed2curve-tests.ts new file mode 100644 index 0000000000..bb26cf5b49 --- /dev/null +++ b/types/ed2curve/ed2curve-tests.ts @@ -0,0 +1,9 @@ +import * as ed2curve from 'ed2curve'; +import * as nacl from 'tweetnacl'; + +const myKeyPair = nacl.sign.keyPair(); + +const newPublicKey = ed2curve.convertPublicKey(myKeyPair.publicKey); +const newSecretKey = ed2curve.convertSecretKey(myKeyPair.secretKey); + +const newKeyPair = ed2curve.convertKeyPair(myKeyPair); diff --git a/types/ed2curve/index.d.ts b/types/ed2curve/index.d.ts new file mode 100644 index 0000000000..6b27ee56e4 --- /dev/null +++ b/types/ed2curve/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for ed2curve 0.2 +// Project: https://github.com/dchest/ed2curve-js +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { BoxKeyPair, SignKeyPair } from "tweetnacl"; + +export as namespace ed2curve; + +/** + * Converts Ed25519 public key to Curve25519 public key. + * montgomeryX = (edwardsY + 1)*inverse(1 - edwardsY) mod p + */ +export function convertPublicKey(publicKey: SignKeyPair["publicKey"]): BoxKeyPair["publicKey"] | null; + +/** Converts Ed25519 secret key to Curve25519 secret key. */ +export function convertSecretKey(secretKey: SignKeyPair["secretKey"]): BoxKeyPair["secretKey"] | null; + +/** Converts Ed25519 key pair to Curve25519 key pair. */ +export function convertKeyPair(keyPair: SignKeyPair): BoxKeyPair; diff --git a/types/ed2curve/package.json b/types/ed2curve/package.json new file mode 100644 index 0000000000..95cfca5ea9 --- /dev/null +++ b/types/ed2curve/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "tweetnacl": "^1.0.0" + } +} diff --git a/types/ed2curve/tsconfig.json b/types/ed2curve/tsconfig.json new file mode 100644 index 0000000000..38f4c49228 --- /dev/null +++ b/types/ed2curve/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ed2curve-tests.ts" + ] +} diff --git a/types/ed2curve/tslint.json b/types/ed2curve/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ed2curve/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/egjs__axes/Axes.d.ts b/types/egjs__axes/Axes.d.ts index 83bd1f24af..2b00624ee2 100644 --- a/types/egjs__axes/Axes.d.ts +++ b/types/egjs__axes/Axes.d.ts @@ -1,4 +1,4 @@ -import * as Component from "@egjs/component"; +import Component = require("@egjs/component"); import { AnimationManager } from "./AnimationManager"; import { EventManager } from "./EventManager"; import { InterruptManager } from "./InterruptManager"; diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 9c9cfc979e..79c80aa29d 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -166,12 +166,7 @@ async () => { }; async () => { - const result = await Facebook.logInWithReadPermissionsAsync('appId'); - - if (result.type === 'success') { - result.expires; - result.token; - } + const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId"); }; () => ( diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index caa1066c39..c3977918ad 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -729,13 +729,11 @@ export namespace Facebook { permissions?: string[]; behavior?: 'web' | 'native' | 'browser' | 'system'; } - type Response = { - type: 'success'; - token: string; - expires: number; - } | { - type: 'cancel'; - }; + interface Response { + type: 'cancel' | 'success'; + token?: string; + expires?: number; + } function logInWithReadPermissionsAsync(appId: string, options?: Options): Promise; } diff --git a/types/expo/v23/expo-tests.tsx b/types/expo/v23/expo-tests.tsx index dd8696d5ba..0764a4d53e 100644 --- a/types/expo/v23/expo-tests.tsx +++ b/types/expo/v23/expo-tests.tsx @@ -159,12 +159,7 @@ async () => { }; async () => { - const result = await Facebook.logInWithReadPermissionsAsync('appId'); - - if (result.type === 'success') { - result.expires; - result.token; - } + const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId"); }; () => ( diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 076cd43f8c..8aaa28bace 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -726,13 +726,11 @@ export namespace Facebook { permissions?: string[]; behavior?: 'web' | 'native' | 'browser' | 'system'; } - type Response = { - type: 'success'; - token: string; - expires: number; - } | { - type: 'cancel'; - }; + interface Response { + type: 'cancel' | 'success'; + token?: string; + expires?: number; + } function logInWithReadPermissionsAsync(appId: string, options?: Options): Promise; } diff --git a/types/express-session/express-session-tests.ts b/types/express-session/express-session-tests.ts index fdb77caedb..6a619f162c 100644 --- a/types/express-session/express-session-tests.ts +++ b/types/express-session/express-session-tests.ts @@ -37,3 +37,34 @@ app.use((req, res, next) => { res.end('welcome to the session demo. refresh!'); } }); + +// Custom Session Store + +class MyStore extends session.Store { + private sessions: { [sid: string]: string }; + + constructor() { + super(); + this.sessions = {}; + } + + get = (sid: string, callback: (err: any, session: Express.SessionData) => void): void => { + callback(null, JSON.parse(this.sessions[sid])); + } + + set = (sid: string, session: Express.Session, callback: (err: any) => void): void => { + this.sessions[sid] = JSON.stringify(session); + callback(null); + } + + destroy = (sid: string, callback: (err: any) => void): void => { + this.sessions[sid] = undefined; + this.sessions = JSON.parse(JSON.stringify(this.sessions)); + callback(null); + } +} + +app.use(session({ + secret: 'keyboard cat', + store: new MyStore() +})); diff --git a/types/express-session/index.d.ts b/types/express-session/index.d.ts index 13ce6ab8b2..6b59efc925 100644 --- a/types/express-session/index.d.ts +++ b/types/express-session/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for express-session 1.15 // Project: https://www.npmjs.org/package/express-session -// Definitions by: Hiroki Horiuchi , Jacob Bogers +// Definitions by: Hiroki Horiuchi , Jacob Bogers , Naoto Yokoyama // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -64,7 +64,7 @@ declare namespace session { } interface BaseMemoryStore { - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; length?: (callback: (err: any, length: number) => void) => void; @@ -78,7 +78,7 @@ declare namespace session { load: (sid: string, fn: (err: any, session: Express.Session) => any) => void; createSession: (req: express.Request, sess: Express.SessionData) => void; - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; all: (callback: (err: any, obj: { [sid: string]: Express.SessionData; }) => void) => void; @@ -87,7 +87,7 @@ declare namespace session { } class MemoryStore implements BaseMemoryStore { - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; all: (callback: (err: any, obj: { [sid: string]: Express.Session; }) => void) => void; diff --git a/types/express/index.d.ts b/types/express/index.d.ts index 18231dcfbc..4e6ed8fcc1 100644 --- a/types/express/index.d.ts +++ b/types/express/index.d.ts @@ -15,7 +15,7 @@ /// import * as bodyParser from "body-parser"; -import * as serveStatic from "serve-static"; +import serveStatic = require("serve-static"); import * as core from "express-serve-static-core"; /** diff --git a/types/flux/lib/FluxReduceStore.d.ts b/types/flux/lib/FluxReduceStore.d.ts index 71a7968812..cda93a54e9 100644 --- a/types/flux/lib/FluxReduceStore.d.ts +++ b/types/flux/lib/FluxReduceStore.d.ts @@ -1,4 +1,4 @@ -import * as Store from "./FluxStore"; +import Store = require("./FluxStore"); declare namespace FluxReduceStore { } diff --git a/types/google-map-react/index.d.ts b/types/google-map-react/index.d.ts index 037ebb5f13..ec2f08d2ab 100644 --- a/types/google-map-react/index.d.ts +++ b/types/google-map-react/index.d.ts @@ -84,6 +84,7 @@ export interface Props { options?: Options | ((maps: Maps) => Options); margin?: any[]; debounced?: boolean; + draggable?: boolean; layerTypes?: string[]; onClick?(value: ClickEventValue): any; onChange?(value: ChangeEventValue): any; diff --git a/types/johnny-five/index.d.ts b/types/johnny-five/index.d.ts index 95a348429d..a1ff5d3f59 100644 --- a/types/johnny-five/index.d.ts +++ b/types/johnny-five/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rwaldron/johnny-five // Definitions by: Toshiya Nakakura // Zoltan Ujvary +// Simon Colmer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -290,30 +291,6 @@ export declare class IMU { } export declare module IR { - export interface MotionOption { - pin: number | string; - } - - export class Motion { - constructor(option: number | MotionOption); - on(event: string, cb: () => void): this; - on(event: "data", cb: (data: any) => void): this; - on(event: "motionstart", cb: () => void): this; - on(event: "motionend", cb: () => void): this; - on(event: "calibrated", cb: () => void): this; - } - - export interface PloximityOption { - pin: number | string; - controller: string; - } - - export class Proximity { - constructor(option: number | PloximityOption); - on(event: string, cb: () => void): this; - on(event: "data", cb: (data: any) => void): this; - on(event: "change", cb: () => void): this; - } export interface ArrayOption { pins: Array | Array; @@ -521,6 +498,19 @@ export declare module Led { } } +export interface MotionOption { + pin: number | string; +} + +export class Motion { + constructor(option: number | MotionOption); + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "motionstart", cb: () => void): this; + on(event: "motionend", cb: () => void): this; + on(event: "calibrated", cb: () => void): this; +} + export interface MotorOption { pins: any; current?: any; @@ -629,6 +619,23 @@ export declare class Ping { constructor(option: number | PingOption); } +export declare interface ProximityOption { + pin: number | string; + controller: string; +} + +export declare interface ProximityData { + cm: number; + in: number; +} + +export declare class Proximity { + constructor(option: number | ProximityOption); + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: ProximityData) => void): this; + on(event: "change", cb: () => void): this; +} + export interface RelayOption { pin: number | string; type?: string; diff --git a/types/johnny-five/johnny-five-tests.ts b/types/johnny-five/johnny-five-tests.ts index 72e7d04b07..b2dd24904e 100644 --- a/types/johnny-five/johnny-five-tests.ts +++ b/types/johnny-five/johnny-five-tests.ts @@ -71,14 +71,14 @@ board.on('ready', function(){ freq: 100 // optional }); - var motion = new five.IR.Motion(7); + var motion = new five.Motion(7); // Options object with pin property - var motion = new five.IR.Motion({ + var motion = new five.Motion({ pin: 7 }); - var proximity = new five.IR.Proximity({ + var proximity = new five.Proximity({ controller: "GP2Y0A21YK", pin: "A0" }); diff --git a/types/jquery-awesome-cursor/index.d.ts b/types/jquery-awesome-cursor/index.d.ts new file mode 100644 index 0000000000..1137b16b75 --- /dev/null +++ b/types/jquery-awesome-cursor/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for jquery-awesome-cursor 0.3 +// Project: https://jwarby.github.io/jquery-awesome-cursor +// Definitions by: Zsolt Kovács +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +declare namespace JQueryAwesomeCursor { + type flip = "horizontal" | "vertical" | "both"; + type cssHandler = (name: string) => void; + + interface Options { + color?: string; + size?: number; + hotspot?: number[] | string; + flip?: flip; + rotate?: number; + outline?: string; + font?: Font; + } + + interface Font { + family: string; + cssClass: string | cssHandler; + } +} + +interface JQueryStatic { + awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery; +} + +interface JQuery { + awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery; +} diff --git a/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts b/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts new file mode 100644 index 0000000000..cd47f56ff9 --- /dev/null +++ b/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts @@ -0,0 +1,64 @@ +// Default +jQuery.awesomeCursor('pencil'); + +// Color +jQuery.awesomeCursor('pencil', { + color: '#ff0000' +}); + +// Size +jQuery.awesomeCursor('pencil', { + size: 32 +}); + +// Hotspot +jQuery.awesomeCursor('pencil', { + hotspot: [0, 17] +}); +jQuery.awesomeCursor('pencil', { + hotspot: 'bottom left' +}); + +// Flip +jQuery.awesomeCursor('pencil', { + flip: 'horizontal' +}); +jQuery.awesomeCursor('pencil', { + flip: 'vertical' +}); +jQuery.awesomeCursor('pencil', { + flip: 'both' +}); + +// Rotate +jQuery.awesomeCursor('pencil', { + rotate: 45 +}); + +// Outline +jQuery.awesomeCursor('pencil', { + outline: 'red' +}); + +// Different font +jQuery.awesomeCursor('brush', { + font: { + family: 'typicons', + cssClass: 'typcn typcn-%s' + } +}); +jQuery.awesomeCursor('brush', { + font: { + family: 'typicons', + cssClass: (name) => { + return 'typcn typcn-' + name; + } + } +}); + +// Mixed +jQuery.awesomeCursor('long-arrow-left', { + color: 'red', + hotspot: 'top left', + rotate: 45, +}); diff --git a/types/jquery-awesome-cursor/tsconfig.json b/types/jquery-awesome-cursor/tsconfig.json new file mode 100644 index 0000000000..cb81088d83 --- /dev/null +++ b/types/jquery-awesome-cursor/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jquery-awesome-cursor-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-awesome-cursor/tslint.json b/types/jquery-awesome-cursor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jquery-awesome-cursor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery-mask-plugin/index.d.ts b/types/jquery-mask-plugin/index.d.ts index a142d0a97e..342045a204 100644 --- a/types/jquery-mask-plugin/index.d.ts +++ b/types/jquery-mask-plugin/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for jQuery Mask Plugin 1.14 // Project: https://igorescobar.github.io/jQuery-Mask-Plugin/ -// Definitions by: Anže Videnič , Igor Escobar +// Definitions by: Anže Videnič +// Igor Escobar +// Anderson Friaça // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -25,6 +27,7 @@ declare namespace jQueryMask { selectOnFocus?: boolean; reverse?: boolean; clearIfNotMatch?: boolean; + placeholder?: string; onComplete?(value: string, e: Event, $element: JQuery, options: Options): void; onKeyPress?(value: string, e: Event, $element: JQuery, options: Options): void; onChange?(value: string, e: Event, $element: JQuery, options: Options): void; diff --git a/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts index 310cec421b..90ac9f7a00 100644 --- a/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts +++ b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts @@ -27,6 +27,9 @@ $(document).ready(() => { placeholder: "__/__/____" } }); + $('.placeholder2').mask("00/00/0000", { + placeholder: "__/__/____" + }); $('.fallback').mask("00r00r0000", { translation: { r: { diff --git a/types/jquery-tags-input/index.d.ts b/types/jquery-tags-input/index.d.ts new file mode 100644 index 0000000000..612d57da52 --- /dev/null +++ b/types/jquery-tags-input/index.d.ts @@ -0,0 +1,112 @@ +// Type definitions for jQuery Tags Input Plugin 1.3 +// Project: https://github.com/xoxco/jQuery-Tags-Input +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace jQueryTagsInput { + interface Options { + /** + * Url for autocomplete + */ + autocomplete_url?: string; + + /** + * Autocomplete options + */ + autocomplete?: object; + + /** + * Height of tag + */ + height?: string; + + /** + * Width of tag + */ + width?: string; + + /** + * Interactive tags + */ + interactive?: boolean; + + /** + * Placeholder of field when tags is empty + */ + defaultText?: string; + + /** + * Callback function on add tag + */ + onAddTag?: (addedValue: string) => void; + + /** + * Callback function on remove tag + */ + onRemoveTag?: (removedValue: string) => void; + + /** + * Callback function on change list of tags + */ + onChange?: (element: JQuery, changedValue: string) => void; + + /** + * Delimiters on tags creation + */ + delimiter?: string[]|string; + + /** + * Remove with tag backspace + */ + removeWithBackspace ?: boolean; + + /** + * Minimun char length for tag + */ + minChars?: number; + + /** + * Max char length for tag + */ + maxChars?: number; + + /** + * Placeholder color of tags + */ + placeholderColor?: string; + } + } + interface JQuery { + /** + * Transform input field to work with tags + * @param options for creation + */ + tagsInput(options?: jQueryTagsInput.Options): JQuery; + + /** + * Add a new tag to list + * @param tag value + */ + addTag(tag: string): boolean; + + /** + * Remove tag with value from list + * @param tag to be removed + */ + removeTag(tag: string): boolean; + + /** + * Add a new tags + * @param tags string separated by delimiter + */ + importTags(tags: string): void; + + /** + * Verify if tag exists + * @param tag value + */ + tagExist(tag: string): boolean; + } diff --git a/types/jquery-tags-input/jquery-tags-input-tests.ts b/types/jquery-tags-input/jquery-tags-input-tests.ts new file mode 100644 index 0000000000..559a47a698 --- /dev/null +++ b/types/jquery-tags-input/jquery-tags-input-tests.ts @@ -0,0 +1,20 @@ +// basic usage +$(document).ready(() => { + $('#inputTag').tagsInput(); + $('#inputTag').addTag('new tag'); + $('#inputTag').tagExist('new tag'); + $('inputTag').removeTag('new tag'); + $('#inputTag').importTags('tag1, tag2, tag3'); + + // with options + const options: jQueryTagsInput.Options = { + height: '100px', + width: '300px', + minChars: 3, + maxChars: 0, + onAddTag: (value: string) => { + alert('Tag added: ' + value); + } + }; + $('#inputTag').tagsInput(options); +}); diff --git a/types/jquery-tags-input/tsconfig.json b/types/jquery-tags-input/tsconfig.json new file mode 100644 index 0000000000..7597172c4a --- /dev/null +++ b/types/jquery-tags-input/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jquery-tags-input-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-tags-input/tslint.json b/types/jquery-tags-input/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-tags-input/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file diff --git a/types/jquery.colorpicker/index.d.ts b/types/jquery.colorpicker/index.d.ts index a2098e1ef9..05ee2cf5d2 100644 --- a/types/jquery.colorpicker/index.d.ts +++ b/types/jquery.colorpicker/index.d.ts @@ -31,6 +31,7 @@ interface JQueryColorpickerOptions { closeOnOutside?: boolean; color?: string; colorFormat?: string; + disabled: boolean; draggable?: boolean; duration?: string; format?: string; @@ -38,7 +39,7 @@ interface JQueryColorpickerOptions { hsv?: boolean; inline?: boolean; inlineFrame?: boolean; - layout?: {[part: string]: number[];}; + layout?: { [part: string]: number[]; }; limit?: string; modal?: boolean; mode?: string; @@ -67,7 +68,7 @@ interface JQueryColorpickerStatic { regional: { [key: string]: string; }; swatches: { [swatch: string]: { [name: string]: JQueryColorpickerStatic.RGB; }; }; writers: { [name: string]: (color: any, that: any) => any; }; - Color: { new (r?: number, g?: number, b?: number, a?: number): JQueryColorpickerStatic.Color; }; + Color: { new(r?: number, g?: number, b?: number, a?: number): JQueryColorpickerStatic.Color; }; } declare namespace JQueryColorpickerStatic { @@ -162,6 +163,6 @@ interface JQuery { colorpicker(method: "open"): JQuery; colorpicker(method: string): JQuery; colorpicker(method: "setColor", color: any): JQuery; - colorpicker(method: string, param: any): JQuery; + colorpicker(method: string, ...params: any[]): JQuery; colorpicker(options?: JQueryColorpickerOptions): JQuery; } diff --git a/types/jquery.colorpicker/jquery.colorpicker-tests.ts b/types/jquery.colorpicker/jquery.colorpicker-tests.ts index 707e2dd7f9..4d2adfb69b 100644 --- a/types/jquery.colorpicker/jquery.colorpicker-tests.ts +++ b/types/jquery.colorpicker/jquery.colorpicker-tests.ts @@ -17,6 +17,7 @@ var colorpicker = $("").colorpicker({ closeOnOutside: true, // Close the dialog when clicking outside the dialog (not for inline) color: '#00FF00', // Initial color (for inline only) colorFormat: 'HEX', // Format string for output color format + disabled: false, draggable: true, // Make popup dialog draggable if header is visible. duration: 'fast', hsv: true, // Show HSV controls and modes @@ -67,6 +68,7 @@ colorpicker.colorpicker("open"); colorpicker.colorpicker("close"); colorpicker.colorpicker("destroy"); colorpicker.colorpicker("setColor", "#deadbeef"); +colorpicker.colorpicker("option", "disabled", true); // example plugins provided @@ -94,23 +96,23 @@ $.colorpicker.parts["memory"] = function (inst) { break; } }).bind('contextmenu', function (e) { - e.preventDefault(); - }); + e.preventDefault(); + }); container.append($node); }, getMemory = function () { return ((document.cookie.match(/\bcolorpicker-memory=([^;]*)/) || [0, ''])[1]).split(','); }, - setMemory = function () { - var colors = []; - $('> *', container).each(function () { - colors.push(encodeURIComponent($(this).css('backgroundColor'))); - }); - var expdate = new Date(); - expdate.setDate(expdate.getDate() + (365 * 10)); - document.cookie = 'colorpicker-memory=' + colors.join() + ";expires=" + expdate.toUTCString(); - }; + setMemory = function () { + var colors = []; + $('> *', container).each(function () { + colors.push(encodeURIComponent($(this).css('backgroundColor'))); + }); + var expdate = new Date(); + expdate.setDate(expdate.getDate() + (365 * 10)); + document.cookie = 'colorpicker-memory=' + colors.join() + ";expires=" + expdate.toUTCString(); + }; this.init = function () { container = $('
') @@ -195,7 +197,7 @@ $.colorpicker.parsers['CMYK'] = function (color) { parseInt(m[2], 10) / 255, parseInt(m[3], 10) / 255, parseInt(m[4], 10) / 255 - ); + ); } }; @@ -206,7 +208,7 @@ $.colorpicker.parsers["#HEX8"] = function (color) { parseInt(m[2], 16) / 255, parseInt(m[3], 16) / 255, parseInt(m[4], 16) / 255 - ).setAlpha(parseInt(m[1], 16) / 255); + ).setAlpha(parseInt(m[1], 16) / 255); } }; diff --git a/types/kafka-node/index.d.ts b/types/kafka-node/index.d.ts index e5aa9cf0a8..71d1fd6728 100644 --- a/types/kafka-node/index.d.ts +++ b/types/kafka-node/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Daniel Imrie-Situnayake , Bill , Michael Haan , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + // # Classes export class Client { constructor(connectionString: string, clientId?: string, options?: ZKOptions, noBatchOptions?: AckBatchOptions, sslOptions?: any); @@ -88,24 +90,24 @@ export class Offset { } export class KeyedMessage { - constructor(key: string, message: string); + constructor(key: string, value: string | Buffer); } // # Interfaces export interface Message { - topic: string; - value: string; - offset?: number; - partition?: number; - highWaterOffset?: number; - key?: string; -} + topic: string; + value: string | Buffer; + offset?: number; + partition?: number; + highWaterOffset?: number; + key?: string; + } export interface ProducerOptions { - requireAcks?: number; - ackTimeoutMs?: number; - partitionerType?: number; + requireAcks?: number; + ackTimeoutMs?: number; + partitionerType?: number; } export interface KafkaClientOptions { diff --git a/types/lodash/array/chunk.d.ts b/types/lodash/array/chunk.d.ts index a1fe16cc02..16e4f8beb9 100644 --- a/types/lodash/array/chunk.d.ts +++ b/types/lodash/array/chunk.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/compact.d.ts b/types/lodash/array/compact.d.ts index 4240c7d329..7bf05df7e3 100644 --- a/types/lodash/array/compact.d.ts +++ b/types/lodash/array/compact.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/concat.d.ts b/types/lodash/array/concat.d.ts index acd381f393..3b1bac32aa 100644 --- a/types/lodash/array/concat.d.ts +++ b/types/lodash/array/concat.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/difference.d.ts b/types/lodash/array/difference.d.ts index 16e2c5317c..5c237eccea 100644 --- a/types/lodash/array/difference.d.ts +++ b/types/lodash/array/difference.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/differenceBy.d.ts b/types/lodash/array/differenceBy.d.ts index ab6fb9d732..da8e928097 100644 --- a/types/lodash/array/differenceBy.d.ts +++ b/types/lodash/array/differenceBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/differenceWith.d.ts b/types/lodash/array/differenceWith.d.ts index 70b3e9bc83..39eca3314f 100644 --- a/types/lodash/array/differenceWith.d.ts +++ b/types/lodash/array/differenceWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/drop.d.ts b/types/lodash/array/drop.d.ts index cff9e9fe2b..6df72adcb6 100644 --- a/types/lodash/array/drop.d.ts +++ b/types/lodash/array/drop.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/dropRight.d.ts b/types/lodash/array/dropRight.d.ts index e2a0b52077..4e08a213b9 100644 --- a/types/lodash/array/dropRight.d.ts +++ b/types/lodash/array/dropRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/dropRightWhile.d.ts b/types/lodash/array/dropRightWhile.d.ts index f565512a2c..efce8161d2 100644 --- a/types/lodash/array/dropRightWhile.d.ts +++ b/types/lodash/array/dropRightWhile.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/dropWhile.d.ts b/types/lodash/array/dropWhile.d.ts index 54324ff8ee..f6f68fb191 100644 --- a/types/lodash/array/dropWhile.d.ts +++ b/types/lodash/array/dropWhile.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/fill.d.ts b/types/lodash/array/fill.d.ts index 7d729dc27a..651a19a830 100644 --- a/types/lodash/array/fill.d.ts +++ b/types/lodash/array/fill.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/findIndex.d.ts b/types/lodash/array/findIndex.d.ts index 5993462151..13f314ee82 100644 --- a/types/lodash/array/findIndex.d.ts +++ b/types/lodash/array/findIndex.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/findLastIndex.d.ts b/types/lodash/array/findLastIndex.d.ts index 46399aab51..db28988a4a 100644 --- a/types/lodash/array/findLastIndex.d.ts +++ b/types/lodash/array/findLastIndex.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/first.d.ts b/types/lodash/array/first.d.ts index 3b17d66ebe..ec88a9b5b2 100644 --- a/types/lodash/array/first.d.ts +++ b/types/lodash/array/first.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { first: typeof _.head; // tslint:disable-line:no-unnecessary-qualifier diff --git a/types/lodash/array/flatten.d.ts b/types/lodash/array/flatten.d.ts index 8d78592bb4..8453624756 100644 --- a/types/lodash/array/flatten.d.ts +++ b/types/lodash/array/flatten.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/flattenDeep.d.ts b/types/lodash/array/flattenDeep.d.ts index 6b676f474f..0c604f2571 100644 --- a/types/lodash/array/flattenDeep.d.ts +++ b/types/lodash/array/flattenDeep.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/flattenDepth.d.ts b/types/lodash/array/flattenDepth.d.ts index 65bd6c161e..0efd206f9e 100644 --- a/types/lodash/array/flattenDepth.d.ts +++ b/types/lodash/array/flattenDepth.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/fromPairs.d.ts b/types/lodash/array/fromPairs.d.ts index bc6264448c..92a8e4d168 100644 --- a/types/lodash/array/fromPairs.d.ts +++ b/types/lodash/array/fromPairs.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/head.d.ts b/types/lodash/array/head.d.ts index cc9a0ec697..476e5b2b07 100644 --- a/types/lodash/array/head.d.ts +++ b/types/lodash/array/head.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/indexOf.d.ts b/types/lodash/array/indexOf.d.ts index d957c852db..f2f01c2e5c 100644 --- a/types/lodash/array/indexOf.d.ts +++ b/types/lodash/array/indexOf.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/initial.d.ts b/types/lodash/array/initial.d.ts index 3e09fbc4d4..fca86bcfa0 100644 --- a/types/lodash/array/initial.d.ts +++ b/types/lodash/array/initial.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/intersection.d.ts b/types/lodash/array/intersection.d.ts index a562d6f306..444e0b23f1 100644 --- a/types/lodash/array/intersection.d.ts +++ b/types/lodash/array/intersection.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/intersectionBy.d.ts b/types/lodash/array/intersectionBy.d.ts index 3572367f4d..4148043afe 100644 --- a/types/lodash/array/intersectionBy.d.ts +++ b/types/lodash/array/intersectionBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/intersectionWith.d.ts b/types/lodash/array/intersectionWith.d.ts index 9214da8652..9fa2198c9b 100644 --- a/types/lodash/array/intersectionWith.d.ts +++ b/types/lodash/array/intersectionWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/join.d.ts b/types/lodash/array/join.d.ts index 01ee4c1e3b..2fd74dab4a 100644 --- a/types/lodash/array/join.d.ts +++ b/types/lodash/array/join.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/last.d.ts b/types/lodash/array/last.d.ts index 5e018dd8d6..4dcdb30423 100644 --- a/types/lodash/array/last.d.ts +++ b/types/lodash/array/last.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/lastIndexOf.d.ts b/types/lodash/array/lastIndexOf.d.ts index bcec4239cd..4bcc38c947 100644 --- a/types/lodash/array/lastIndexOf.d.ts +++ b/types/lodash/array/lastIndexOf.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/nth.d.ts b/types/lodash/array/nth.d.ts index bc6846d047..50e5b209a3 100644 --- a/types/lodash/array/nth.d.ts +++ b/types/lodash/array/nth.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/pull.d.ts b/types/lodash/array/pull.d.ts index 00e4ea87f4..44ebc855c6 100644 --- a/types/lodash/array/pull.d.ts +++ b/types/lodash/array/pull.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/pullAll.d.ts b/types/lodash/array/pullAll.d.ts index 0b01b938e0..ce926b9bb3 100644 --- a/types/lodash/array/pullAll.d.ts +++ b/types/lodash/array/pullAll.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/pullAllBy.d.ts b/types/lodash/array/pullAllBy.d.ts index c9eda04ee6..3524aeae5e 100644 --- a/types/lodash/array/pullAllBy.d.ts +++ b/types/lodash/array/pullAllBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/pullAllWith.d.ts b/types/lodash/array/pullAllWith.d.ts index 931c58363a..345187daad 100644 --- a/types/lodash/array/pullAllWith.d.ts +++ b/types/lodash/array/pullAllWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/pullAt.d.ts b/types/lodash/array/pullAt.d.ts index 27633413e1..a9d56f23ef 100644 --- a/types/lodash/array/pullAt.d.ts +++ b/types/lodash/array/pullAt.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/remove.d.ts b/types/lodash/array/remove.d.ts index 4aa873cb51..3ec0636972 100644 --- a/types/lodash/array/remove.d.ts +++ b/types/lodash/array/remove.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/reverse.d.ts b/types/lodash/array/reverse.d.ts index b5e0e7df2b..0cf2112e24 100644 --- a/types/lodash/array/reverse.d.ts +++ b/types/lodash/array/reverse.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/slice.d.ts b/types/lodash/array/slice.d.ts index 68140b77c2..7744c4b334 100644 --- a/types/lodash/array/slice.d.ts +++ b/types/lodash/array/slice.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/sortedIndex.d.ts b/types/lodash/array/sortedIndex.d.ts index c772692e1c..5f8df282e6 100644 --- a/types/lodash/array/sortedIndex.d.ts +++ b/types/lodash/array/sortedIndex.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/sortedIndexBy.d.ts b/types/lodash/array/sortedIndexBy.d.ts index 216cb9564b..c4184868ca 100644 --- a/types/lodash/array/sortedIndexBy.d.ts +++ b/types/lodash/array/sortedIndexBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/sortedIndexOf.d.ts b/types/lodash/array/sortedIndexOf.d.ts index d0bd2da2f2..b391186178 100644 --- a/types/lodash/array/sortedIndexOf.d.ts +++ b/types/lodash/array/sortedIndexOf.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/sortedLastIndex.d.ts b/types/lodash/array/sortedLastIndex.d.ts index a218e16097..33b466ea5f 100644 --- a/types/lodash/array/sortedLastIndex.d.ts +++ b/types/lodash/array/sortedLastIndex.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/sortedLastIndexBy.d.ts b/types/lodash/array/sortedLastIndexBy.d.ts index 8db2dd2002..c0f8344292 100644 --- a/types/lodash/array/sortedLastIndexBy.d.ts +++ b/types/lodash/array/sortedLastIndexBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/sortedLastIndexOf.d.ts b/types/lodash/array/sortedLastIndexOf.d.ts index 9ae49e52f4..09f8099d1f 100644 --- a/types/lodash/array/sortedLastIndexOf.d.ts +++ b/types/lodash/array/sortedLastIndexOf.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/sortedUniq.d.ts b/types/lodash/array/sortedUniq.d.ts index 5771155512..df0487d626 100644 --- a/types/lodash/array/sortedUniq.d.ts +++ b/types/lodash/array/sortedUniq.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/sortedUniqBy.d.ts b/types/lodash/array/sortedUniqBy.d.ts index 3f25ac1e70..054d4e38c9 100644 --- a/types/lodash/array/sortedUniqBy.d.ts +++ b/types/lodash/array/sortedUniqBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/tail.d.ts b/types/lodash/array/tail.d.ts index 6f0366d4e3..8716c9a2f8 100644 --- a/types/lodash/array/tail.d.ts +++ b/types/lodash/array/tail.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/take.d.ts b/types/lodash/array/take.d.ts index 13f9706a86..a97ff6b4ef 100644 --- a/types/lodash/array/take.d.ts +++ b/types/lodash/array/take.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/takeRight.d.ts b/types/lodash/array/takeRight.d.ts index aa3debabb1..c786ab40c0 100644 --- a/types/lodash/array/takeRight.d.ts +++ b/types/lodash/array/takeRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/takeRightWhile.d.ts b/types/lodash/array/takeRightWhile.d.ts index 6152aeac3f..471c0a03f3 100644 --- a/types/lodash/array/takeRightWhile.d.ts +++ b/types/lodash/array/takeRightWhile.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/takeWhile.d.ts b/types/lodash/array/takeWhile.d.ts index 1988e9e6b9..05e6adc2a4 100644 --- a/types/lodash/array/takeWhile.d.ts +++ b/types/lodash/array/takeWhile.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/union.d.ts b/types/lodash/array/union.d.ts index c4dff47929..f747a97da0 100644 --- a/types/lodash/array/union.d.ts +++ b/types/lodash/array/union.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/unionBy.d.ts b/types/lodash/array/unionBy.d.ts index 62546c75f0..5e5cd40647 100644 --- a/types/lodash/array/unionBy.d.ts +++ b/types/lodash/array/unionBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/unionWith.d.ts b/types/lodash/array/unionWith.d.ts index 55ed7a3630..4778a4a6c7 100644 --- a/types/lodash/array/unionWith.d.ts +++ b/types/lodash/array/unionWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/uniq.d.ts b/types/lodash/array/uniq.d.ts index 57a5226989..5dacb3b37b 100644 --- a/types/lodash/array/uniq.d.ts +++ b/types/lodash/array/uniq.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/uniqBy.d.ts b/types/lodash/array/uniqBy.d.ts index 86fe09323d..13df8cb7db 100644 --- a/types/lodash/array/uniqBy.d.ts +++ b/types/lodash/array/uniqBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/uniqWith.d.ts b/types/lodash/array/uniqWith.d.ts index cbf93a5313..3d4d24334f 100644 --- a/types/lodash/array/uniqWith.d.ts +++ b/types/lodash/array/uniqWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/unzip.d.ts b/types/lodash/array/unzip.d.ts index ec261d4b81..ca96290da5 100644 --- a/types/lodash/array/unzip.d.ts +++ b/types/lodash/array/unzip.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/unzipWith.d.ts b/types/lodash/array/unzipWith.d.ts index 601b58869c..0608c97bd9 100644 --- a/types/lodash/array/unzipWith.d.ts +++ b/types/lodash/array/unzipWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/without.d.ts b/types/lodash/array/without.d.ts index a134f2047b..ced52397ee 100644 --- a/types/lodash/array/without.d.ts +++ b/types/lodash/array/without.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/xor.d.ts b/types/lodash/array/xor.d.ts index 7db9f8aec9..5369888326 100644 --- a/types/lodash/array/xor.d.ts +++ b/types/lodash/array/xor.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/xorBy.d.ts b/types/lodash/array/xorBy.d.ts index b3aa53c3c6..1be5c1284b 100644 --- a/types/lodash/array/xorBy.d.ts +++ b/types/lodash/array/xorBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/xorWith.d.ts b/types/lodash/array/xorWith.d.ts index 811fa0bb69..0963a31da7 100644 --- a/types/lodash/array/xorWith.d.ts +++ b/types/lodash/array/xorWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/zip.d.ts b/types/lodash/array/zip.d.ts index cc8fa0be88..bf4e436dbf 100644 --- a/types/lodash/array/zip.d.ts +++ b/types/lodash/array/zip.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** @@ -8,27 +8,27 @@ declare module "../index" { * @param arrays The arrays to process. * @return Returns the new array of grouped elements. */ - zip(arrays1: List, arrays2: List): Array<[T1, T2]>; + zip(arrays1: List, arrays2: List): Array<[T1 | undefined, T2 | undefined]>; /** * @see _.zip */ - zip(arrays1: List, arrays2: List, arrays3: List): Array<[T1, T2, T3]>; + zip(arrays1: List, arrays2: List, arrays3: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined]>; /** * @see _.zip */ - zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List): Array<[T1, T2, T3, T4]>; + zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>; /** * @see _.zip */ - zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List, arrays5: List): Array<[T1, T2, T3, T4, T5]>; + zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List, arrays5: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>; /** * @see _.zip */ - zip(...arrays: Array | null | undefined>): T[][]; + zip(...arrays: Array | null | undefined>): (T | undefined)[][]; } interface LoDashImplicitWrapper { @@ -38,7 +38,7 @@ declare module "../index" { zip( this: LoDashImplicitWrapper>, arrays2: List, - ): LoDashImplicitWrapper>; + ): LoDashImplicitWrapper>; /** * @see _.zip @@ -47,7 +47,7 @@ declare module "../index" { this: LoDashImplicitWrapper>, arrays2: List, arrays3: List, - ): LoDashImplicitWrapper>; + ): LoDashImplicitWrapper>; /** * @see _.zip @@ -57,7 +57,7 @@ declare module "../index" { arrays2: List, arrays3: List, arrays4: List, - ): LoDashImplicitWrapper>; + ): LoDashImplicitWrapper>; /** * @see _.zip @@ -68,7 +68,7 @@ declare module "../index" { arrays3: List, arrays4: List, arrays5: List, - ): LoDashImplicitWrapper>; + ): LoDashImplicitWrapper>; /** * @see _.zip @@ -76,7 +76,7 @@ declare module "../index" { zip( this: LoDashImplicitWrapper | null | undefined>, ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; + ): LoDashImplicitWrapper>>; } interface LoDashExplicitWrapper { @@ -86,7 +86,7 @@ declare module "../index" { zip( this: LoDashExplicitWrapper>, arrays2: List, - ): LoDashExplicitWrapper>; + ): LoDashExplicitWrapper>; /** * @see _.zip @@ -95,7 +95,7 @@ declare module "../index" { this: LoDashExplicitWrapper>, arrays2: List, arrays3: List, - ): LoDashExplicitWrapper>; + ): LoDashExplicitWrapper>; /** * @see _.zip @@ -105,7 +105,7 @@ declare module "../index" { arrays2: List, arrays3: List, arrays4: List, - ): LoDashExplicitWrapper>; + ): LoDashExplicitWrapper>; /** * @see _.zip @@ -116,7 +116,7 @@ declare module "../index" { arrays3: List, arrays4: List, arrays5: List, - ): LoDashExplicitWrapper>; + ): LoDashExplicitWrapper>; /** * @see _.zip @@ -124,6 +124,6 @@ declare module "../index" { zip( this: LoDashExplicitWrapper | null | undefined>, ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; + ): LoDashExplicitWrapper>>; } -} \ No newline at end of file +} diff --git a/types/lodash/array/zipObject.d.ts b/types/lodash/array/zipObject.d.ts index 5178fe4b56..cf7c35e96a 100644 --- a/types/lodash/array/zipObject.d.ts +++ b/types/lodash/array/zipObject.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/zipObjectDeep.d.ts b/types/lodash/array/zipObjectDeep.d.ts index d4f4ace14a..a91117e705 100644 --- a/types/lodash/array/zipObjectDeep.d.ts +++ b/types/lodash/array/zipObjectDeep.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/array/zipWith.d.ts b/types/lodash/array/zipWith.d.ts index db4d709467..31e080b056 100644 --- a/types/lodash/array/zipWith.d.ts +++ b/types/lodash/array/zipWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/countBy.d.ts b/types/lodash/collection/countBy.d.ts index 05318138f6..7c7ca9e03a 100644 --- a/types/lodash/collection/countBy.d.ts +++ b/types/lodash/collection/countBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/each.d.ts b/types/lodash/collection/each.d.ts index 7455dbbe9b..9777780edc 100644 --- a/types/lodash/collection/each.d.ts +++ b/types/lodash/collection/each.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { each: typeof _.forEach; // tslint:disable-line:no-unnecessary-qualifier diff --git a/types/lodash/collection/eachRight.d.ts b/types/lodash/collection/eachRight.d.ts index cbc847670a..15e3007af5 100644 --- a/types/lodash/collection/eachRight.d.ts +++ b/types/lodash/collection/eachRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { eachRight: typeof _.forEachRight; // tslint:disable-line:no-unnecessary-qualifier diff --git a/types/lodash/collection/every.d.ts b/types/lodash/collection/every.d.ts index fbf6734802..42062a74ad 100644 --- a/types/lodash/collection/every.d.ts +++ b/types/lodash/collection/every.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/filter.d.ts b/types/lodash/collection/filter.d.ts index 58640ecd9e..0f60654127 100644 --- a/types/lodash/collection/filter.d.ts +++ b/types/lodash/collection/filter.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/find.d.ts b/types/lodash/collection/find.d.ts index 612a337355..25bfc77efc 100644 --- a/types/lodash/collection/find.d.ts +++ b/types/lodash/collection/find.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/findLast.d.ts b/types/lodash/collection/findLast.d.ts index c18f28265d..edbcf971e4 100644 --- a/types/lodash/collection/findLast.d.ts +++ b/types/lodash/collection/findLast.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/flatMap.d.ts b/types/lodash/collection/flatMap.d.ts index 453abf37f2..1917e691dc 100644 --- a/types/lodash/collection/flatMap.d.ts +++ b/types/lodash/collection/flatMap.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/flatMapDeep.d.ts b/types/lodash/collection/flatMapDeep.d.ts index 63d1750b0e..02a81ed5ab 100644 --- a/types/lodash/collection/flatMapDeep.d.ts +++ b/types/lodash/collection/flatMapDeep.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/flatMapDepth.d.ts b/types/lodash/collection/flatMapDepth.d.ts index b7b8abba4e..6790a8e0f2 100644 --- a/types/lodash/collection/flatMapDepth.d.ts +++ b/types/lodash/collection/flatMapDepth.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/forEach.d.ts b/types/lodash/collection/forEach.d.ts index 847f95ad58..74c0b38cde 100644 --- a/types/lodash/collection/forEach.d.ts +++ b/types/lodash/collection/forEach.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/forEachRight.d.ts b/types/lodash/collection/forEachRight.d.ts index e6820d743c..dd01aa969a 100644 --- a/types/lodash/collection/forEachRight.d.ts +++ b/types/lodash/collection/forEachRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/groupBy.d.ts b/types/lodash/collection/groupBy.d.ts index 4bd1da4674..714729181b 100644 --- a/types/lodash/collection/groupBy.d.ts +++ b/types/lodash/collection/groupBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/includes.d.ts b/types/lodash/collection/includes.d.ts index 94eae4491a..87eda4e44a 100644 --- a/types/lodash/collection/includes.d.ts +++ b/types/lodash/collection/includes.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/invokeMap.d.ts b/types/lodash/collection/invokeMap.d.ts index d780e5b944..99711b4e5f 100644 --- a/types/lodash/collection/invokeMap.d.ts +++ b/types/lodash/collection/invokeMap.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/keyBy.d.ts b/types/lodash/collection/keyBy.d.ts index 7214537a68..f9ba2e24b5 100644 --- a/types/lodash/collection/keyBy.d.ts +++ b/types/lodash/collection/keyBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/map.d.ts b/types/lodash/collection/map.d.ts index 798cec1dd8..4a90aaf95d 100644 --- a/types/lodash/collection/map.d.ts +++ b/types/lodash/collection/map.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/orderBy.d.ts b/types/lodash/collection/orderBy.d.ts index fea3d82755..a8950959de 100644 --- a/types/lodash/collection/orderBy.d.ts +++ b/types/lodash/collection/orderBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/partition.d.ts b/types/lodash/collection/partition.d.ts index cf9f69d954..f372f0708d 100644 --- a/types/lodash/collection/partition.d.ts +++ b/types/lodash/collection/partition.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/reduce.d.ts b/types/lodash/collection/reduce.d.ts index 31d7661c2e..2346225d60 100644 --- a/types/lodash/collection/reduce.d.ts +++ b/types/lodash/collection/reduce.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/reduceRight.d.ts b/types/lodash/collection/reduceRight.d.ts index fb2b74da16..a183708d45 100644 --- a/types/lodash/collection/reduceRight.d.ts +++ b/types/lodash/collection/reduceRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/reject.d.ts b/types/lodash/collection/reject.d.ts index 4e051b9504..d832f1ba14 100644 --- a/types/lodash/collection/reject.d.ts +++ b/types/lodash/collection/reject.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/sample.d.ts b/types/lodash/collection/sample.d.ts index 48b0aac49b..ccaa4e118b 100644 --- a/types/lodash/collection/sample.d.ts +++ b/types/lodash/collection/sample.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/sampleSize.d.ts b/types/lodash/collection/sampleSize.d.ts index fb9b7fb97a..bf620987d5 100644 --- a/types/lodash/collection/sampleSize.d.ts +++ b/types/lodash/collection/sampleSize.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/shuffle.d.ts b/types/lodash/collection/shuffle.d.ts index 070d2923a6..8209ece654 100644 --- a/types/lodash/collection/shuffle.d.ts +++ b/types/lodash/collection/shuffle.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/size.d.ts b/types/lodash/collection/size.d.ts index 52c78ee3a9..f1c393a7b7 100644 --- a/types/lodash/collection/size.d.ts +++ b/types/lodash/collection/size.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/some.d.ts b/types/lodash/collection/some.d.ts index c7a90b1c9b..fff03751d1 100644 --- a/types/lodash/collection/some.d.ts +++ b/types/lodash/collection/some.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/collection/sortBy.d.ts b/types/lodash/collection/sortBy.d.ts index a192254250..d20877f512 100644 --- a/types/lodash/collection/sortBy.d.ts +++ b/types/lodash/collection/sortBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts index 88a5741ae1..4956ca2ae0 100644 --- a/types/lodash/common/common.d.ts +++ b/types/lodash/common/common.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); type GlobalPartial = Partial; declare module "../index" { type PartialObject = GlobalPartial; diff --git a/types/lodash/date/now.d.ts b/types/lodash/date/now.d.ts index 39a01dd654..480326dd3d 100644 --- a/types/lodash/date/now.d.ts +++ b/types/lodash/date/now.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/after.d.ts b/types/lodash/function/after.d.ts index b86f417556..94b60497e1 100644 --- a/types/lodash/function/after.d.ts +++ b/types/lodash/function/after.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/ary.d.ts b/types/lodash/function/ary.d.ts index de384c8026..94bcc7f25e 100644 --- a/types/lodash/function/ary.d.ts +++ b/types/lodash/function/ary.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/before.d.ts b/types/lodash/function/before.d.ts index 5d67a70be1..2a3b840e8e 100644 --- a/types/lodash/function/before.d.ts +++ b/types/lodash/function/before.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/bind.d.ts b/types/lodash/function/bind.d.ts index 3f708a1f91..28034aec12 100644 --- a/types/lodash/function/bind.d.ts +++ b/types/lodash/function/bind.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface FunctionBind { placeholder: any; diff --git a/types/lodash/function/bindKey.d.ts b/types/lodash/function/bindKey.d.ts index 9e3e547c7f..bab46527c9 100644 --- a/types/lodash/function/bindKey.d.ts +++ b/types/lodash/function/bindKey.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface FunctionBindKey { placeholder: any; diff --git a/types/lodash/function/curry.d.ts b/types/lodash/function/curry.d.ts index 523cdee399..03ff949438 100644 --- a/types/lodash/function/curry.d.ts +++ b/types/lodash/function/curry.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/curryRight.d.ts b/types/lodash/function/curryRight.d.ts index 473a9e039b..044e98d5a2 100644 --- a/types/lodash/function/curryRight.d.ts +++ b/types/lodash/function/curryRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/debounce.d.ts b/types/lodash/function/debounce.d.ts index 286c516ddd..9ff85bd972 100644 --- a/types/lodash/function/debounce.d.ts +++ b/types/lodash/function/debounce.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface DebounceSettings { /** diff --git a/types/lodash/function/defer.d.ts b/types/lodash/function/defer.d.ts index 5bf02bf1b8..1968749ecd 100644 --- a/types/lodash/function/defer.d.ts +++ b/types/lodash/function/defer.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/delay.d.ts b/types/lodash/function/delay.d.ts index 8ccf40d12c..72e2b4151e 100644 --- a/types/lodash/function/delay.d.ts +++ b/types/lodash/function/delay.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** @@ -35,30 +35,4 @@ declare module "../index" { ...args: any[] ): LoDashExplicitWrapper; } - - interface LoDashStatic { - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @category Function - * @param func The function to flip arguments for. - * @returns Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - flip any>(func: T): T; - } - - interface LoDashWrapper { - /** - * @see _.flip - */ - flip(): this; - } -} \ No newline at end of file +} diff --git a/types/lodash/function/flip.d.ts b/types/lodash/function/flip.d.ts index bad49a2022..e2699e3fd7 100644 --- a/types/lodash/function/flip.d.ts +++ b/types/lodash/function/flip.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/memoize.d.ts b/types/lodash/function/memoize.d.ts index eb7be00430..c74cf2a32c 100644 --- a/types/lodash/function/memoize.d.ts +++ b/types/lodash/function/memoize.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface MemoizedFunction { cache: MapCache; diff --git a/types/lodash/function/negate.d.ts b/types/lodash/function/negate.d.ts index b826db7368..c4e3b7bea4 100644 --- a/types/lodash/function/negate.d.ts +++ b/types/lodash/function/negate.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/once.d.ts b/types/lodash/function/once.d.ts index cd1d0e8554..b64562ac16 100644 --- a/types/lodash/function/once.d.ts +++ b/types/lodash/function/once.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/overArgs.d.ts b/types/lodash/function/overArgs.d.ts index 7267540ce4..265f79981b 100644 --- a/types/lodash/function/overArgs.d.ts +++ b/types/lodash/function/overArgs.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/partial.d.ts b/types/lodash/function/partial.d.ts index 047c5ce724..6e729971a6 100644 --- a/types/lodash/function/partial.d.ts +++ b/types/lodash/function/partial.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/partialRight.d.ts b/types/lodash/function/partialRight.d.ts index bacbd88440..24b4c47d20 100644 --- a/types/lodash/function/partialRight.d.ts +++ b/types/lodash/function/partialRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/rearg.d.ts b/types/lodash/function/rearg.d.ts index 829dbebf5e..bff0a45b0c 100644 --- a/types/lodash/function/rearg.d.ts +++ b/types/lodash/function/rearg.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/rest.d.ts b/types/lodash/function/rest.d.ts index d3d7689f63..c05349f0f9 100644 --- a/types/lodash/function/rest.d.ts +++ b/types/lodash/function/rest.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/spread.d.ts b/types/lodash/function/spread.d.ts index 2828089805..29c8b5e8cf 100644 --- a/types/lodash/function/spread.d.ts +++ b/types/lodash/function/spread.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/throttle.d.ts b/types/lodash/function/throttle.d.ts index c2661ec0e3..0b0fc10039 100644 --- a/types/lodash/function/throttle.d.ts +++ b/types/lodash/function/throttle.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface ThrottleSettings { /** diff --git a/types/lodash/function/unary.d.ts b/types/lodash/function/unary.d.ts index 145dbefba2..8714529b10 100644 --- a/types/lodash/function/unary.d.ts +++ b/types/lodash/function/unary.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/function/wrap.d.ts b/types/lodash/function/wrap.d.ts index b5636b1c25..f0bb2693ff 100644 --- a/types/lodash/function/wrap.d.ts +++ b/types/lodash/function/wrap.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/castArray.d.ts b/types/lodash/lang/castArray.d.ts index 8e79155940..5f385c5ed5 100644 --- a/types/lodash/lang/castArray.d.ts +++ b/types/lodash/lang/castArray.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/clone.d.ts b/types/lodash/lang/clone.d.ts index 9bfd32f5c7..794e2383fb 100644 --- a/types/lodash/lang/clone.d.ts +++ b/types/lodash/lang/clone.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/cloneDeep.d.ts b/types/lodash/lang/cloneDeep.d.ts index 9390ece09e..0a49e67ea9 100644 --- a/types/lodash/lang/cloneDeep.d.ts +++ b/types/lodash/lang/cloneDeep.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/cloneDeepWith.d.ts b/types/lodash/lang/cloneDeepWith.d.ts index 1cd2339889..b46fc766ac 100644 --- a/types/lodash/lang/cloneDeepWith.d.ts +++ b/types/lodash/lang/cloneDeepWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type CloneDeepWithCustomizer = (value: any, key: number | string | undefined, object: TObject | undefined, stack: any) => any; diff --git a/types/lodash/lang/cloneWith.d.ts b/types/lodash/lang/cloneWith.d.ts index f091ba7710..22c00be038 100644 --- a/types/lodash/lang/cloneWith.d.ts +++ b/types/lodash/lang/cloneWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type CloneWithCustomizer = (value: TValue, key: number | string | undefined, object: any, stack: any) => TResult; diff --git a/types/lodash/lang/conformsTo.d.ts b/types/lodash/lang/conformsTo.d.ts index 15e11ddf34..f069e15e73 100644 --- a/types/lodash/lang/conformsTo.d.ts +++ b/types/lodash/lang/conformsTo.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { diff --git a/types/lodash/lang/eq.d.ts b/types/lodash/lang/eq.d.ts index f70867eb97..808ec0cf39 100644 --- a/types/lodash/lang/eq.d.ts +++ b/types/lodash/lang/eq.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/gt.d.ts b/types/lodash/lang/gt.d.ts index 0f5e0cf20e..3ae27eaccf 100644 --- a/types/lodash/lang/gt.d.ts +++ b/types/lodash/lang/gt.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/gte.d.ts b/types/lodash/lang/gte.d.ts index 24e9938aa2..b68cc05c7d 100644 --- a/types/lodash/lang/gte.d.ts +++ b/types/lodash/lang/gte.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isArguments.d.ts b/types/lodash/lang/isArguments.d.ts index 3d4be77f98..20c90752bf 100644 --- a/types/lodash/lang/isArguments.d.ts +++ b/types/lodash/lang/isArguments.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isArray.d.ts b/types/lodash/lang/isArray.d.ts index 7949e6adf5..3d0676791c 100644 --- a/types/lodash/lang/isArray.d.ts +++ b/types/lodash/lang/isArray.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isArrayBuffer.d.ts b/types/lodash/lang/isArrayBuffer.d.ts index a7033110c1..b22e954086 100644 --- a/types/lodash/lang/isArrayBuffer.d.ts +++ b/types/lodash/lang/isArrayBuffer.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isArrayLike.d.ts b/types/lodash/lang/isArrayLike.d.ts index 0f3a924b52..59c75a70b7 100644 --- a/types/lodash/lang/isArrayLike.d.ts +++ b/types/lodash/lang/isArrayLike.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isArrayLikeObject.d.ts b/types/lodash/lang/isArrayLikeObject.d.ts index d53566feeb..6613d7d410 100644 --- a/types/lodash/lang/isArrayLikeObject.d.ts +++ b/types/lodash/lang/isArrayLikeObject.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isBoolean.d.ts b/types/lodash/lang/isBoolean.d.ts index db2d2230b7..060d3eae5e 100644 --- a/types/lodash/lang/isBoolean.d.ts +++ b/types/lodash/lang/isBoolean.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isBuffer.d.ts b/types/lodash/lang/isBuffer.d.ts index 79fe9f479d..971cd4cc42 100644 --- a/types/lodash/lang/isBuffer.d.ts +++ b/types/lodash/lang/isBuffer.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isDate.d.ts b/types/lodash/lang/isDate.d.ts index e02811097a..ac6dc058f8 100644 --- a/types/lodash/lang/isDate.d.ts +++ b/types/lodash/lang/isDate.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isElement.d.ts b/types/lodash/lang/isElement.d.ts index 049435dace..9b818bc1cf 100644 --- a/types/lodash/lang/isElement.d.ts +++ b/types/lodash/lang/isElement.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isEmpty.d.ts b/types/lodash/lang/isEmpty.d.ts index e8c44dec8f..b84fd2e125 100644 --- a/types/lodash/lang/isEmpty.d.ts +++ b/types/lodash/lang/isEmpty.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isEqual.d.ts b/types/lodash/lang/isEqual.d.ts index 9741781d08..ae7b0eedd8 100644 --- a/types/lodash/lang/isEqual.d.ts +++ b/types/lodash/lang/isEqual.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isEqualWith.d.ts b/types/lodash/lang/isEqualWith.d.ts index a87919d3c4..44ab134546 100644 --- a/types/lodash/lang/isEqualWith.d.ts +++ b/types/lodash/lang/isEqualWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyName | undefined, parent: any, otherParent: any, stack: any) => boolean|undefined; diff --git a/types/lodash/lang/isError.d.ts b/types/lodash/lang/isError.d.ts index 0b04dc63b7..a5bd5d378b 100644 --- a/types/lodash/lang/isError.d.ts +++ b/types/lodash/lang/isError.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isFinite.d.ts b/types/lodash/lang/isFinite.d.ts index 023eed061e..e5015e8d49 100644 --- a/types/lodash/lang/isFinite.d.ts +++ b/types/lodash/lang/isFinite.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isFunction.d.ts b/types/lodash/lang/isFunction.d.ts index 0b4c539721..7f6ae1feea 100644 --- a/types/lodash/lang/isFunction.d.ts +++ b/types/lodash/lang/isFunction.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isInteger.d.ts b/types/lodash/lang/isInteger.d.ts index 6c1c85a4b5..a1919bf21d 100644 --- a/types/lodash/lang/isInteger.d.ts +++ b/types/lodash/lang/isInteger.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isLength.d.ts b/types/lodash/lang/isLength.d.ts index 2045c8642b..b8c012460e 100644 --- a/types/lodash/lang/isLength.d.ts +++ b/types/lodash/lang/isLength.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isMap.d.ts b/types/lodash/lang/isMap.d.ts index 7ff700592f..b71a3d750f 100644 --- a/types/lodash/lang/isMap.d.ts +++ b/types/lodash/lang/isMap.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isMatch.d.ts b/types/lodash/lang/isMatch.d.ts index 4ec05e5651..dfb072c59b 100644 --- a/types/lodash/lang/isMatch.d.ts +++ b/types/lodash/lang/isMatch.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type isMatchCustomizer = (value: any, other: any, indexOrKey?: PropertyName) => boolean; diff --git a/types/lodash/lang/isMatchWith.d.ts b/types/lodash/lang/isMatchWith.d.ts index 8ed28e0ca9..fb47f327b4 100644 --- a/types/lodash/lang/isMatchWith.d.ts +++ b/types/lodash/lang/isMatchWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type isMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyName) => boolean; diff --git a/types/lodash/lang/isNaN.d.ts b/types/lodash/lang/isNaN.d.ts index cfc6466d89..b016c91c74 100644 --- a/types/lodash/lang/isNaN.d.ts +++ b/types/lodash/lang/isNaN.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isNative.d.ts b/types/lodash/lang/isNative.d.ts index 8cc7682e08..72f74e7148 100644 --- a/types/lodash/lang/isNative.d.ts +++ b/types/lodash/lang/isNative.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isNil.d.ts b/types/lodash/lang/isNil.d.ts index 19f0d0510d..2b0cb04fbc 100644 --- a/types/lodash/lang/isNil.d.ts +++ b/types/lodash/lang/isNil.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isNull.d.ts b/types/lodash/lang/isNull.d.ts index d75bc31dbe..04dfb18cea 100644 --- a/types/lodash/lang/isNull.d.ts +++ b/types/lodash/lang/isNull.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isNumber.d.ts b/types/lodash/lang/isNumber.d.ts index b149f779e9..81479cb4c9 100644 --- a/types/lodash/lang/isNumber.d.ts +++ b/types/lodash/lang/isNumber.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isObject.d.ts b/types/lodash/lang/isObject.d.ts index 760d08bcf5..e014fd9620 100644 --- a/types/lodash/lang/isObject.d.ts +++ b/types/lodash/lang/isObject.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isObjectLike.d.ts b/types/lodash/lang/isObjectLike.d.ts index 1f59f71035..1665ec8a69 100644 --- a/types/lodash/lang/isObjectLike.d.ts +++ b/types/lodash/lang/isObjectLike.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isPlainObject.d.ts b/types/lodash/lang/isPlainObject.d.ts index 48031c8aeb..bb5070f535 100644 --- a/types/lodash/lang/isPlainObject.d.ts +++ b/types/lodash/lang/isPlainObject.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isRegExp.d.ts b/types/lodash/lang/isRegExp.d.ts index 5d63d6bed1..4199940091 100644 --- a/types/lodash/lang/isRegExp.d.ts +++ b/types/lodash/lang/isRegExp.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isSafeInteger.d.ts b/types/lodash/lang/isSafeInteger.d.ts index c1ba912c76..0ca1b4809a 100644 --- a/types/lodash/lang/isSafeInteger.d.ts +++ b/types/lodash/lang/isSafeInteger.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isSet.d.ts b/types/lodash/lang/isSet.d.ts index 173f8aa8b8..af7f4ad9e9 100644 --- a/types/lodash/lang/isSet.d.ts +++ b/types/lodash/lang/isSet.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isString.d.ts b/types/lodash/lang/isString.d.ts index 739f8730a8..d39917345e 100644 --- a/types/lodash/lang/isString.d.ts +++ b/types/lodash/lang/isString.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isSymbol.d.ts b/types/lodash/lang/isSymbol.d.ts index 7831c3d4b2..2f0a6aa4f5 100644 --- a/types/lodash/lang/isSymbol.d.ts +++ b/types/lodash/lang/isSymbol.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isTypedArray.d.ts b/types/lodash/lang/isTypedArray.d.ts index fc55e1b06a..dffc9e43d0 100644 --- a/types/lodash/lang/isTypedArray.d.ts +++ b/types/lodash/lang/isTypedArray.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isUndefined.d.ts b/types/lodash/lang/isUndefined.d.ts index 1803b36c29..dad9ed7cc3 100644 --- a/types/lodash/lang/isUndefined.d.ts +++ b/types/lodash/lang/isUndefined.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isWeakMap.d.ts b/types/lodash/lang/isWeakMap.d.ts index 36251720a9..8dae9d20f5 100644 --- a/types/lodash/lang/isWeakMap.d.ts +++ b/types/lodash/lang/isWeakMap.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/isWeakSet.d.ts b/types/lodash/lang/isWeakSet.d.ts index ce523a098d..2c08c521aa 100644 --- a/types/lodash/lang/isWeakSet.d.ts +++ b/types/lodash/lang/isWeakSet.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/lt.d.ts b/types/lodash/lang/lt.d.ts index ff991eb9a7..434b1476d0 100644 --- a/types/lodash/lang/lt.d.ts +++ b/types/lodash/lang/lt.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/lte.d.ts b/types/lodash/lang/lte.d.ts index 21a1710da3..84cc6b22fe 100644 --- a/types/lodash/lang/lte.d.ts +++ b/types/lodash/lang/lte.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/toArray.d.ts b/types/lodash/lang/toArray.d.ts index be11eecb6d..d0fd0b93f2 100644 --- a/types/lodash/lang/toArray.d.ts +++ b/types/lodash/lang/toArray.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/toFinite.d.ts b/types/lodash/lang/toFinite.d.ts index 53a913e212..3007bf3674 100644 --- a/types/lodash/lang/toFinite.d.ts +++ b/types/lodash/lang/toFinite.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/toInteger.d.ts b/types/lodash/lang/toInteger.d.ts index 2fe3f91f5d..2f4c2f217c 100644 --- a/types/lodash/lang/toInteger.d.ts +++ b/types/lodash/lang/toInteger.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/toLength.d.ts b/types/lodash/lang/toLength.d.ts index 4b3629eccd..62e9b059fe 100644 --- a/types/lodash/lang/toLength.d.ts +++ b/types/lodash/lang/toLength.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/toNumber.d.ts b/types/lodash/lang/toNumber.d.ts index 5632b018f1..5099f7ad89 100644 --- a/types/lodash/lang/toNumber.d.ts +++ b/types/lodash/lang/toNumber.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/toPlainObject.d.ts b/types/lodash/lang/toPlainObject.d.ts index 74ede5011d..60b9c1a7b1 100644 --- a/types/lodash/lang/toPlainObject.d.ts +++ b/types/lodash/lang/toPlainObject.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/toSafeInteger.d.ts b/types/lodash/lang/toSafeInteger.d.ts index 774492cbe0..a4e1729dbb 100644 --- a/types/lodash/lang/toSafeInteger.d.ts +++ b/types/lodash/lang/toSafeInteger.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lang/toString.d.ts b/types/lodash/lang/toString.d.ts index 2a0de1e865..559f05f66f 100644 --- a/types/lodash/lang/toString.d.ts +++ b/types/lodash/lang/toString.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 9baaa64815..c30a3276f7 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -20,9 +20,9 @@ const stoogesAges: StoogesAge[] = [ let result: any; -let any: any; +let anything: any; -interface TResult { +interface AbcObject { a: number; b: string; c: boolean; @@ -70,13 +70,13 @@ namespace TestWrapper { } { - let a: TResult[] = []; - _(a); // $ExpectType LoDashImplicitWrapper + let a: AbcObject[] = []; + _(a); // $ExpectType LoDashImplicitWrapper } { - let a: TResult[] | null | undefined = any; - _(a); // $ExpectType LoDashImplicitWrapper + let a: AbcObject[] | null | undefined = anything; + _(a); // $ExpectType LoDashImplicitWrapper } } @@ -103,81 +103,81 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[][]; + let result: AbcObject[][]; - result = _.chunk(array); - result = _.chunk(array, 42); + result = _.chunk(array); + result = _.chunk(array, 42); - result = _.chunk(list); - result = _.chunk(list, 42); + result = _.chunk(list); + result = _.chunk(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).chunk(); result = _(array).chunk(42); - result = _(list).chunk(); - result = _(list).chunk(42); + result = _(list).chunk(); + result = _(list).chunk(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _.chain(array).chunk(); result = _(array).chain().chunk(); result = _(array).chain().chunk(42); - result = _(list).chain().chunk(); - result = _(list).chain().chunk(42); + result = _(list).chain().chunk(); + result = _(list).chain().chunk(42); } } // _.compact namespace TestCompact { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let array2: Array | null | undefined = any; - let list2: _.List | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let array2: Array | null | undefined = anything; + let list2: _.List | null | undefined = anything; { - let result: TResult[]; + let result: AbcObject[]; - result = _.compact(array); - result = _.compact(list); + result = _.compact(array); + result = _.compact(list); result = _.compact(array2); result = _.compact(list2); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).compact(); - result = _(list).compact(); + result = _(list).compact(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().compact(); - result = _(list).chain().compact(); + result = _(list).chain().compact(); } } // _.difference namespace TestDifference { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; { - let result: TResult[]; + let result: AbcObject[]; result = _.difference(array); result = _.difference(array, arrayParam); @@ -191,222 +191,222 @@ namespace TestDifference { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).difference(); result = _(array).difference(arrayParam); result = _(array).difference(listParam, arrayParam); result = _(array).difference(arrayParam, listParam, arrayParam); - result = _(list).difference(); - result = _(list).difference(listParam); - result = _(list).difference(arrayParam, listParam); - result = _(list).difference(listParam, arrayParam, listParam); + result = _(list).difference(); + result = _(list).difference(listParam); + result = _(list).difference(arrayParam, listParam); + result = _(list).difference(listParam, arrayParam, listParam); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().difference(); result = _(array).chain().difference(arrayParam); result = _(array).chain().difference(listParam, arrayParam); result = _(array).chain().difference(arrayParam, listParam, arrayParam); - result = _(list).chain().difference(); - result = _(list).chain().difference(listParam); - result = _(list).chain().difference(arrayParam, listParam); - result = _(list).chain().difference(listParam, arrayParam, listParam); + result = _(list).chain().difference(); + result = _(list).chain().difference(listParam); + result = _(list).chain().difference(arrayParam, listParam); + result = _(list).chain().difference(listParam, arrayParam, listParam); } } // _.differenceBy namespace TestDifferenceBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; - let iteratee: (value: TResult) => any = (value: TResult) => 1; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; + let iteratee: (value: AbcObject) => any = (value: AbcObject) => 1; { - let result: TResult[]; + let result: AbcObject[]; result = _.differenceBy(array); - result = _.differenceBy(array, arrayParam); - result = _.differenceBy(array, listParam, arrayParam); - result = _.differenceBy(array, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, arrayParam); + result = _.differenceBy(array, listParam, arrayParam); + result = _.differenceBy(array, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _.differenceBy(array, arrayParam, iteratee); result = _.differenceBy(array, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, 'a'); result = _.differenceBy(array, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, {a: 1}); result = _.differenceBy(array, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(list); - result = _.differenceBy(list, listParam); - result = _.differenceBy(list, arrayParam, listParam); - result = _.differenceBy(list, listParam, arrayParam, listParam); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam); - result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, listParam); + result = _.differenceBy(list, arrayParam, listParam); + result = _.differenceBy(list, listParam, arrayParam, listParam); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _.differenceBy(list, listParam, iteratee); result = _.differenceBy(list, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, 'a'); result = _.differenceBy(list, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, {a: 1}); result = _.differenceBy(list, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, listParam, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { - let result: _.LoDashImplicitWrapper; + let result: _.LoDashImplicitWrapper; - result = _(array).differenceBy(arrayParam); - result = _(array).differenceBy(listParam, arrayParam); - result = _(array).differenceBy(arrayParam, listParam, arrayParam); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam); - result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(arrayParam); + result = _(array).differenceBy(listParam, arrayParam); + result = _(array).differenceBy(arrayParam, listParam, arrayParam); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _(array).differenceBy(arrayParam, iteratee); result = _(array).differenceBy(listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, 'a'); result = _(array).differenceBy(listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, {a: 1}); result = _(array).differenceBy(listParam, arrayParam, {a: 1}); result = _(array).differenceBy(arrayParam, listParam, arrayParam, {a: 1}); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(list).differenceBy(listParam); - result = _(list).differenceBy(arrayParam, listParam); - result = _(list).differenceBy(listParam, arrayParam, listParam); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam); - result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(listParam); + result = _(list).differenceBy(arrayParam, listParam); + result = _(list).differenceBy(listParam, arrayParam, listParam); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _(list).differenceBy(listParam, iteratee); result = _(list).differenceBy(arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, 'a'); result = _(list).differenceBy(arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, {a: 1}); result = _(list).differenceBy(arrayParam, listParam, {a: 1}); result = _(list).differenceBy(listParam, arrayParam, listParam, {a: 1}); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; - result = _(array).chain().differenceBy(arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam); - result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _(array).chain().differenceBy(arrayParam, iteratee); result = _(array).chain().differenceBy(listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, 'a'); result = _(array).chain().differenceBy(listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, {a: 1}); result = _(array).chain().differenceBy(listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(list).chain().differenceBy(listParam); - result = _(list).chain().differenceBy(arrayParam, listParam); - result = _(list).chain().differenceBy(listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(listParam); + result = _(list).chain().differenceBy(arrayParam, listParam); + result = _(list).chain().differenceBy(listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _(list).chain().differenceBy(listParam, iteratee); result = _(list).chain().differenceBy(arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, 'a'); result = _(list).chain().differenceBy(arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, {a: 1}); result = _(list).chain().differenceBy(arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { @@ -550,63 +550,63 @@ namespace TestDifferenceBy { // _.differenceWith { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; - let comparator = (a: TResult, b: TResult) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; + let comparator = (a: AbcObject, b: AbcObject) => true; { - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, arrayParam, comparator); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, comparator); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } { - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam, listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam, comparator); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, comparator); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } { - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam, listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam, comparator); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, comparator); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } @@ -621,7 +621,7 @@ namespace TestDifferenceBy { } const t1: T1 = { a: 'a', b: 'b' }; - const t2: T2 | undefined = any; + const t2: T2 | undefined = anything; // $ExpectType T1[] _.differenceWith([t1], [t2], (a, b) => { @@ -648,169 +648,169 @@ namespace TestDifferenceBy { // _.drop { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; - result = _.drop(array); - result = _.drop(array, 42); + let result: AbcObject[]; + result = _.drop(array); + result = _.drop(array, 42); - result = _.drop(list); - result = _.drop(list, 42); + result = _.drop(list); + result = _.drop(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).drop(); result = _(array).drop(42); - result = _(list).drop(); - result = _(list).drop(42); + result = _(list).drop(); + result = _(list).drop(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().drop(); result = _(array).chain().drop(42); - result = _(list).chain().drop(); - result = _(list).chain().drop(42); + result = _(list).chain().drop(); + result = _(list).chain().drop(42); } } // _.dropRight namespace TestDropRight { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropRight(array); - result = _.dropRight(array, 42); + result = _.dropRight(array); + result = _.dropRight(array, 42); - result = _.dropRight(list); - result = _.dropRight(list, 42); + result = _.dropRight(list); + result = _.dropRight(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropRight(); result = _(array).dropRight(42); - result = _(list).dropRight(); - result = _(list).dropRight(42); + result = _(list).dropRight(); + result = _(list).dropRight(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropRight(); result = _(array).chain().dropRight(42); - result = _(list).chain().dropRight(); - result = _(list).chain().dropRight(42); + result = _(list).chain().dropRight(); + result = _(list).chain().dropRight(42); } } // _.dropRightWhile namespace TestDropRightWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropRightWhile(array); - result = _.dropRightWhile(array, predicateFn); - result = _.dropRightWhile(array, ''); + result = _.dropRightWhile(array); + result = _.dropRightWhile(array, predicateFn); + result = _.dropRightWhile(array, ''); result = _.dropRightWhile(array, {a: 42}); - result = _.dropRightWhile(list); - result = _.dropRightWhile(list, predicateFn); - result = _.dropRightWhile(list, ''); + result = _.dropRightWhile(list); + result = _.dropRightWhile(list, predicateFn); + result = _.dropRightWhile(list, ''); result = _.dropRightWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropRightWhile(); result = _(array).dropRightWhile(predicateFn); result = _(array).dropRightWhile(''); result = _(array).dropRightWhile({a: 42}); - result = _(list).dropRightWhile(); - result = _(list).dropRightWhile(predicateFn); - result = _(list).dropRightWhile(''); + result = _(list).dropRightWhile(); + result = _(list).dropRightWhile(predicateFn); + result = _(list).dropRightWhile(''); result = _(list).dropRightWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropRightWhile(); result = _(array).chain().dropRightWhile(predicateFn); result = _(array).chain().dropRightWhile(''); result = _(array).chain().dropRightWhile({a: 42}); - result = _(list).chain().dropRightWhile(); - result = _(list).chain().dropRightWhile(predicateFn); - result = _(list).chain().dropRightWhile(''); + result = _(list).chain().dropRightWhile(); + result = _(list).chain().dropRightWhile(predicateFn); + result = _(list).chain().dropRightWhile(''); result = _(list).chain().dropRightWhile({a: 42}); } } // _.dropWhile namespace TestDropWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropWhile(array); - result = _.dropWhile(array, predicateFn); - result = _.dropWhile(array, ''); + result = _.dropWhile(array); + result = _.dropWhile(array, predicateFn); + result = _.dropWhile(array, ''); result = _.dropWhile(array, {a: 42}); - result = _.dropWhile(list); - result = _.dropWhile(list, predicateFn); - result = _.dropWhile(list, ''); + result = _.dropWhile(list); + result = _.dropWhile(list, predicateFn); + result = _.dropWhile(list, ''); result = _.dropWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropWhile(); result = _(array).dropWhile(predicateFn); result = _(array).dropWhile(''); result = _(array).dropWhile({a: 42}); - result = _(list).dropWhile(); - result = _(list).dropWhile(predicateFn); - result = _(list).dropWhile(''); + result = _(list).dropWhile(); + result = _(list).dropWhile(predicateFn); + result = _(list).dropWhile(''); result = _(list).dropWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropWhile(); result = _(array).chain().dropWhile(predicateFn); result = _(array).chain().dropWhile(''); result = _(array).chain().dropWhile({a: 42}); - result = _(list).chain().dropWhile(); - result = _(list).chain().dropWhile(predicateFn); - result = _(list).chain().dropWhile(''); + result = _(list).chain().dropWhile(); + result = _(list).chain().dropWhile(predicateFn); + result = _(list).chain().dropWhile(''); result = _(list).chain().dropWhile({a: 42}); } } @@ -871,25 +871,25 @@ namespace TestFill { // _.findIndex namespace TestFindIndex { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; let fromIndex = 0; { let result: number; - result = _.findIndex(array); - result = _.findIndex(array, predicateFn); - result = _.findIndex(array, ''); + result = _.findIndex(array); + result = _.findIndex(array, predicateFn); + result = _.findIndex(array, ''); result = _.findIndex(array, {a: 42}); - result = _.findIndex(array, predicateFn, fromIndex); + result = _.findIndex(array, predicateFn, fromIndex); - result = _.findIndex(list); - result = _.findIndex(list, predicateFn); - result = _.findIndex(list, ''); + result = _.findIndex(list); + result = _.findIndex(list, predicateFn); + result = _.findIndex(list, ''); result = _.findIndex(list, {a: 42}); - result = _.findIndex(list, predicateFn, fromIndex); + result = _.findIndex(list, predicateFn, fromIndex); result = _.findIndex([{ b: 5 }], ['b', 5]); result = _(array).findIndex(); @@ -899,10 +899,10 @@ namespace TestFindIndex { result = _(array).findIndex(predicateFn, fromIndex); result = _(list).findIndex(); - result = _(list).findIndex(predicateFn); + result = _(list).findIndex(predicateFn); result = _(list).findIndex(''); result = _(list).findIndex<{a: number}>({a: 42}); - result = _(list).findIndex(predicateFn, fromIndex); + result = _(list).findIndex(predicateFn, fromIndex); } { @@ -915,35 +915,35 @@ namespace TestFindIndex { result = _(array).chain().findIndex(predicateFn, fromIndex); result = _(list).chain().findIndex(); - result = _(list).chain().findIndex(predicateFn); + result = _(list).chain().findIndex(predicateFn); result = _(list).chain().findIndex(''); result = _(list).chain().findIndex<{a: number}>({a: 42}); - result = _(list).chain().findIndex(predicateFn, fromIndex); + result = _(list).chain().findIndex(predicateFn, fromIndex); } } // _.findLastIndex namespace TestFindLastIndex { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; let fromIndex = 0; { let result: number; - result = _.findLastIndex(array); - result = _.findLastIndex(array, predicateFn); - result = _.findLastIndex(array, ''); + result = _.findLastIndex(array); + result = _.findLastIndex(array, predicateFn); + result = _.findLastIndex(array, ''); result = _.findLastIndex(array, {a: 42}); - result = _.findLastIndex(array, predicateFn, fromIndex); + result = _.findLastIndex(array, predicateFn, fromIndex); - result = _.findLastIndex(list); - result = _.findLastIndex(list, predicateFn); - result = _.findLastIndex(list, ''); + result = _.findLastIndex(list); + result = _.findLastIndex(list, predicateFn); + result = _.findLastIndex(list, ''); result = _.findLastIndex(list, {a: 42}); - result = _.findLastIndex(list, predicateFn, fromIndex); + result = _.findLastIndex(list, predicateFn, fromIndex); result = _.findLastIndex([{ b: 5 }], ['b', 5]); result = _(array).findLastIndex(); @@ -953,10 +953,10 @@ namespace TestFindLastIndex { result = _(array).findLastIndex(predicateFn, fromIndex); result = _(list).findLastIndex(); - result = _(list).findLastIndex(predicateFn); + result = _(list).findLastIndex(predicateFn); result = _(list).findLastIndex(''); result = _(list).findLastIndex<{a: number}>({a: 42}); - result = _(list).findLastIndex(predicateFn, fromIndex); + result = _(list).findLastIndex(predicateFn, fromIndex); } { @@ -969,17 +969,17 @@ namespace TestFindLastIndex { result = _(array).chain().findLastIndex(predicateFn, fromIndex); result = _(list).chain().findLastIndex(); - result = _(list).chain().findLastIndex(predicateFn); + result = _(list).chain().findLastIndex(predicateFn); result = _(list).chain().findLastIndex(''); result = _(list).chain().findLastIndex<{a: number}>({a: 42}); - result = _(list).chain().findLastIndex(predicateFn, fromIndex); + result = _(list).chain().findLastIndex(predicateFn, fromIndex); } } // _.first namespace TestFirst { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -989,13 +989,13 @@ namespace TestFirst { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.first(array); - result = _.first(list); + result = _.first(array); + result = _.first(list); result = _(array).first(); - result = _(list).first(); + result = _(list).first(); } { @@ -1005,7 +1005,7 @@ namespace TestFirst { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().first(); result = _(list).chain().first(); @@ -1227,8 +1227,8 @@ namespace TestFromPairs { // _.head namespace TestHead { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -1238,13 +1238,13 @@ namespace TestHead { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.head(array); - result = _.head(list); + result = _.head(array); + result = _.head(list); result = _(array).head(); - result = _(list).head(); + result = _(list).head(); } { @@ -1254,7 +1254,7 @@ namespace TestHead { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().head(); result = _(list).chain().head(); @@ -1263,28 +1263,28 @@ namespace TestHead { // _.indexOf namespace TestIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.indexOf(array, value); - result = _.indexOf(array, value, true); - result = _.indexOf(array, value, 42); + result = _.indexOf(array, value); + result = _.indexOf(array, value, true); + result = _.indexOf(array, value, 42); - result = _.indexOf(list, value); - result = _.indexOf(list, value, true); - result = _.indexOf(list, value, 42); + result = _.indexOf(list, value); + result = _.indexOf(list, value, true); + result = _.indexOf(list, value, 42); result = _(array).indexOf(value); result = _(array).indexOf(value, true); result = _(array).indexOf(value, 42); - result = _(list).indexOf(value); - result = _(list).indexOf(value, true); - result = _(list).indexOf(value, 42); + result = _(list).indexOf(value); + result = _(list).indexOf(value, true); + result = _(list).indexOf(value, 42); } { @@ -1294,170 +1294,170 @@ namespace TestIndexOf { result = _(array).chain().indexOf(value, true); result = _(array).chain().indexOf(value, 42); - result = _(list).chain().indexOf(value); - result = _(list).chain().indexOf(value, true); - result = _(list).chain().indexOf(value, 42); + result = _(list).chain().indexOf(value); + result = _(list).chain().indexOf(value, true); + result = _(list).chain().indexOf(value, 42); } } // _.sortedIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.sortedIndexOf(array, value); - result = _.sortedIndexOf(list, value); + result = _.sortedIndexOf(array, value); + result = _.sortedIndexOf(list, value); result = _(array).sortedIndexOf(value); - result = _(list).sortedIndexOf(value); + result = _(list).sortedIndexOf(value); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().sortedIndexOf(value); - result = _(list).chain().sortedIndexOf(value); + result = _(list).chain().sortedIndexOf(value); } } //_.initial namespace TestInitial { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.initial(array); - result = _.initial(list); + result = _.initial(array); + result = _.initial(list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).initial(); - result = _(list).initial(); + result = _(list).initial(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().initial(); - result = _(list).chain().initial(); + result = _(list).chain().initial(); } } // _.intersection namespace TestIntersection { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.intersection(array, list); - result = _.intersection(list, array, list); + result = _.intersection(array, list); + result = _.intersection(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(array).intersection(arrayParam); - result = _(array).intersection(listParam, arrayParam); + result = _(array).intersection(arrayParam); + result = _(array).intersection(listParam, arrayParam); - result = _(list).intersection(arrayParam); - result = _(list).intersection(listParam, arrayParam); + result = _(list).intersection(arrayParam); + result = _(list).intersection(listParam, arrayParam); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(array).chain().intersection(arrayParam); - result = _(array).chain().intersection(listParam, arrayParam); + result = _(array).chain().intersection(arrayParam); + result = _(array).chain().intersection(listParam, arrayParam); - result = _(list).chain().intersection(arrayParam); - result = _(list).chain().intersection(listParam, arrayParam); + result = _(list).chain().intersection(arrayParam); + result = _(list).chain().intersection(listParam, arrayParam); } } // _.intersectionBy { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, 'a'); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, ['a', 42]); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, 'a'); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionBy(array, list, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, ['a', 42]); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return ""; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 1; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, 'a'); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionBy(array, list, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, ['a', 42]); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return false; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return null; }); @@ -1490,59 +1490,59 @@ namespace TestIntersection { // _.intersectionWith { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(list, array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(list, array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); @@ -1619,8 +1619,8 @@ namespace TestJoin { // _.last namespace TestLast { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -1630,13 +1630,13 @@ namespace TestLast { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.last(array); - result = _.last(list); + result = _.last(array); + result = _.last(list); result = _(array).last(); - result = _(list).last(); + result = _(list).last(); } { @@ -1646,13 +1646,13 @@ namespace TestLast { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().last(); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(list).chain().last(); } @@ -1660,28 +1660,28 @@ namespace TestLast { // _.lastIndexOf namespace TestLastIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.lastIndexOf(array, value); - result = _.lastIndexOf(array, value, true); - result = _.lastIndexOf(array, value, 42); + result = _.lastIndexOf(array, value); + result = _.lastIndexOf(array, value, true); + result = _.lastIndexOf(array, value, 42); - result = _.lastIndexOf(list, value); - result = _.lastIndexOf(list, value, true); - result = _.lastIndexOf(list, value, 42); + result = _.lastIndexOf(list, value); + result = _.lastIndexOf(list, value, true); + result = _.lastIndexOf(list, value, 42); result = _(array).lastIndexOf(value); result = _(array).lastIndexOf(value, true); result = _(array).lastIndexOf(value, 42); - result = _(list).lastIndexOf(value); - result = _(list).lastIndexOf(value, true); - result = _(list).lastIndexOf(value, 42); + result = _(list).lastIndexOf(value); + result = _(list).lastIndexOf(value, true); + result = _(list).lastIndexOf(value, 42); } { @@ -1691,69 +1691,69 @@ namespace TestLastIndexOf { result = _(array).chain().lastIndexOf(value, true); result = _(array).chain().lastIndexOf(value, 42); - result = _(list).chain().lastIndexOf(value); - result = _(list).chain().lastIndexOf(value, true); - result = _(list).chain().lastIndexOf(value, 42); + result = _(list).chain().lastIndexOf(value); + result = _(list).chain().lastIndexOf(value, true); + result = _(list).chain().lastIndexOf(value, 42); } } // _.nth namespace TestNth { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let value = 0; { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.nth(array); + result = _.nth(array); - result = _.nth(array, 42); + result = _.nth(array, 42); result = _(array).nth(); result = _(array).nth(42); - result = _(list).nth(); - result = _(list).nth(42); + result = _(list).nth(); + result = _(list).nth(42); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().nth(); result = _(array).chain().nth(42); - result = _(list).chain().nth(); - result = _(list).chain().nth(42); + result = _(list).chain().nth(); + result = _(list).chain().nth(42); } } // _.pull namespace TestPull { - let array: TResult[] = []; - let list: _.List = []; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] = []; + let list: _.List = []; + let value: AbcObject = { a: 1, b: "", c: true }; { - let result: TResult[]; + let result: AbcObject[]; - result = _.pull(array); - result = _.pull(array, value); - result = _.pull(array, value, value); - result = _.pull(array, value, value, value); + result = _.pull(array); + result = _.pull(array, value); + result = _.pull(array, value, value); + result = _.pull(array, value, value, value); } { - let result: _.List; + let result: _.List; - result = _.pull(list); - result = _.pull(list, value); - result = _.pull(list, value, value); - result = _.pull(list, value, value, value); + result = _.pull(list); + result = _.pull(list, value); + result = _.pull(list, value, value); + result = _.pull(list, value, value, value); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).pull(); result = _(array).pull(value); @@ -1762,16 +1762,16 @@ namespace TestPull { } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).pull(); - result = _(list).pull(value); - result = _(list).pull(value, value); - result = _(list).pull(value, value, value); + result = _(list).pull(); + result = _(list).pull(value); + result = _(list).pull(value, value); + result = _(list).pull(value, value, value); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().pull(); result = _(array).chain().pull(value); @@ -1780,40 +1780,40 @@ namespace TestPull { } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().pull(); - result = _(list).chain().pull(value); - result = _(list).chain().pull(value, value); - result = _(list).chain().pull(value, value, value); + result = _(list).chain().pull(); + result = _(list).chain().pull(value); + result = _(list).chain().pull(value, value); + result = _(list).chain().pull(value, value, value); } } // _.pullAt namespace TestPullAt { - let array: TResult[] = []; - let list: _.List = []; + let array: AbcObject[] = []; + let list: _.List = []; { - let result: TResult[]; + let result: AbcObject[]; - result = _.pullAt(array); - result = _.pullAt(array, 1); - result = _.pullAt(array, [2, 3], 1); - result = _.pullAt(array, 4, [2, 3], 1); + result = _.pullAt(array); + result = _.pullAt(array, 1); + result = _.pullAt(array, [2, 3], 1); + result = _.pullAt(array, 4, [2, 3], 1); } { - let result: ArrayLike; + let result: ArrayLike; - result = _.pullAt(list); - result = _.pullAt(list, 1); - result = _.pullAt(list, [2, 3], 1); - result = _.pullAt(list, 4, [2, 3], 1); + result = _.pullAt(list); + result = _.pullAt(list, 1); + result = _.pullAt(list, [2, 3], 1); + result = _.pullAt(list, 4, [2, 3], 1); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).pullAt(); result = _(array).pullAt(1); @@ -1822,7 +1822,7 @@ namespace TestPullAt { } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; result = _(list).pullAt(); result = _(list).pullAt(1); @@ -1831,7 +1831,7 @@ namespace TestPullAt { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().pullAt(); result = _(array).chain().pullAt(1); @@ -1840,7 +1840,7 @@ namespace TestPullAt { } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; result = _(list).chain().pullAt(); result = _(list).chain().pullAt(1); @@ -1851,134 +1851,134 @@ namespace TestPullAt { // _.pullAll { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAll(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAll(array, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAll(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAll(list, values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAll(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAll(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAll(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAll(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAll(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAll(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAll(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAll(values); } // _.pullAllBy { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, 'a'); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, ['a', 42]); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return []; }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, 'a'); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, { a: 42 }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, ['a', 42]); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return () => {}; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, 'a'); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, 'a'); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, 'a'); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, 'a'); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); @@ -2011,70 +2011,70 @@ namespace TestPullAt { // _.pullAllWith { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array, values); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array, values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list, values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); @@ -2110,94 +2110,94 @@ namespace TestPullAt { // _.remove namespace TestRemove { - let array: TResult[] = []; - let list: _.List = []; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] = []; + let list: _.List = []; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.remove(array); - result = _.remove(array, predicateFn); - result = _.remove(array, ''); + result = _.remove(array); + result = _.remove(array, predicateFn); + result = _.remove(array, ''); result = _.remove(array, {a: 42}); - result = _.remove(list); - result = _.remove(list, predicateFn); - result = _.remove(list, ''); + result = _.remove(list); + result = _.remove(list, predicateFn); + result = _.remove(list, ''); result = _.remove(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).remove(); result = _(array).remove(predicateFn); result = _(array).remove(''); result = _(array).remove({a: 42}); - result = _(list).remove(); - result = _(list).remove(predicateFn); - result = _(list).remove(''); + result = _(list).remove(); + result = _(list).remove(predicateFn); + result = _(list).remove(''); result = _(list).remove({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().remove(); result = _(array).chain().remove(predicateFn); result = _(array).chain().remove(''); result = _(array).chain().remove({a: 42}); - result = _(list).chain().remove(); - result = _(list).chain().remove(predicateFn); - result = _(list).chain().remove(''); + result = _(list).chain().remove(); + result = _(list).chain().remove(predicateFn); + result = _(list).chain().remove(''); result = _(list).chain().remove({a: 42}); } } // _.tail namespace TestTail { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.tail(array); - result = _.tail(list); + result = _.tail(array); + result = _.tail(list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).tail(); - result = _(list).tail(); + result = _(list).tail(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().tail(); - result = _(list).chain().tail(); + result = _(list).chain().tail(); } } // _.slice namespace TestSlice { - let array: TResult[] | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.slice(array); + result = _.slice(array); result = _.slice(array, 42); result = _.slice(array, 42, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).slice(); result = _(array).slice(42); @@ -2205,7 +2205,7 @@ namespace TestSlice { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().slice(); result = _(array).chain().slice(42); @@ -2399,386 +2399,386 @@ namespace TestSortedLastIndexBy { // _.take namespace TestTake { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.take(array); - result = _.take(array, 42); + result = _.take(array); + result = _.take(array, 42); - result = _.take(list); - result = _.take(list, 42); + result = _.take(list); + result = _.take(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).take(); result = _(array).take(42); - result = _(list).take(); - result = _(list).take(42); + result = _(list).take(); + result = _(list).take(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().take(); result = _(array).chain().take(42); - result = _(list).chain().take(); - result = _(list).chain().take(42); + result = _(list).chain().take(); + result = _(list).chain().take(42); } } // _.takeRight namespace TestTakeRight { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeRight(array); - result = _.takeRight(array, 42); + result = _.takeRight(array); + result = _.takeRight(array, 42); - result = _.takeRight(list); - result = _.takeRight(list, 42); + result = _.takeRight(list); + result = _.takeRight(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeRight(); result = _(array).takeRight(42); - result = _(list).takeRight(); - result = _(list).takeRight(42); + result = _(list).takeRight(); + result = _(list).takeRight(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeRight(); result = _(array).chain().takeRight(42); - result = _(list).chain().takeRight(); - result = _(list).chain().takeRight(42); + result = _(list).chain().takeRight(); + result = _(list).chain().takeRight(42); } } // _.takeRightWhile namespace TestTakeRightWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeRightWhile(array); - result = _.takeRightWhile(array, predicateFn); - result = _.takeRightWhile(array, ''); + result = _.takeRightWhile(array); + result = _.takeRightWhile(array, predicateFn); + result = _.takeRightWhile(array, ''); result = _.takeRightWhile(array, {a: 42}); - result = _.takeRightWhile(list); - result = _.takeRightWhile(list, predicateFn); - result = _.takeRightWhile(list, ''); + result = _.takeRightWhile(list); + result = _.takeRightWhile(list, predicateFn); + result = _.takeRightWhile(list, ''); result = _.takeRightWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeRightWhile(); result = _(array).takeRightWhile(predicateFn); result = _(array).takeRightWhile(''); result = _(array).takeRightWhile({a: 42}); - result = _(list).takeRightWhile(); - result = _(list).takeRightWhile(predicateFn); - result = _(list).takeRightWhile(''); + result = _(list).takeRightWhile(); + result = _(list).takeRightWhile(predicateFn); + result = _(list).takeRightWhile(''); result = _(list).takeRightWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeRightWhile(); result = _(array).chain().takeRightWhile(predicateFn); result = _(array).chain().takeRightWhile(''); result = _(array).chain().takeRightWhile({a: 42}); - result = _(list).chain().takeRightWhile(); - result = _(list).chain().takeRightWhile(predicateFn); - result = _(list).chain().takeRightWhile(''); + result = _(list).chain().takeRightWhile(); + result = _(list).chain().takeRightWhile(predicateFn); + result = _(list).chain().takeRightWhile(''); result = _(list).chain().takeRightWhile({a: 42}); } } // _.takeWhile namespace TestTakeWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeWhile(array); - result = _.takeWhile(array, predicateFn); - result = _.takeWhile(array, ''); + result = _.takeWhile(array); + result = _.takeWhile(array, predicateFn); + result = _.takeWhile(array, ''); result = _.takeWhile(array, {a: 42}); - result = _.takeWhile(list); - result = _.takeWhile(list, predicateFn); - result = _.takeWhile(list, ''); + result = _.takeWhile(list); + result = _.takeWhile(list, predicateFn); + result = _.takeWhile(list, ''); result = _.takeWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeWhile(); result = _(array).takeWhile(predicateFn); result = _(array).takeWhile(''); result = _(array).takeWhile({a: 42}); - result = _(list).takeWhile(); - result = _(list).takeWhile(predicateFn); - result = _(list).takeWhile(''); + result = _(list).takeWhile(); + result = _(list).takeWhile(predicateFn); + result = _(list).takeWhile(''); result = _(list).takeWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeWhile(); result = _(array).chain().takeWhile(predicateFn); result = _(array).chain().takeWhile(''); result = _(array).chain().takeWhile({a: 42}); - result = _(list).chain().takeWhile(); - result = _(list).chain().takeWhile(predicateFn); - result = _(list).chain().takeWhile(''); + result = _(list).chain().takeWhile(); + result = _(list).chain().takeWhile(predicateFn); + result = _(list).chain().takeWhile(''); result = _(list).chain().takeWhile({a: 42}); } } // _.union namespace TestUnion { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.union(); + result = _.union(); - result = _.union(array); - result = _.union(array, list); - result = _.union(array, list, array); + result = _.union(array); + result = _.union(array, list); + result = _.union(array, list, array); - result = _.union(list); - result = _.union(list, array); - result = _.union(list, array, list); + result = _.union(list); + result = _.union(list, array); + result = _.union(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).union(); result = _(array).union(list); result = _(array).union(list, array); - result = _(array).union(); - result = _(array).union(list); - result = _(array).union(list, array); + result = _(array).union(); + result = _(array).union(list); + result = _(array).union(list, array); - result = _(list).union(); - result = _(list).union(array); - result = _(list).union(array, list); + result = _(list).union(); + result = _(list).union(array); + result = _(list).union(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().union(); result = _(array).chain().union(list); result = _(array).chain().union(list, array); - result = _(array).chain().union(); - result = _(array).chain().union(list); - result = _(array).chain().union(list, array); + result = _(array).chain().union(); + result = _(array).chain().union(list); + result = _(array).chain().union(list, array); - result = _(list).chain().union(); - result = _(list).chain().union(array); - result = _(list).chain().union(array, list); + result = _(list).chain().union(); + result = _(list).chain().union(array); + result = _(list).chain().union(array, list); } } // _.unionBy namespace TestUnionBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let iteratee: (value: TResult) => any = (value: TResult) => 1; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let iteratee: (value: AbcObject) => any = (value: AbcObject) => 1; { - let result: TResult[]; + let result: AbcObject[]; - result = _.unionBy(array, array); - result = _.unionBy(array, list, array); - result = _.unionBy(array, array, list, array); - result = _.unionBy(array, list, array, list, array); - result = _.unionBy(array, array, list, array, list, array); + result = _.unionBy(array, array); + result = _.unionBy(array, list, array); + result = _.unionBy(array, array, list, array); + result = _.unionBy(array, list, array, list, array); + result = _.unionBy(array, array, list, array, list, array); - result = _.unionBy(array, array, iteratee); - result = _.unionBy(array, list, array, iteratee); - result = _.unionBy(array, array, list, array, iteratee); - result = _.unionBy(array, list, array, list, array, iteratee); - result = _.unionBy(array, array, list, array, list, array, iteratee); + result = _.unionBy(array, array, iteratee); + result = _.unionBy(array, list, array, iteratee); + result = _.unionBy(array, array, list, array, iteratee); + result = _.unionBy(array, list, array, list, array, iteratee); + result = _.unionBy(array, array, list, array, list, array, iteratee); - result = _.unionBy(array, array, 'a'); - result = _.unionBy(array, list, array, 'a'); - result = _.unionBy(array, array, list, array, 'a'); - result = _.unionBy(array, list, array, list, array, 'a'); - result = _.unionBy(array, array, list, array, list, array, 'a'); + result = _.unionBy(array, array, 'a'); + result = _.unionBy(array, list, array, 'a'); + result = _.unionBy(array, array, list, array, 'a'); + result = _.unionBy(array, list, array, list, array, 'a'); + result = _.unionBy(array, array, list, array, list, array, 'a'); result = _.unionBy(array, array, {a: 1}); result = _.unionBy(array, list, array, {a: 1}); result = _.unionBy(array, array, list, array, {a: 1}); result = _.unionBy(array, list, array, list, array, {a: 1}); - result = _.unionBy(array, list, array, list, array, list, {a: 1}); + result = _.unionBy(array, list, array, list, array, list, {a: 1}); - result = _.unionBy(list, list); - result = _.unionBy(list, array, list); - result = _.unionBy(list, list, array, list); - result = _.unionBy(list, array, list, array, list); - result = _.unionBy(list, list, array, list, array, list); + result = _.unionBy(list, list); + result = _.unionBy(list, array, list); + result = _.unionBy(list, list, array, list); + result = _.unionBy(list, array, list, array, list); + result = _.unionBy(list, list, array, list, array, list); - result = _.unionBy(list, list, iteratee); - result = _.unionBy(list, array, list, iteratee); - result = _.unionBy(list, list, array, list, iteratee); - result = _.unionBy(list, array, list, array, list, iteratee); - result = _.unionBy(list, list, array, list, array, list, iteratee); + result = _.unionBy(list, list, iteratee); + result = _.unionBy(list, array, list, iteratee); + result = _.unionBy(list, list, array, list, iteratee); + result = _.unionBy(list, array, list, array, list, iteratee); + result = _.unionBy(list, list, array, list, array, list, iteratee); - result = _.unionBy(list, list, 'a'); - result = _.unionBy(list, array, list, 'a'); - result = _.unionBy(list, list, array, list, 'a'); - result = _.unionBy(list, array, list, array, list, 'a'); - result = _.unionBy(list, list, array, list, array, list, 'a'); + result = _.unionBy(list, list, 'a'); + result = _.unionBy(list, array, list, 'a'); + result = _.unionBy(list, list, array, list, 'a'); + result = _.unionBy(list, array, list, array, list, 'a'); + result = _.unionBy(list, list, array, list, array, list, 'a'); result = _.unionBy(list, list, {a: 1}); result = _.unionBy(list, array, list, {a: 1}); result = _.unionBy(list, list, array, list, {a: 1}); result = _.unionBy(list, array, list, array, list, {a: 1}); - result = _.unionBy(list, array, list, array, list, array, {a: 1}); + result = _.unionBy(list, array, list, array, list, array, {a: 1}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(array).unionBy(array); - result = _(array).unionBy(list, array); - result = _(array).unionBy(array, list, array); - result = _(array).unionBy(list, array, list, array); - result = _(array).unionBy(array, list, array, list, array); + result = _(array).unionBy(array); + result = _(array).unionBy(list, array); + result = _(array).unionBy(array, list, array); + result = _(array).unionBy(list, array, list, array); + result = _(array).unionBy(array, list, array, list, array); - result = _(array).unionBy(array, iteratee); - result = _(array).unionBy(list, array, iteratee); - result = _(array).unionBy(array, list, array, iteratee); - result = _(array).unionBy(list, array, list, array, iteratee); - result = _(array).unionBy(array, list, array, list, array, iteratee); + result = _(array).unionBy(array, iteratee); + result = _(array).unionBy(list, array, iteratee); + result = _(array).unionBy(array, list, array, iteratee); + result = _(array).unionBy(list, array, list, array, iteratee); + result = _(array).unionBy(array, list, array, list, array, iteratee); - result = _(array).unionBy(array, 'a'); - result = _(array).unionBy(list, array, 'a'); - result = _(array).unionBy(array, list, array, 'a'); - result = _(array).unionBy(list, array, list, array, 'a'); - result = _(array).unionBy(array, list, array, list, array, 'a'); + result = _(array).unionBy(array, 'a'); + result = _(array).unionBy(list, array, 'a'); + result = _(array).unionBy(array, list, array, 'a'); + result = _(array).unionBy(list, array, list, array, 'a'); + result = _(array).unionBy(array, list, array, list, array, 'a'); result = _(array).unionBy(array, {a: 1}); result = _(array).unionBy(list, array, {a: 1}); result = _(array).unionBy(array, list, array, {a: 1}); result = _(array).unionBy(list, array, list, array, {a: 1}); - result = _(array).unionBy(list, array, list, array, list, {a: 1}); + result = _(array).unionBy(list, array, list, array, list, {a: 1}); - result = _(list).unionBy(list); - result = _(list).unionBy(array, list); - result = _(list).unionBy(list, array, list); - result = _(list).unionBy(array, list, array, list); - result = _(list).unionBy(list, array, list, array, list); + result = _(list).unionBy(list); + result = _(list).unionBy(array, list); + result = _(list).unionBy(list, array, list); + result = _(list).unionBy(array, list, array, list); + result = _(list).unionBy(list, array, list, array, list); - result = _(list).unionBy(list, iteratee); - result = _(list).unionBy(array, list, iteratee); - result = _(list).unionBy(list, array, list, iteratee); - result = _(list).unionBy(array, list, array, list, iteratee); - result = _(list).unionBy(list, array, list, array, list, iteratee); + result = _(list).unionBy(list, iteratee); + result = _(list).unionBy(array, list, iteratee); + result = _(list).unionBy(list, array, list, iteratee); + result = _(list).unionBy(array, list, array, list, iteratee); + result = _(list).unionBy(list, array, list, array, list, iteratee); - result = _(list).unionBy(list, 'a'); - result = _(list).unionBy(array, list, 'a'); - result = _(list).unionBy(list, array, list, 'a'); - result = _(list).unionBy(array, list, array, list, 'a'); - result = _(list).unionBy(list, array, list, array, list, 'a'); + result = _(list).unionBy(list, 'a'); + result = _(list).unionBy(array, list, 'a'); + result = _(list).unionBy(list, array, list, 'a'); + result = _(list).unionBy(array, list, array, list, 'a'); + result = _(list).unionBy(list, array, list, array, list, 'a'); result = _(list).unionBy(list, {a: 1}); result = _(list).unionBy(array, list, {a: 1}); result = _(list).unionBy(list, array, list, {a: 1}); result = _(list).unionBy(array, list, array, list, {a: 1}); - result = _(list).unionBy(array, list, array, list, array, {a: 1}); + result = _(list).unionBy(array, list, array, list, array, {a: 1}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(array).chain().unionBy(array); - result = _(array).chain().unionBy(list, array); - result = _(array).chain().unionBy(array, list, array); - result = _(array).chain().unionBy(list, array, list, array); - result = _(array).chain().unionBy(array, list, array, list, array); + result = _(array).chain().unionBy(array); + result = _(array).chain().unionBy(list, array); + result = _(array).chain().unionBy(array, list, array); + result = _(array).chain().unionBy(list, array, list, array); + result = _(array).chain().unionBy(array, list, array, list, array); - result = _(array).chain().unionBy(array, iteratee); - result = _(array).chain().unionBy(list, array, iteratee); - result = _(array).chain().unionBy(array, list, array, iteratee); - result = _(array).chain().unionBy(list, array, list, array, iteratee); - result = _(array).chain().unionBy(array, list, array, list, array, iteratee); + result = _(array).chain().unionBy(array, iteratee); + result = _(array).chain().unionBy(list, array, iteratee); + result = _(array).chain().unionBy(array, list, array, iteratee); + result = _(array).chain().unionBy(list, array, list, array, iteratee); + result = _(array).chain().unionBy(array, list, array, list, array, iteratee); - result = _(array).chain().unionBy(array, 'a'); - result = _(array).chain().unionBy(list, array, 'a'); - result = _(array).chain().unionBy(array, list, array, 'a'); - result = _(array).chain().unionBy(list, array, list, array, 'a'); - result = _(array).chain().unionBy(array, list, array, list, array, 'a'); + result = _(array).chain().unionBy(array, 'a'); + result = _(array).chain().unionBy(list, array, 'a'); + result = _(array).chain().unionBy(array, list, array, 'a'); + result = _(array).chain().unionBy(list, array, list, array, 'a'); + result = _(array).chain().unionBy(array, list, array, list, array, 'a'); result = _(array).chain().unionBy(array, {a: 1}); result = _(array).chain().unionBy(list, array, {a: 1}); result = _(array).chain().unionBy(array, list, array, {a: 1}); result = _(array).chain().unionBy(list, array, list, array, {a: 1}); - result = _(array).chain().unionBy(list, array, list, array, list, {a: 1}); + result = _(array).chain().unionBy(list, array, list, array, list, {a: 1}); - result = _(list).chain().unionBy(list); - result = _(list).chain().unionBy(array, list); - result = _(list).chain().unionBy(list, array, list); - result = _(list).chain().unionBy(array, list, array, list); - result = _(list).chain().unionBy(list, array, list, array, list); + result = _(list).chain().unionBy(list); + result = _(list).chain().unionBy(array, list); + result = _(list).chain().unionBy(list, array, list); + result = _(list).chain().unionBy(array, list, array, list); + result = _(list).chain().unionBy(list, array, list, array, list); - result = _(list).chain().unionBy(list, iteratee); - result = _(list).chain().unionBy(array, list, iteratee); - result = _(list).chain().unionBy(list, array, list, iteratee); - result = _(list).chain().unionBy(array, list, array, list, iteratee); - result = _(list).chain().unionBy(list, array, list, array, list, iteratee); + result = _(list).chain().unionBy(list, iteratee); + result = _(list).chain().unionBy(array, list, iteratee); + result = _(list).chain().unionBy(list, array, list, iteratee); + result = _(list).chain().unionBy(array, list, array, list, iteratee); + result = _(list).chain().unionBy(list, array, list, array, list, iteratee); - result = _(list).chain().unionBy(list, 'a'); - result = _(list).chain().unionBy(array, list, 'a'); - result = _(list).chain().unionBy(list, array, list, 'a'); - result = _(list).chain().unionBy(array, list, array, list, 'a'); - result = _(list).chain().unionBy(list, array, list, array, list, 'a'); + result = _(list).chain().unionBy(list, 'a'); + result = _(list).chain().unionBy(array, list, 'a'); + result = _(list).chain().unionBy(list, array, list, 'a'); + result = _(list).chain().unionBy(array, list, array, list, 'a'); + result = _(list).chain().unionBy(list, array, list, array, list, 'a'); result = _(list).chain().unionBy(list, {a: 1}); result = _(list).chain().unionBy(array, list, {a: 1}); result = _(list).chain().unionBy(list, array, list, {a: 1}); result = _(list).chain().unionBy(array, list, array, list, {a: 1}); - result = _(list).chain().unionBy(array, list, array, list, array, {a: 1}); + result = _(list).chain().unionBy(array, list, array, list, array, {a: 1}); } } @@ -3008,11 +3008,11 @@ namespace TestUnzip { 2: {0: true, 1: false, length: 2}, length: 3 }; - let nilArray: TResult[][] | null | undefined = [] as any; - let nilList: _.List<_.List> | null | undefined = [] as any; + let nilArray: AbcObject[][] | null | undefined = [] as any; + let nilList: _.List<_.List> | null | undefined = [] as any; { - let result: TResult[][]; + let result: AbcObject[][]; result = _.unzip(nilArray); result = _.unzip(nilList); @@ -3055,47 +3055,47 @@ namespace TestUnzip { } { - let result: TResult[]; + let result: AbcObject[]; result = _.unzipWith(testUnzipWithArray, (...group) => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithArray, (value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithList, (...group) => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithList, (value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }); - result = _(testUnzipWithArray).unzipWith((...group): TResult => { + result = _(testUnzipWithArray).unzipWith((...group): AbcObject => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }).value(); result = _(testUnzipWithArray).unzipWith((value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }).value(); - result = _(testUnzipWithList).unzipWith((...group): TResult => { + result = _(testUnzipWithList).unzipWith((...group): AbcObject => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }).value(); result = _(testUnzipWithList).unzipWith((value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }).value(); } } @@ -3149,91 +3149,100 @@ namespace TestWithout { // _.xor namespace TestXor { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.xor(); + result = _.xor(); - result = _.xor(array); - result = _.xor(array, list); - result = _.xor(array, list, array); + result = _.xor(array); + result = _.xor(array, list); + result = _.xor(array, list, array); - result = _.xor(list); - result = _.xor(list, array); - result = _.xor(list, array, list); + result = _.xor(list); + result = _.xor(list, array); + result = _.xor(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).xor(); result = _(array).xor(list); result = _(array).xor(list, array); - result = _(list).xor(); - result = _(list).xor(array); - result = _(list).xor(array, list); + result = _(list).xor(); + result = _(list).xor(array); + result = _(list).xor(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().xor(); result = _(array).chain().xor(list); result = _(array).chain().xor(list, array); - result = _(list).chain().xor(); - result = _(list).chain().xor(array); - result = _(list).chain().xor(array, list); + result = _(list).chain().xor(); + result = _(list).chain().xor(array); + result = _(list).chain().xor(array, list); } } // _.zip { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[][]; + // $ExpectType (AbcObject | undefined)[][] + _.zip(array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(array, list); + // $ExpectType (AbcObject | undefined)[][] + _.zip(array, list, array); - result = _.zip(array); - result = _.zip(array, list); - result = _.zip(array, list, array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array, list); - result = _.zip(list); - result = _.zip(list, array); - result = _.zip(list, array, list); - - result = _.zip(list, array, list, array, list, array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array, list, array, list, array); } { - let result: _.LoDashImplicitArrayWrapper; + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(array).zip(list); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(array).zip(list, array); - result = _(array).zip(list); - result = _(array).zip(list, array); - - result = _(list).zip(array); - result = _(list).zip(array, list); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(list).zip(array); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(list).zip(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(array).chain().zip(list); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(array).chain().zip(list, array); - result = _(array).chain().zip(list); - result = _(array).chain().zip(list, array); - - result = _(list).chain().zip(array); - result = _(list).chain().zip(array, list); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(list).chain().zip(array); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(list).chain().zip(array, list); } { - _.zip([1, 2], [3, 4]); // $ExpectType [number, number][] - _.zip([1, 2], ["a", "b"]); // $ExpectType [number, string][] - _.zip([1, 2], ["a", "b"], [true, false]); // $ExpectType [number, string, boolean][] + _.zip([1, 2], [3, 4]); // $ExpectType [number | undefined, number | undefined][] + _.zip([1, 2], ["a", "b"]); // $ExpectType [number | undefined, string | undefined][] + _.zip([1, 2], ["a", "b"], [true, false]); // $ExpectType [number | undefined, string | undefined, boolean | undefined][] } } @@ -3843,62 +3852,62 @@ namespace TestConcat { namespace TestPlant { { let result: _.LoDashImplicitWrapper; - result = _(any).plant(42); + result = _(anything).plant(42); } { let result: _.LoDashImplicitStringWrapper; - result = _(any).plant(''); + result = _(anything).plant(''); } { let result: _.LoDashImplicitWrapper; - result = _(any).plant(true); + result = _(anything).plant(true); } { let result: _.LoDashImplicitNumberArrayWrapper; - result = _(any).plant([42]); + result = _(anything).plant([42]); } { let result: _.LoDashImplicitArrayWrapper; - result = _(any).plant([]); + result = _(anything).plant([]); } { let result: _.LoDashImplicitWrapper<{}>; - result = _(any).plant<{}>({}); + result = _(anything).plant<{}>({}); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().plant(42); + result = _(anything).chain().plant(42); } { let result: _.LoDashExplicitStringWrapper; - result = _(any).chain().plant(''); + result = _(anything).chain().plant(''); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().plant(true); + result = _(anything).chain().plant(true); } { let result: _.LoDashExplicitNumberArrayWrapper; - result = _(any).chain().plant([42]); + result = _(anything).chain().plant([42]); } { let result: _.LoDashExplicitArrayWrapper; - result = _(any).chain().plant([]); + result = _(anything).chain().plant([]); } { let result: _.LoDashExplicitWrapper<{}>; - result = _(any).chain().plant<{}>({}); + result = _(anything).chain().plant<{}>({}); } } @@ -4052,47 +4061,47 @@ namespace TestValueOf { // _.at namespace TestAt { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let dictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let dictionary: _.Dictionary | null | undefined = anything; { - let result: TResult[]; + let result: AbcObject[]; - result = _.at(array, 0, '1', [2], ['3'], [4, '5']); - result = _.at(list, 0, '1', [2], ['3'], [4, '5']); - result = _.at(dictionary, 0, '1', [2], ['3'], [4, '5']); + result = _.at(array, 0, '1', [2], ['3'], [4, '5']); + result = _.at(list, 0, '1', [2], ['3'], [4, '5']); + result = _.at(dictionary, 0, '1', [2], ['3'], [4, '5']); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).at(0, '1', [2], ['3'], [4, '5']); - result = _(list).at(0, '1', [2], ['3'], [4, '5']); - result = _(dictionary).at(0, '1', [2], ['3'], [4, '5']); + result = _(list).at(0, '1', [2], ['3'], [4, '5']); + result = _(dictionary).at(0, '1', [2], ['3'], [4, '5']); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().at(0, '1', [2], ['3'], [4, '5']); - result = _(list).chain().at(0, '1', [2], ['3'], [4, '5']); - result = _(dictionary).chain().at(0, '1', [2], ['3'], [4, '5']); + result = _(list).chain().at(0, '1', [2], ['3'], [4, '5']); + result = _(dictionary).chain().at(0, '1', [2], ['3'], [4, '5']); } } // _.countBy namespace TestCountBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; - let numericDictionary: _.NumericDictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; + let numericDictionary: _.NumericDictionary | null | undefined = obj; let stringIterator: (value: string, index: number, collection: string) => any = (value: string, index: number, collection: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; - let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary) => any = (value: TResult, key: number, collection: _.NumericDictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; + let numericDictionaryIterator: (value: AbcObject, key: number, collection: _.NumericDictionary) => any = (value: AbcObject, key: number, collection: _.NumericDictionary) => 1; { let result: _.Dictionary; @@ -4100,29 +4109,29 @@ namespace TestCountBy { result = _.countBy(''); result = _.countBy('', stringIterator); - result = _.countBy(array); - result = _.countBy(array, listIterator); - result = _.countBy(array, ''); + result = _.countBy(array); + result = _.countBy(array, listIterator); + result = _.countBy(array, ''); result = _.countBy(array, {a: 42}); - result = _.countBy(array, {a: 42}); + result = _.countBy(array, {a: 42}); - result = _.countBy(list); - result = _.countBy(list, listIterator); - result = _.countBy(list, ''); + result = _.countBy(list); + result = _.countBy(list, listIterator); + result = _.countBy(list, ''); result = _.countBy(list, {a: 42}); - result = _.countBy(list, {a: 42}); + result = _.countBy(list, {a: 42}); - result = _.countBy(dictionary); + result = _.countBy(dictionary); result = _.countBy(dictionary, dictionaryIterator); - result = _.countBy(dictionary, ''); + result = _.countBy(dictionary, ''); result = _.countBy(dictionary, {a: 42}); - result = _.countBy(dictionary, {a: 42}); + result = _.countBy(dictionary, {a: 42}); - result = _.countBy(numericDictionary); - result = _.countBy(numericDictionary, numericDictionaryIterator); - result = _.countBy(numericDictionary, ''); + result = _.countBy(numericDictionary); + result = _.countBy(numericDictionary, numericDictionaryIterator); + result = _.countBy(numericDictionary, ''); result = _.countBy(numericDictionary, {a: 42}); - result = _.countBy(numericDictionary, {a: 42}); + result = _.countBy(numericDictionary, {a: 42}); } { @@ -4138,7 +4147,7 @@ namespace TestCountBy { result = _(array).countBy({a: 42}); result = _(list).countBy(); - result = _(list).countBy(listIterator); + result = _(list).countBy(listIterator); result = _(list).countBy(''); result = _(list).countBy<{a: number}>({a: 42}); result = _(list).countBy({a: 42}); @@ -4150,7 +4159,7 @@ namespace TestCountBy { result = _(dictionary).countBy({a: 42}); result = _(numericDictionary).countBy(); - result = _(numericDictionary).countBy(numericDictionaryIterator); + result = _(numericDictionary).countBy(numericDictionaryIterator); result = _(numericDictionary).countBy(''); result = _(numericDictionary).countBy<{a: number}>({a: 42}); result = _(numericDictionary).countBy({a: 42}); @@ -4169,7 +4178,7 @@ namespace TestCountBy { result = _(array).chain().countBy({a: 42}); result = _(list).chain().countBy(); - result = _(list).chain().countBy(listIterator); + result = _(list).chain().countBy(listIterator); result = _(list).chain().countBy(''); result = _(list).chain().countBy<{a: number}>({a: 42}); result = _(list).chain().countBy({a: 42}); @@ -4181,7 +4190,7 @@ namespace TestCountBy { result = _(dictionary).chain().countBy({a: 42}); result = _(numericDictionary).chain().countBy(); - result = _(numericDictionary).chain().countBy(numericDictionaryIterator); + result = _(numericDictionary).chain().countBy(numericDictionaryIterator); result = _(numericDictionary).chain().countBy(''); result = _(numericDictionary).chain().countBy<{a: number}>({a: 42}); result = _(numericDictionary).chain().countBy({a: 42}); @@ -4190,16 +4199,16 @@ namespace TestCountBy { // _.each namespace TestEach { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; let stringIterator: (char: string, index: number, string: string) => any = (char: string, index: number, string: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -4214,37 +4223,37 @@ namespace TestEach { } { - let result: TResult[]; + let result: AbcObject[]; result = _.each(array, listIterator); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.each(nilArray, listIterator); } { - let result: _.List; + let result: _.List; result = _.each(list, listIterator); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.each(nilList, listIterator); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.each(dictionary, dictionaryIterator); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.each(nilDictionary, dictionaryIterator); } @@ -4256,19 +4265,19 @@ namespace TestEach { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).each(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).each(listIterator); + result = _(list).each(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).each(dictionaryIterator); } @@ -4280,19 +4289,19 @@ namespace TestEach { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().each(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().each(listIterator); + result = _(list).chain().each(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().each(dictionaryIterator); } @@ -4300,16 +4309,16 @@ namespace TestEach { // _.eachRight namespace TestEachRight { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; let stringIterator: (char: string, index: number, string: string) => any = (char: string, index: number, string: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -4324,37 +4333,37 @@ namespace TestEachRight { } { - let result: TResult[]; + let result: AbcObject[]; result = _.eachRight(array, listIterator); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.eachRight(nilArray, listIterator); } { - let result: _.List; + let result: _.List; result = _.eachRight(list, listIterator); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.eachRight(nilList, listIterator); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.eachRight(dictionary, dictionaryIterator); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.eachRight(nilDictionary, dictionaryIterator); } @@ -4366,19 +4375,19 @@ namespace TestEachRight { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).eachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).eachRight(listIterator); + result = _(list).eachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).eachRight(dictionaryIterator); } @@ -4390,19 +4399,19 @@ namespace TestEachRight { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().eachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().eachRight(listIterator); + result = _(list).chain().eachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().eachRight(dictionaryIterator); } @@ -4505,14 +4514,14 @@ namespace TestEvery { // _.filter namespace TestFilter { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; let stringIterator = (char: string, index: number, string: string) => true; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; { let result: string[]; @@ -4521,17 +4530,17 @@ namespace TestFilter { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.filter(array, listIterator); - result = _.filter(array, ''); - result = _.filter(array, {a: 42}); - result = _.filter(array, ["a", 42]); + result = _.filter(array, listIterator); + result = _.filter(array, ''); + result = _.filter(array, {a: 42}); + result = _.filter(array, ["a", 42]); - result = _.filter(list, listIterator); - result = _.filter(list, ''); - result = _.filter(list, {a: 42}); - result = _.filter(list, ["a", 42]); + result = _.filter(list, listIterator); + result = _.filter(list, ''); + result = _.filter(list, {a: 42}); + result = _.filter(list, ["a", 42]); result = _.filter(dictionary, dictionaryIterator); result = _.filter(dictionary, ''); @@ -4546,17 +4555,17 @@ namespace TestFilter { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).filter(listIterator); result = _(array).filter(''); result = _(array).filter({a: 42}); result = _(array).filter(["a", 42]); - result = _(list).filter(listIterator); - result = _(list).filter(''); - result = _(list).filter({a: 42}); - result = _(list).filter(["a", 42]); + result = _(list).filter(listIterator); + result = _(list).filter(''); + result = _(list).filter({a: 42}); + result = _(list).filter(["a", 42]); result = _(dictionary).filter(dictionaryIterator); result = _(dictionary).filter(''); @@ -4571,17 +4580,17 @@ namespace TestFilter { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().filter(listIterator); result = _(array).chain().filter(''); result = _(array).chain().filter({a: 42}); result = _(array).chain().filter(["a", 42]); - result = _(list).chain().filter(listIterator); - result = _(list).chain().filter(''); - result = _(list).chain().filter({a: 42}); - result = _(list).chain().filter(["a", 42]); + result = _(list).chain().filter(listIterator); + result = _(list).chain().filter(''); + result = _(list).chain().filter({a: 42}); + result = _(list).chain().filter(["a", 42]); result = _(dictionary).chain().filter(dictionaryIterator); result = _(dictionary).chain().filter(''); @@ -4591,8 +4600,8 @@ namespace TestFilter { { // Test filtering with type guard - let a2: Array | null | undefined = any; - let d2: _.Dictionary | null | undefined = any; + let a2: Array | null | undefined = anything; + let d2: _.Dictionary | null | undefined = anything; _.filter(a2, (item: string | number): item is number => typeof item === "number"); // $ExpectType number[] _.filter(d2, (item: string | number): item is number => typeof item === "number"); // $ExpectType number[] @@ -4605,35 +4614,35 @@ namespace TestFilter { // _.find namespace TestFind { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - let result: TResult | undefined; + let result: AbcObject | undefined; result = _.find(array); - result = _.find(array); - result = _.find(array, listIterator); - result = _.find(array, listIterator, 1); - result = _.find(array, ''); - result = _.find(array, '', 1); - result = _.find(array, {a: 42}); - result = _.find(array, {a: 42}, 1); + result = _.find(array); + result = _.find(array, listIterator); + result = _.find(array, listIterator, 1); + result = _.find(array, ''); + result = _.find(array, '', 1); + result = _.find(array, {a: 42}); + result = _.find(array, {a: 42}, 1); result = _.find(array, ['a', 5]); result = _.find(array, ['a', 5], 1); result = _.find(list); - result = _.find(list); - result = _.find(list, listIterator); - result = _.find(list, listIterator, 1); - result = _.find(list, ''); - result = _.find(list, '', 1); - result = _.find(list, {a: 42}); - result = _.find(list, {a: 42}, 1); + result = _.find(list); + result = _.find(list, listIterator); + result = _.find(list, listIterator, 1); + result = _.find(list, ''); + result = _.find(list, '', 1); + result = _.find(list, {a: 42}); + result = _.find(list, {a: 42}, 1); result = _.find(list, ['a', 5]); result = _.find(list, ['a', 5], 1); @@ -4658,15 +4667,15 @@ namespace TestFind { result = _(array).find(['a', 5]); result = _(array).find(['a', 5], 1); - result = _(list).find(); - result = _(list).find(listIterator); - result = _(list).find(listIterator, 1); - result = _(list).find(''); - result = _(list).find('', 1); - result = _(list).find({a: 42}); - result = _(list).find({a: 42}, 1); - result = _(list).find(['a', 5]); - result = _(list).find(['a', 5], 1); + result = _(list).find(); + result = _(list).find(listIterator); + result = _(list).find(listIterator, 1); + result = _(list).find(''); + result = _(list).find('', 1); + result = _(list).find({a: 42}); + result = _(list).find({a: 42}, 1); + result = _(list).find(['a', 5]); + result = _(list).find(['a', 5], 1); result = _(dictionary).find(); result = _(dictionary).find(dictionaryIterator); @@ -4678,41 +4687,41 @@ namespace TestFind { result = _(dictionary).find(['a', 5]); result = _(dictionary).find(['a', 5], 1); - result = _.find([any as TResult, null, undefined], (value: TResult | null | undefined): value is TResult | undefined => value !== null); - result = _([any as TResult, null, undefined]).find((value: TResult | null | undefined): value is TResult | undefined => value !== null); + result = _.find([anything as AbcObject, null, undefined], (value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); + result = _([anything as AbcObject, null, undefined]).find((value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); } // _.findLast namespace TestFindLast { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - let result: TResult | undefined; + let result: AbcObject | undefined; result = _.findLast(array); - result = _.findLast(array); - result = _.findLast(array, listIterator); - result = _.findLast(array, listIterator, 1); - result = _.findLast(array, ''); - result = _.findLast(array, '', 1); - result = _.findLast(array, {a: 42}); - result = _.findLast(array, {a: 42}, 1); + result = _.findLast(array); + result = _.findLast(array, listIterator); + result = _.findLast(array, listIterator, 1); + result = _.findLast(array, ''); + result = _.findLast(array, '', 1); + result = _.findLast(array, {a: 42}); + result = _.findLast(array, {a: 42}, 1); result = _.findLast(array, ['a', 5]); result = _.findLast(array, ['a', 5], 1); result = _.findLast(list); - result = _.findLast(list); - result = _.findLast(list, listIterator); - result = _.findLast(list, listIterator, 1); - result = _.findLast(list, ''); - result = _.findLast(list, '', 1); - result = _.findLast(list, {a: 42}); - result = _.findLast(list, {a: 42}, 1); + result = _.findLast(list); + result = _.findLast(list, listIterator); + result = _.findLast(list, listIterator, 1); + result = _.findLast(list, ''); + result = _.findLast(list, '', 1); + result = _.findLast(list, {a: 42}); + result = _.findLast(list, {a: 42}, 1); result = _.findLast(list, ['a', 5]); result = _.findLast(list, ['a', 5], 1); @@ -4737,15 +4746,15 @@ namespace TestFindLast { result = _(array).findLast(['a', 5]); result = _(array).findLast(['a', 5], 1); - result = _(list).findLast(); - result = _(list).findLast(listIterator); - result = _(list).findLast(listIterator, 1); - result = _(list).findLast(''); - result = _(list).findLast('', 1); - result = _(list).findLast({a: 42}); - result = _(list).findLast({a: 42}, 1); - result = _(list).findLast(['a', 5]); - result = _(list).findLast(['a', 5], 1); + result = _(list).findLast(); + result = _(list).findLast(listIterator); + result = _(list).findLast(listIterator, 1); + result = _(list).findLast(''); + result = _(list).findLast('', 1); + result = _(list).findLast({a: 42}); + result = _(list).findLast({a: 42}, 1); + result = _(list).findLast(['a', 5]); + result = _(list).findLast(['a', 5], 1); result = _(dictionary).findLast(); result = _(dictionary).findLast(dictionaryIterator); @@ -4757,8 +4766,8 @@ namespace TestFindLast { result = _(dictionary).findLast(['a', 5]); result = _(dictionary).findLast(['a', 5], 1); - result = _.findLast([any as TResult, null, undefined], (value: TResult | null | undefined): value is TResult | undefined => value !== null); - result = _([any as TResult, null, undefined]).findLast((value: TResult | null | undefined): value is TResult | undefined => value !== null); + result = _.findLast([anything as AbcObject, null, undefined], (value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); + result = _([anything as AbcObject, null, undefined]).findLast((value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); } // _.flatMap @@ -4950,14 +4959,14 @@ namespace TestFlatMapDeep { let numArray: Array | null | undefined = [1, [2, 3]] as any; let objArray: Array<{a: number}|Array<{a: number}>> | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; - let numList: _.List | null | undefined = any; - let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = any; + let numList: _.List | null | undefined = anything; + let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numDictionary: _.Dictionary | null | undefined = any; - let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = any; + let numDictionary: _.Dictionary | null | undefined = anything; + let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numNumericDictionary: _.NumericDictionary | null | undefined = any; - let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = any; + let numNumericDictionary: _.NumericDictionary | null | undefined = anything; + let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; let stringIterator: (value: string, index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => ['a', 'b', 'c']; @@ -5111,14 +5120,14 @@ namespace TestFlatMapDepth { let numArray: Array | null | undefined = [1, [2, 3]] as any; let objArray: Array<{a: number}|Array<{a: number}>> | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; - let numList: _.List | null | undefined = any; - let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = any; + let numList: _.List | null | undefined = anything; + let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numDictionary: _.Dictionary | null | undefined = any; - let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = any; + let numDictionary: _.Dictionary | null | undefined = anything; + let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numNumericDictionary: _.NumericDictionary | null | undefined = any; - let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = any; + let numNumericDictionary: _.NumericDictionary | null | undefined = anything; + let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; let stringIterator: (value: string, index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => ""; @@ -5269,16 +5278,16 @@ namespace TestFlatMapDepth { // _.forEach namespace TestForEach { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value, index, collection) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value, key, collection) => 1; - let objectIterator: (value: number | string | boolean, key: string, collection: TResult) => any = (value, key, collection) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value, index, collection) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value, key, collection) => 1; + let objectIterator: (value: number | string | boolean, key: string, collection: AbcObject) => any = (value, key, collection) => 1; { let result: string; @@ -5301,77 +5310,77 @@ namespace TestForEach { } { - let result: TResult[]; - result = _.forEach(array, (value, index, collection: ArrayLike) => { - value; // $ExpectType TResult + let result: AbcObject[]; + result = _.forEach(array, (value, index, collection: ArrayLike) => { + value; // $ExpectType AbcObject index; // $ExpectType number }); result = _.forEach(array, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; - result = _.forEach(array, (value, index, collection: ArrayLike) => { - value; // $ExpectType TResult + result = _.forEach(array, (value, index, collection: ArrayLike) => { + value; // $ExpectType AbcObject index; // $ExpectType number }); result = _.forEach(nilArray, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.List; + let result: _.List; result = _.forEach(list, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.forEach(nilList, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.forEach(dictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.forEach(nilDictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let sample1: TResult = any; + let sample1: AbcObject = anything; sample1 = _.forEach(sample1, objectIterator); - let sample2: TResult | null | undefined = any; + let sample2: AbcObject | null | undefined = anything; sample2 = _.forEach(sample2, objectIterator); } @@ -5386,45 +5395,45 @@ namespace TestForEach { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashImplicitNillableArrayWrapper; + let result: _.LoDashImplicitNillableArrayWrapper; result = _(nilArray).forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).forEach(listIterator); + result = _(list).forEach(listIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.List>; + let result: _.LoDashImplicitNillableObjectWrapper<_.List>; - result = _(nilList).forEach(listIterator); + result = _(nilList).forEach(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forEach(dictionaryIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).forEach(dictionaryIterator); } @@ -5440,45 +5449,45 @@ namespace TestForEach { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitNillableArrayWrapper; + let result: _.LoDashExplicitNillableArrayWrapper; result = _(nilArray).chain().forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().forEach(listIterator); + result = _(list).chain().forEach(listIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.List>; + let result: _.LoDashExplicitNillableObjectWrapper<_.List>; - result = _(nilList).chain().forEach(listIterator); + result = _(nilList).chain().forEach(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forEach(dictionaryIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).chain().forEach(dictionaryIterator); } @@ -5486,15 +5495,15 @@ namespace TestForEach { // _.forEachRight namespace TestForEachRight { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -5517,62 +5526,62 @@ namespace TestForEachRight { } { - let result: TResult[]; + let result: AbcObject[]; result = _.forEachRight(array, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.forEachRight(nilArray, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.List; + let result: _.List; result = _.forEachRight(list, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.forEachRight(nilList, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.forEachRight(dictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.forEachRight(nilDictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } @@ -5587,37 +5596,37 @@ namespace TestForEachRight { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).forEachRight(listIterator); } { - let result: _.LoDashImplicitNillableArrayWrapper; + let result: _.LoDashImplicitNillableArrayWrapper; result = _(nilArray).forEachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).forEachRight(listIterator); + result = _(list).forEachRight(listIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.List>; + let result: _.LoDashImplicitNillableObjectWrapper<_.List>; - result = _(nilList).forEachRight(listIterator); + result = _(nilList).forEachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forEachRight(dictionaryIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).forEachRight(dictionaryIterator); } @@ -5633,45 +5642,45 @@ namespace TestForEachRight { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().forEachRight((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitNillableArrayWrapper; + let result: _.LoDashExplicitNillableArrayWrapper; result = _(nilArray).chain().forEachRight((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; result = _(list).chain().forEachRight(listIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.List>; + let result: _.LoDashExplicitNillableObjectWrapper<_.List>; - result = _(nilList).chain().forEachRight(listIterator); + result = _(nilList).chain().forEachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forEachRight(dictionaryIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).chain().forEachRight(dictionaryIterator); } @@ -6063,18 +6072,18 @@ namespace TestMap { let obj: any = {}; let dictionary: _.Dictionary | null | undefined = obj; - let listIterator: (value: number, index: number, collection: _.List) => TResult = (value: number, index: number, collection: _.List) => ({ a: 1, b: "", c: true }); - let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => TResult = (value: number, key: string, collection: _.Dictionary) => ({ a: 1, b: "", c: true }); + let listIterator: (value: number, index: number, collection: _.List) => AbcObject = (value: number, index: number, collection: _.List) => ({ a: 1, b: "", c: true }); + let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => AbcObject = (value: number, key: string, collection: _.Dictionary) => ({ a: 1, b: "", c: true }); { _.map(array); // $ExpectType number[] - _.map(array, listIterator); // $ExpectType TResult[] + _.map(array, listIterator); // $ExpectType AbcObject[] _.map(list); // $ExpectType number[] - _.map(list, listIterator); // $ExpectType TResult[] + _.map(list, listIterator); // $ExpectType AbcObject[] _.map(dictionary); // $ExpectType number[] - _.map(dictionary, dictionaryIterator); // $ExpectType TResult[] + _.map(dictionary, dictionaryIterator); // $ExpectType AbcObject[] } { @@ -6086,13 +6095,13 @@ namespace TestMap { { _(array).map().value(); // $ExpectType number[] - _(array).map(listIterator).value(); // $ExpectType TResult[] + _(array).map(listIterator).value(); // $ExpectType AbcObject[] _(list).map().value(); // $ExpectType number[] - _(list).map(listIterator).value(); // $ExpectType TResult[] + _(list).map(listIterator).value(); // $ExpectType AbcObject[] _(dictionary).map().value(); // $ExpectType number[] - _(dictionary).map(dictionaryIterator).value(); // $ExpectType TResult[] + _(dictionary).map(dictionaryIterator).value(); // $ExpectType AbcObject[] } { @@ -6103,13 +6112,13 @@ namespace TestMap { { _(array).chain().map().value(); // $ExpectType number[] - _(array).chain().map(listIterator).value(); // $ExpectType TResult[] + _(array).chain().map(listIterator).value(); // $ExpectType AbcObject[] _(list).chain().map().value(); // $ExpectType number[] - _(list).chain().map(listIterator).value(); // $ExpectType TResult[] + _(list).chain().map(listIterator).value(); // $ExpectType AbcObject[] _(dictionary).chain().map().value(); // $ExpectType number[] - _(dictionary).chain().map(dictionaryIterator).value(); // $ExpectType TResult[] + _(dictionary).chain().map(dictionaryIterator).value(); // $ExpectType AbcObject[] } { @@ -6144,7 +6153,7 @@ namespace TestPartition { { let result: any[][]; - result = _.partition(any, (n) => { + result = _.partition(anything, (n) => { n; // $ExpectType any return n < 'c'; }); @@ -6195,7 +6204,7 @@ namespace TestPartition { { let result: _.LoDashImplicitWrapper; - result = _(any).partition((n) => { + result = _(anything).partition((n) => { n; // $ExpectType any return n < 'c'; }); @@ -6240,7 +6249,7 @@ namespace TestPartition { { let result: _.LoDashExplicitWrapper; - result = _.chain(any).partition((n) => { + result = _.chain(anything).partition((n) => { n; // $ExpectType any return n < 'c'; }); @@ -6287,7 +6296,7 @@ namespace TestPartition { // _.map with iteratee shorthand // module TestMapInsteadOfPluck { // interface SampleObject { -// d: {b: TResult}[]; +// d: {b: AbcObject}[]; // } // // let array: SampleObject[] = []; @@ -6308,42 +6317,42 @@ namespace TestPartition { // } // // { -// let result: TResult[]; +// let result: AbcObject[]; // -// result = _.map(array, 'd.0.b'); -// result = _.map(array, ['d', 0, 'b']); +// result = _.map(array, 'd.0.b'); +// result = _.map(array, ['d', 0, 'b']); // -// result = _.map(list, 'd.0.b'); -// result = _.map(list, ['d', 0, 'b']); +// result = _.map(list, 'd.0.b'); +// result = _.map(list, ['d', 0, 'b']); // -// result = _.map(dictionary, 'd.0.b'); -// result = _.map(dictionary, ['d', 0, 'b']); +// result = _.map(dictionary, 'd.0.b'); +// result = _.map(dictionary, ['d', 0, 'b']); // } // // { -// let result: _.LoDashImplicitArrayWrapper; +// let result: _.LoDashImplicitArrayWrapper; // -// result = _(array).map('d.0.b'); -// result = _(array).map(['d', 0, 'b']); +// result = _(array).map('d.0.b'); +// result = _(array).map(['d', 0, 'b']); // -// result = _(list).map('d.0.b'); -// result = _(list).map(['d', 0, 'b']); +// result = _(list).map('d.0.b'); +// result = _(list).map(['d', 0, 'b']); // -// result = _(dictionary).map('d.0.b'); -// result = _(dictionary).map(['d', 0, 'b']); +// result = _(dictionary).map('d.0.b'); +// result = _(dictionary).map(['d', 0, 'b']); // } // // { -// let result: _.LoDashExplicitArrayWrapper; +// let result: _.LoDashExplicitArrayWrapper; // -// result = _(array).chain().map('d.0.b'); -// result = _(array).chain().map(['d', 0, 'b']); +// result = _(array).chain().map('d.0.b'); +// result = _(array).chain().map(['d', 0, 'b']); // -// result = _(list).chain().map('d.0.b'); -// result = _(list).chain().map(['d', 0, 'b']); +// result = _(list).chain().map('d.0.b'); +// result = _(list).chain().map(['d', 0, 'b']); // -// result = _(dictionary).chain().map('d.0.b'); -// result = _(dictionary).chain().map(['d', 0, 'b']); +// result = _(dictionary).chain().map('d.0.b'); +// result = _(dictionary).chain().map(['d', 0, 'b']); // } // } namespace TestReduce { @@ -6387,14 +6396,14 @@ namespace TestReduce { // _.reject namespace TestReject { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; let stringIterator = (char: string, index: number, string: string) => true; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; { let result: string[]; @@ -6403,14 +6412,14 @@ namespace TestReject { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.reject(array, listIterator); - result = _.reject(array, ''); + result = _.reject(array, listIterator); + result = _.reject(array, ''); result = _.reject(array, {a: 42}); - result = _.reject(list, listIterator); - result = _.reject(list, ''); + result = _.reject(list, listIterator); + result = _.reject(list, ''); result = _.reject(list, {a: 42}); result = _.reject(dictionary, dictionaryIterator); @@ -6425,14 +6434,14 @@ namespace TestReject { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).reject(listIterator); result = _(array).reject(''); result = _(array).reject({a: 42}); - result = _(list).reject(listIterator); - result = _(list).reject(''); + result = _(list).reject(listIterator); + result = _(list).reject(''); result = _(list).reject({a: 42}); result = _(dictionary).reject(dictionaryIterator); @@ -6447,14 +6456,14 @@ namespace TestReject { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().reject(listIterator); result = _(array).chain().reject(''); result = _(array).chain().reject({a: 42}); - result = _(list).chain().reject(listIterator); - result = _(list).chain().reject(''); + result = _(list).chain().reject(listIterator); + result = _(list).chain().reject(''); result = _(list).chain().reject({a: 42}); result = _(dictionary).chain().reject(dictionaryIterator); @@ -6566,10 +6575,10 @@ namespace TestSampleSize { // _.shuffle namespace TestShuffle { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; { let result: string[]; @@ -6578,10 +6587,10 @@ namespace TestShuffle { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.shuffle(array); - result = _.shuffle(list); + result = _.shuffle(array); + result = _.shuffle(list); result = _.shuffle(dictionary); } @@ -6592,10 +6601,10 @@ namespace TestShuffle { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).shuffle(); - result = _(list).shuffle(); + result = _(list).shuffle(); result = _(dictionary).shuffle(); } @@ -6606,10 +6615,10 @@ namespace TestShuffle { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().shuffle(); - result = _(list).chain().shuffle(); + result = _(list).chain().shuffle(); result = _(dictionary).chain().shuffle(); } } @@ -6764,22 +6773,22 @@ namespace TestSome { result = _(sampleObject).chain().some(objectIterator); result = _(sampleObject).chain().some('a'); result = _(sampleObject).chain().some(['a', 42]); - result = _(sampleObject).chain().some({a: 42}); + result = _(sampleObject).chain().some({a: 42}); } } // _.sortBy namespace TestSortBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => 0; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => 0; + let listIterator = (value: AbcObject, index: number, collection: _.List) => 0; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => 0; { - let result: TResult[]; + let result: AbcObject[]; result = _.sortBy(array); result = _.sortBy(array, listIterator); @@ -6798,7 +6807,7 @@ namespace TestSortBy { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).sortBy(); result = _(array).sortBy(listIterator); @@ -6817,7 +6826,7 @@ namespace TestSortBy { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().sortBy(); result = _(array).chain().sortBy(listIterator); @@ -6846,14 +6855,14 @@ _(foodsOrganic).sortBy('organic', (food) => food.name, { organic: true }).value( namespace TestorderBy { type SampleObject = {a: number; b: string; c: boolean}; - const array: SampleObject[] | null | undefined = any; - const list: _.List | null | undefined = any; - const numericDictionary: _.NumericDictionary | null | undefined = any; - const dictionary: _.Dictionary | null | undefined = any; - const orders: boolean|string|Array = any; + const array: SampleObject[] | null | undefined = anything; + const list: _.List | null | undefined = anything; + const numericDictionary: _.NumericDictionary | null | undefined = anything; + const dictionary: _.Dictionary | null | undefined = anything; + const orders: boolean|string|Array = anything; { - let iteratees: ((value: string) => any)|Array<(value: string) => any> = any; + let iteratees: ((value: string) => any)|Array<(value: string) => any> = anything; let result: string[]; result = _.orderBy('acbd', iteratees); @@ -6861,7 +6870,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: SampleObject[]; result = _.orderBy(array, iteratees); @@ -6886,7 +6895,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: _.LoDashImplicitArrayWrapper; result = _(array).orderBy(iteratees); @@ -6909,7 +6918,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().orderBy(iteratees); @@ -7049,8 +7058,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any); - result = _.bind(func, any); + result = _.bind(func, anything); + result = _.bind(func, anything); } { @@ -7058,8 +7067,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any, 42); - result = _.bind(func, any, 42); + result = _.bind(func, anything, 42); + result = _.bind(func, anything, 42); } { @@ -7067,8 +7076,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any, 42, ''); - result = _.bind(func, any, 42, ''); + result = _.bind(func, anything, 42, ''); + result = _.bind(func, anything, 42, ''); } { @@ -7076,7 +7085,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any); + result = _(func).bind(anything); } { @@ -7084,7 +7093,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any, 42); + result = _(func).bind(anything, 42); } { @@ -7092,7 +7101,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any, 42, ''); + result = _(func).bind(anything, 42, ''); } { @@ -7100,7 +7109,7 @@ namespace TestBind { let result: _.LoDashExplicitObjectWrapper; - result = _(func).chain().bind(any); + result = _(func).chain().bind(anything); } { @@ -7108,7 +7117,7 @@ namespace TestBind { let result: _.LoDashExplicitWrapper; - result = _(func).chain().bind(any, 42); + result = _(func).chain().bind(anything, 42); } { @@ -7116,7 +7125,7 @@ namespace TestBind { let result: _.LoDashExplicitWrapper; - result = _(func).chain().bind(any, 42, ''); + result = _(func).chain().bind(anything, 42, ''); } } @@ -7340,27 +7349,27 @@ namespace TestDefer { let result: number; result = _.defer(func); - result = _.defer(func, any); - result = _.defer(func, any, any); - result = _.defer(func, any, any, any); + result = _.defer(func, anything); + result = _.defer(func, anything, anything); + result = _.defer(func, anything, anything, anything); } { let result: _.LoDashImplicitWrapper; result = _(func).defer(); - result = _(func).defer(any); - result = _(func).defer(any, any); - result = _(func).defer(any, any, any); + result = _(func).defer(anything); + result = _(func).defer(anything, anything); + result = _(func).defer(anything, anything, anything); } { let result: _.LoDashExplicitWrapper; result = _(func).chain().defer(); - result = _(func).chain().defer(any); - result = _(func).chain().defer(any, any); - result = _(func).chain().defer(any, any, any); + result = _(func).chain().defer(anything); + result = _(func).chain().defer(anything, anything); + result = _(func).chain().defer(anything, anything, anything); } } @@ -8127,15 +8136,15 @@ namespace TestEq { { let result: boolean; - result = _.eq(any, any); + result = _.eq(anything, anything); - result = _(any).eq(any); + result = _(anything).eq(anything); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().eq(any); + result = _(anything).chain().eq(anything); } } @@ -8144,18 +8153,18 @@ namespace TestGt { { let result: boolean; - result = _.gt(any, any); - result = _(1).gt(any); - result = _([]).gt(any); - result = _({}).gt(any); + result = _.gt(anything, anything); + result = _(1).gt(anything); + result = _([]).gt(anything); + result = _({}).gt(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().gt(any); - result = _([]).chain().gt(any); - result = _({}).chain().gt(any); + result = _(1).chain().gt(anything); + result = _([]).chain().gt(anything); + result = _({}).chain().gt(anything); } } @@ -8164,18 +8173,18 @@ namespace TestGte { { let result: boolean; - result = _.gte(any, any); - result = _(1).gte(any); - result = _([]).gte(any); - result = _({}).gte(any); + result = _.gte(anything, anything); + result = _(1).gte(anything); + result = _([]).gte(anything); + result = _({}).gte(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().gte(any); - result = _([]).chain().gte(any); - result = _({}).chain().gte(any); + result = _(1).chain().gte(anything); + result = _([]).chain().gte(anything); + result = _({}).chain().gte(anything); } } @@ -8195,7 +8204,7 @@ namespace TestisArguments { { let result: boolean; - result = _.isArguments(any); + result = _.isArguments(anything); result = _(1).isArguments(); result = _([]).isArguments(); result = _({}).isArguments(); @@ -8213,7 +8222,7 @@ namespace TestisArguments { // _.isArray namespace TestIsArray { { - let value: number|string[]|boolean[] = any; + let value: number|string[]|boolean[] = anything; if (_.isArray(value)) { value; // $ExpectType string[] | boolean[] @@ -8226,7 +8235,7 @@ namespace TestIsArray { { let result: boolean; - result = _.isArray(any); + result = _.isArray(anything); result = _(1).isArray(); result = _([]).isArray(); result = _({}).isArray(); @@ -8244,7 +8253,7 @@ namespace TestIsArray { // _.isArrayBuffer namespace TestIsArrayBuffer { { - let value: ArrayBuffer|number = any; + let value: ArrayBuffer|number = anything; if (_.isArrayBuffer(value)) { value; // $ExpectType ArrayBuffer @@ -8257,7 +8266,7 @@ namespace TestIsArrayBuffer { { let result: boolean; - result = _.isArrayBuffer(any); + result = _.isArrayBuffer(anything); result = _(1).isArrayBuffer(); result = _([]).isArrayBuffer(); result = _({}).isArrayBuffer(); @@ -8277,7 +8286,7 @@ namespace TestIsArrayLike { { let value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined - = any; + = anything; if (_.isArrayLike(value)) { let result: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] = value; @@ -8287,7 +8296,7 @@ namespace TestIsArrayLike { } { - let value: boolean[] = any; + let value: boolean[] = anything; if (_.isArrayLike(value)) { let result: boolean[] = value; @@ -8298,7 +8307,7 @@ namespace TestIsArrayLike { } { - let value: () => number = any; + let value: () => number = anything; if (_.isArrayLike(value)) { value; // $ExpectType never @@ -8308,7 +8317,7 @@ namespace TestIsArrayLike { } { - let value: { a: string } = any; + let value: { a: string } = anything; if (_.isArrayLike(value)) { let result: { a: string, length: number } = value; @@ -8319,7 +8328,7 @@ namespace TestIsArrayLike { } { - let value: any = any; + let value: any = anything; if (_.isArrayLike(value)) { value; // $ExpectType any @@ -8332,7 +8341,7 @@ namespace TestIsArrayLike { { let result: boolean; - result = _.isArrayLike(any); + result = _.isArrayLike(anything); result = _(1).isArrayLike(); result = _([]).isArrayLike(); result = _({}).isArrayLike(); @@ -8352,7 +8361,7 @@ namespace TestIsArrayLikeObject { { let value: string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | string | { length: string } | { a: string } | null | undefined - = any; + = anything; if (_.isArrayLikeObject(value)) { let result: string[] | { [index: number]: boolean, length: number } | [number, boolean] = value; @@ -8362,7 +8371,7 @@ namespace TestIsArrayLikeObject { } { - let value: boolean[] = any; + let value: boolean[] = anything; if (_.isArrayLikeObject(value)) { let result: boolean[] = value; @@ -8373,7 +8382,7 @@ namespace TestIsArrayLikeObject { } { - let value: (a: string) => boolean = any; + let value: (a: string) => boolean = anything; if (_.isArrayLikeObject(value)) { value; // $ExpectType never @@ -8383,7 +8392,7 @@ namespace TestIsArrayLikeObject { } { - let value: { a: string } = any; + let value: { a: string } = anything; if (_.isArrayLikeObject(value)) { let result: { a: string, length: number } = value; @@ -8394,7 +8403,7 @@ namespace TestIsArrayLikeObject { } { - let value: any = any; + let value: any = anything; if (_.isArrayLikeObject(value)) { value; // $ExpectType any @@ -8407,7 +8416,7 @@ namespace TestIsArrayLikeObject { { let result: boolean; - result = _.isArrayLikeObject(any); + result = _.isArrayLikeObject(anything); result = _(1).isArrayLikeObject(); result = _([]).isArrayLikeObject(); result = _({}).isArrayLikeObject(); @@ -8438,7 +8447,7 @@ namespace TestIsBoolean { { let result: boolean; - result = _.isBoolean(any); + result = _.isBoolean(anything); result = _(1).isBoolean(); result = _([]).isBoolean(); result = _({}).isBoolean(); @@ -8458,7 +8467,7 @@ namespace TestIsBuffer { { let result: boolean; - result = _.isBuffer(any); + result = _.isBuffer(anything); result = _(1).isBuffer(); result = _([]).isBuffer(); result = _({}).isBuffer(); @@ -8489,7 +8498,7 @@ namespace TestIsBuffer { { let result: boolean; - result = _.isDate(any); + result = _.isDate(anything); result = _(42).isDate(); result = _([]).isDate(); result = _({}).isDate(); @@ -8509,7 +8518,7 @@ namespace TestIsElement { { let result: boolean; - result = _.isElement(any); + result = _.isElement(anything); result = _(42).isElement(); result = _([]).isElement(); @@ -8530,7 +8539,7 @@ namespace TestIsEmpty { { let result: boolean; - result = _.isEmpty(any); + result = _.isEmpty(anything); result = _(1).isEmpty(); result = _('').isEmpty(); result = _([]).isEmpty(); @@ -8554,15 +8563,15 @@ namespace TestIsEqual { { let result: boolean; - result = _.isEqual(any, any); + result = _.isEqual(anything, anything); - result = _(any).isEqual(any); + result = _(anything).isEqual(anything); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().isEqual(any); + result = _(anything).chain().isEqual(anything); } } @@ -8573,15 +8582,15 @@ namespace TestIsEqualWith { { let result: boolean; - result = _.isEqualWith(any, any, customizer); + result = _.isEqualWith(anything, anything, customizer); - result = _(any).isEqualWith(any, customizer); + result = _(anything).isEqualWith(anything, customizer); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().isEqualWith(any, customizer); + result = _(anything).chain().isEqualWith(anything, customizer); } } @@ -8617,7 +8626,7 @@ namespace TestIsError { { let result: boolean; - result = _.isError(any); + result = _.isError(anything); result = _(1).isError(); result = _([]).isError(); result = _({}).isError(); @@ -8637,7 +8646,7 @@ namespace TestIsFinite { { let result: boolean; - result = _.isFinite(any); + result = _.isFinite(anything); result = _(1).isFinite(); result = _([]).isFinite(); result = _({}).isFinite(); @@ -8655,7 +8664,7 @@ namespace TestIsFinite { // _.isFunction namespace TestIsFunction { { - let value: number|(() => void) = any; + let value: number|(() => void) = anything; if (_.isFunction(value)) { value; // $ExpectType () => void @@ -8664,15 +8673,15 @@ namespace TestIsFunction { value; // $ExpectType number } - if (_.isFunction(any)) { - any(); + if (_.isFunction(anything)) { + anything(); } } { let result: boolean; - result = _.isFunction(any); + result = _.isFunction(anything); result = _(1).isFunction(); result = _([]).isFunction(); result = _({}).isFunction(); @@ -8692,7 +8701,7 @@ namespace TestIsInteger { { let result: boolean; - result = _.isInteger(any); + result = _.isInteger(anything); result = _(1).isInteger(); result = _([]).isInteger(); @@ -8713,7 +8722,7 @@ namespace TestIsLength { { let result: boolean; - result = _.isLength(any); + result = _.isLength(anything); result = _(1).isLength(); result = _([]).isLength(); @@ -8745,7 +8754,7 @@ namespace TestIsMap { { let result: boolean; - result = _.isMap(any); + result = _.isMap(anything); result = _(1).isMap(); result = _([]).isMap(); result = _({}).isMap(); @@ -8781,7 +8790,7 @@ namespace TestIsNaN { { let result: boolean; - result = _.isNaN(any); + result = _.isNaN(anything); result = _(1).isNaN(); result = _([]).isNaN(); @@ -8800,7 +8809,7 @@ namespace TestIsNaN { // _.isNative namespace TestIsNative { { - let value: number|(() => void) = any; + let value: number|(() => void) = anything; if (_.isNative(value)) { value; // $ExpectType () => void @@ -8813,7 +8822,7 @@ namespace TestIsNative { { let result: boolean; - result = _.isNative(any); + result = _.isNative(anything); result = _(1).isNative(); result = _([]).isNative(); @@ -8834,7 +8843,7 @@ namespace TestIsNil { { let result: boolean; - result = _.isNil(any); + result = _.isNil(anything); result = _(1).isNil(); result = _([]).isNil(); @@ -8855,7 +8864,7 @@ namespace TestIsNull { { let result: boolean; - result = _.isNull(any); + result = _.isNull(anything); result = _(1).isNull(); result = _([]).isNull(); @@ -8887,7 +8896,7 @@ namespace TestIsNumber { { let result: boolean; - result = _.isNumber(any); + result = _.isNumber(anything); result = _(1).isNumber(); result = _([]).isNumber(); @@ -8908,7 +8917,7 @@ namespace TestIsObject { { let result: boolean; - result = _.isObject(any); + result = _.isObject(anything); result = _(1).isObject(); result = _([]).isObject(); result = _({}).isObject(); @@ -8928,7 +8937,7 @@ namespace TestIsObjectLike { { let result: boolean; - result = _.isObjectLike(any); + result = _.isObjectLike(anything); result = _(1).isObjectLike(); result = _([]).isObjectLike(); result = _({}).isObjectLike(); @@ -8948,7 +8957,7 @@ namespace TestIsPlainObject { { let result: boolean; - result = _.isPlainObject(any); + result = _.isPlainObject(anything); result = _(1).isPlainObject(); result = _([]).isPlainObject(); result = _({}).isPlainObject(); @@ -8979,7 +8988,7 @@ namespace TestIsRegExp { { let result: boolean; - result = _.isRegExp(any); + result = _.isRegExp(anything); result = _(1).isRegExp(); result = _([]).isRegExp(); result = _({}).isRegExp(); @@ -8999,7 +9008,7 @@ namespace TestIsSafeInteger { { let result: boolean; - result = _.isSafeInteger(any); + result = _.isSafeInteger(anything); result = _(1).isSafeInteger(); result = _([]).isSafeInteger(); @@ -9031,7 +9040,7 @@ namespace TestIsSet { { let result: boolean; - result = _.isSet(any); + result = _.isSet(anything); result = _(1).isSet(); result = _([]).isSet(); result = _({}).isSet(); @@ -9062,7 +9071,7 @@ namespace TestIsString { { let result: boolean; - result = _.isString(any); + result = _.isString(anything); result = _(1).isString(); result = _([]).isString(); result = _({}).isString(); @@ -9082,7 +9091,7 @@ namespace TestIsSymbol { { let result: boolean; - result = _.isSymbol(any); + result = _.isSymbol(anything); result = _(1).isSymbol(); result = _([]).isSymbol(); @@ -9119,7 +9128,7 @@ namespace TestIsUndefined { { let result: boolean; - result = _.isUndefined(any); + result = _.isUndefined(anything); result = _(1).isUndefined(); result = _([]).isUndefined(); @@ -9151,7 +9160,7 @@ namespace TestIsWeakMap { { let result: boolean; - result = _.isWeakMap(any); + result = _.isWeakMap(anything); result = _(1).isWeakMap(); result = _([]).isWeakMap(); result = _({}).isWeakMap(); @@ -9182,7 +9191,7 @@ namespace TestIsWeakSet { { let result: boolean; - result = _.isWeakSet(any); + result = _.isWeakSet(anything); result = _(1).isWeakSet(); result = _([]).isWeakSet(); result = _({}).isWeakSet(); @@ -9202,18 +9211,18 @@ namespace TestLt { { let result: boolean; - result = _.lt(any, any); - result = _(1).lt(any); - result = _([]).lt(any); - result = _({}).lt(any); + result = _.lt(anything, anything); + result = _(1).lt(anything); + result = _([]).lt(anything); + result = _({}).lt(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().lt(any); - result = _([]).chain().lt(any); - result = _({}).chain().lt(any); + result = _(1).chain().lt(anything); + result = _([]).chain().lt(anything); + result = _({}).chain().lt(anything); } } @@ -9222,27 +9231,27 @@ namespace TestLte { { let result: boolean; - result = _.lte(any, any); - result = _(1).lte(any); - result = _([]).lte(any); - result = _({}).lte(any); + result = _.lte(anything, anything); + result = _(1).lte(anything); + result = _([]).lte(anything); + result = _({}).lte(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().lte(any); - result = _([]).chain().lte(any); - result = _({}).chain().lte(any); + result = _(1).chain().lte(anything); + result = _([]).chain().lte(anything); + result = _({}).chain().lte(anything); } } // _.toArray namespace TestToArray { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let numericDictionary: _.NumericDictionary = {}; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let numericDictionary: _.NumericDictionary = {}; { let result: string[]; @@ -9252,12 +9261,12 @@ namespace TestToArray { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.toArray(array); - result = _.toArray(list); - result = _.toArray(dictionary); - result = _.toArray(numericDictionary); + result = _.toArray(array); + result = _.toArray(list); + result = _.toArray(dictionary); + result = _.toArray(numericDictionary); result = _.toArray(array); result = _.toArray(list); @@ -9274,28 +9283,28 @@ namespace TestToArray { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).toArray(); - result = _(list).toArray(); - result = _(dictionary).toArray(); - result = _(numericDictionary).toArray(); + result = _(list).toArray(); + result = _(dictionary).toArray(); + result = _(numericDictionary).toArray(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().toArray(); - result = _(list).chain().toArray(); - result = _(dictionary).chain().toArray(); - result = _(numericDictionary).chain().toArray(); + result = _(list).chain().toArray(); + result = _(dictionary).chain().toArray(); + result = _(numericDictionary).chain().toArray(); } } // _.toPlainObject namespace TestToPlainObject { { - let result: TResult; + let result: AbcObject; result = _.toPlainObject(); result = _.toPlainObject(true); result = _.toPlainObject(1); @@ -9305,7 +9314,7 @@ namespace TestToPlainObject { } { - let result: _.LoDashImplicitObjectWrapper; + let result: _.LoDashImplicitObjectWrapper; result = _(true).toPlainObject(); result = _(1).toPlainObject(); @@ -9529,13 +9538,13 @@ namespace TestMax { namespace TestMaxBy { let array: number[] = []; let list: _.List = []; - let array2: TResult[] = []; - let list2: _.List = []; + let array2: AbcObject[] = []; + let list2: _.List = []; let listIterator = (value: number, index: number, collection: _.List) => 0; let result: number | undefined; - let result2: TResult | undefined; + let result2: AbcObject | undefined; result = _.maxBy(array); result = _.maxBy(array, listIterator); @@ -9571,7 +9580,7 @@ namespace TestMean { // _.meanBy { - let array: TResult[] = []; + let array: AbcObject[] = []; let result: number; @@ -9599,13 +9608,13 @@ namespace TestMin { namespace TestMinBy { let array: number[] = []; let list: _.List = []; - let array2: TResult[] = []; - let list2: _.List = []; + let array2: AbcObject[] = []; + let list2: _.List = []; let listIterator = (value: number, index: number, collection: _.List) => 0; let result: number | undefined; - let result2: TResult | undefined; + let result2: AbcObject | undefined; result = _.minBy(array); result = _.minBy(array, listIterator); @@ -10901,11 +10910,11 @@ namespace TestForIn { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -10970,11 +10979,11 @@ namespace TestForInRight { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11039,11 +11048,11 @@ namespace TestForOwn { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11108,11 +11117,11 @@ namespace TestForOwnRight { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11500,7 +11509,7 @@ namespace TestInvertBy { // _.keys namespace TestKeys { - let object: _.Dictionary | null | undefined = any; + let object: _.Dictionary | null | undefined = anything; { let result: string[]; @@ -11523,7 +11532,7 @@ namespace TestKeys { // _.keysIn namespace TestKeysIn { - let object: _.Dictionary | null | undefined = any; + let object: _.Dictionary | null | undefined = anything; { let result: string[]; @@ -11546,15 +11555,15 @@ namespace TestKeysIn { // _.mapKeys namespace TestMapKeys { - let array: TResult[] | null | undefined = [] as any; - let list: _.List| null | undefined = [] as any; - let dictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List| null | undefined = [] as any; + let dictionary: _.Dictionary | null | undefined = anything; - let listIterator = (value: TResult, index: number, collection: _.List) => ""; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => ""; + let listIterator = (value: AbcObject, index: number, collection: _.List) => ""; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => ""; { - let result: _.Dictionary; + let result: _.Dictionary; result = _.mapKeys(array); result = _.mapKeys(array, listIterator); @@ -11573,7 +11582,7 @@ namespace TestMapKeys { } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(array).mapKeys(); result = _(array).mapKeys(listIterator); @@ -11592,7 +11601,7 @@ namespace TestMapKeys { } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(array).chain().mapKeys(); result = _(array).chain().mapKeys(listIterator); @@ -11733,11 +11742,11 @@ namespace TestMergeWith { // _.omit namespace TestOmit { - let obj: TResult | null | undefined = any; - let dict: { [key: string]: TResult } = { }; + let obj: AbcObject | null | undefined = anything; + let dict: { [key: string]: AbcObject } = { }; { - let result: Partial; + let result: Partial; result = _.omit(obj, 'a'); result = _.omit(obj, 0, 'a'); @@ -11747,7 +11756,7 @@ namespace TestOmit { } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; result = _(obj).omit('a'); result = _(obj).omit(0, 'a'); @@ -11757,7 +11766,7 @@ namespace TestOmit { } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; result = _(obj).chain().omit('a'); result = _(obj).chain().omit(0, 'a'); @@ -11769,35 +11778,35 @@ namespace TestOmit { // _.omitBy namespace TestOmitBy { - let obj: TResult | null | undefined = any; + let obj: AbcObject | null | undefined = anything; let predicate = (element: any, key: string) => true; { - let result: Partial; + let result: Partial; result = _.omitBy(obj, predicate); } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; - result = _(obj).omitBy(predicate); + result = _(obj).omitBy(predicate); } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; - result = _(obj).chain().omitBy(predicate); + result = _(obj).chain().omitBy(predicate); } } // _.pick namespace TestPick { - let obj1: TResult | null | undefined = any; - let obj2: TResult = any; + let obj1: AbcObject | null | undefined = anything; + let obj2: AbcObject = anything; { - let result: Partial; + let result: Partial; result = _.pick(obj1, 'a'); result = _.pick(obj1, 0, 'a'); @@ -11805,13 +11814,13 @@ namespace TestPick { } { - let result: Pick; + let result: Pick; result = _.pick(obj2, 'a', 'b'); result = _.pick(obj2, ['a' as 'a', 'b' as 'b']); } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; result = _(obj1).pick('a'); result = _(obj1).pick(0, 'a'); @@ -11819,14 +11828,14 @@ namespace TestPick { } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; result = _(obj2).pick('a', 'b'); result = _(obj2).pick(['a' as 'a', 'b' as 'b']); } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; result = _(obj1).chain().pick('a'); result = _(obj1).chain().pick(0, 'a'); @@ -11834,7 +11843,7 @@ namespace TestPick { } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; result = _(obj2).chain().pick('a', 'b'); result = _(obj2).chain().pick(['a' as 'a', 'b' as 'b']); @@ -11843,25 +11852,25 @@ namespace TestPick { // _.pickBy namespace TestPickBy { - let obj: TResult | null | undefined = any; + let obj: AbcObject | null | undefined = anything; let predicate = (element: any, key: string) => true; { - let result: Partial; + let result: Partial; result = _.pickBy(obj, predicate); } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; - result = _(obj).pickBy(predicate); + result = _(obj).pickBy(predicate); } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; - result = _(obj).chain().pickBy(predicate); + result = _(obj).chain().pickBy(predicate); } } @@ -12079,13 +12088,13 @@ namespace TestTransform { let dictionary: _.Dictionary = {}; { - let iterator = (acc: TResult[], curr: number, index?: number, arr?: number[]) => {}; - let accumulator: TResult[] = []; - let result: TResult[]; + let iterator = (acc: AbcObject[], curr: number, index?: number, arr?: number[]) => {}; + let accumulator: AbcObject[] = []; + let result: AbcObject[]; result = _.transform(array); - result = _.transform(array, iterator); - result = _.transform(array, iterator, accumulator); + result = _.transform(array, iterator); + result = _.transform(array, iterator, accumulator); result = _(array).transform().value(); result = _(array).transform(iterator).value(); @@ -12093,37 +12102,37 @@ namespace TestTransform { } { - let iterator = (acc: _.Dictionary, curr: number, index?: number, arr?: number[]) => {}; - let accumulator: _.Dictionary = {}; - let result: _.Dictionary; + let iterator = (acc: _.Dictionary, curr: number, index?: number, arr?: number[]) => {}; + let accumulator: _.Dictionary = {}; + let result: _.Dictionary; - result = _.transform(array, iterator, accumulator); + result = _.transform(array, iterator, accumulator); result = _(array).transform(iterator, accumulator).value(); } { - let iterator = (acc: _.Dictionary, curr: number, key?: string, dict?: _.Dictionary) => {}; - let accumulator: _.Dictionary = {}; - let result: _.Dictionary; + let iterator = (acc: _.Dictionary, curr: number, key?: string, dict?: _.Dictionary) => {}; + let accumulator: _.Dictionary = {}; + let result: _.Dictionary; result = _.transform(dictionary); - result = _.transform(dictionary, iterator); - result = _.transform(dictionary, iterator, accumulator); + result = _.transform(dictionary, iterator); + result = _.transform(dictionary, iterator, accumulator); result = _(dictionary).transform().value(); - result = _(dictionary).transform(iterator).value(); - result = _(dictionary).transform(iterator, accumulator).value(); + result = _(dictionary).transform(iterator).value(); + result = _(dictionary).transform(iterator, accumulator).value(); } { - let iterator = (acc: TResult[], curr: number, key?: string, dict?: _.Dictionary) => {}; - let accumulator: TResult[] = []; - let result: TResult[]; + let iterator = (acc: AbcObject[], curr: number, key?: string, dict?: _.Dictionary) => {}; + let accumulator: AbcObject[] = []; + let result: AbcObject[]; - result = _.transform(dictionary, iterator, accumulator); + result = _.transform(dictionary, iterator, accumulator); - result = _(dictionary).transform(iterator, accumulator).value(); + result = _(dictionary).transform(iterator, accumulator).value(); } } @@ -12356,37 +12365,37 @@ namespace TestValues { // _.valuesIn namespace TestValuesIn { - let object: _.Dictionary = {}; + let object: _.Dictionary = {}; { - let result: TResult[]; + let result: AbcObject[]; result = _.valuesIn(object); } { - let result: TResult[]; + let result: AbcObject[]; // Without this type hint, this will fail to compile, as expected. - result = _.valuesIn({}); + result = _.valuesIn({}); } { - let result: TResult[]; + let result: AbcObject[]; result = _.values(object); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(object).valuesIn(); + result = _(object).valuesIn(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(object).chain().valuesIn(); + result = _(object).chain().valuesIn(); } } @@ -13279,7 +13288,7 @@ namespace TestIdentity { } { - let input: { a: number; } | null | undefined = any; + let input: { a: number; } | null | undefined = anything; _.identity(input); // $ExpectType { a: number; } | null | undefined _.identity(); // $ExpectType undefined } @@ -13288,13 +13297,13 @@ namespace TestIdentity { // _.iteratee namespace TestIteratee { { - _.iteratee((...args: any[]): TResult => any); // $ExpectType (...args: any[]) => TResult - _.iteratee((a: TResult): boolean => any); // $ExpectType (a: TResult) => boolean - _.iteratee((a: TResult | undefined): a is undefined => any); // $ExpectType (a: TResult | undefined) => a is undefined + _.iteratee((...args: any[]): AbcObject => anything); // $ExpectType (...args: any[]) => AbcObject + _.iteratee((a: AbcObject): boolean => anything); // $ExpectType (a: AbcObject) => boolean + _.iteratee((a: AbcObject | undefined): a is undefined => anything); // $ExpectType (a: AbcObject | undefined) => a is undefined } { - let result: (object: any) => TResult; + let result: (object: any) => AbcObject; result = _.iteratee(''); } @@ -13306,14 +13315,14 @@ namespace TestIteratee { } { - let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => AbcObject>; - let func: (...args: any[]) => TResult = any; + let func: (...args: any[]) => AbcObject = anything; result = _(func).iteratee(); } { - let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>; + let result: _.LoDashImplicitObjectWrapper<(object: any) => AbcObject>; result = _('').iteratee(); } @@ -13325,14 +13334,14 @@ namespace TestIteratee { } { - let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => AbcObject>; - let func: (...args: any[]) => TResult = any; + let func: (...args: any[]) => AbcObject = anything; result = _(func).chain().iteratee(); } { - let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>; + let result: _.LoDashExplicitObjectWrapper<(object: any) => AbcObject>; result = _('').chain().iteratee(); } @@ -13346,68 +13355,68 @@ namespace TestIteratee { // _.matches namespace TestMatches { - let source: TResult = { a: 1, b: "", c: true }; + let source: AbcObject = { a: 1, b: "", c: true }; { let result: (value: any) => boolean; - result = _.matches(source); + result = _.matches(source); } { - let result: (value: TResult) => boolean; - result = _.matches(source); + let result: (value: AbcObject) => boolean; + result = _.matches(source); } { - let result: _.LoDashImplicitObjectWrapper<(value: TResult) => boolean>; - result = _(source).matches(); + let result: _.LoDashImplicitObjectWrapper<(value: AbcObject) => boolean>; + result = _(source).matches(); } { - let result: _.LoDashExplicitObjectWrapper<(value: TResult) => boolean>; - result = _(source).chain().matches(); + let result: _.LoDashExplicitObjectWrapper<(value: AbcObject) => boolean>; + result = _(source).chain().matches(); } } // _.matchesProperty { let path: string | string[] = []; - let source: TResult = { a: 1, b: "", c: true }; + let source: AbcObject = { a: 1, b: "", c: true }; { let result: (value: any) => boolean; - result = _.matchesProperty(path, source); + result = _.matchesProperty(path, source); } { - let result: (value: TResult) => boolean; + let result: (value: AbcObject) => boolean; - result = _.matchesProperty(path, source); + result = _.matchesProperty(path, source); } { let result: _.LoDashImplicitObjectWrapper<(value: any) => boolean>; - result = _(path).matchesProperty(source); + result = _(path).matchesProperty(source); } { - let result: _.LoDashImplicitObjectWrapper<(value: TResult) => boolean>; + let result: _.LoDashImplicitObjectWrapper<(value: AbcObject) => boolean>; - result = _(path).matchesProperty(source); + result = _(path).matchesProperty(source); } { let result: _.LoDashExplicitObjectWrapper<(value: any) => boolean>; - result = _(path).chain().matchesProperty(source); + result = _(path).chain().matchesProperty(source); } { - let result: _.LoDashExplicitObjectWrapper<(value: TResult) => boolean>; + let result: _.LoDashExplicitObjectWrapper<(value: AbcObject) => boolean>; - result = _(path).chain().matchesProperty(source); + result = _(path).chain().matchesProperty(source); } } @@ -13417,89 +13426,89 @@ namespace TestMethod { let result: (object: any) => {a: string}; result = _.method('a.0'); - result = _.method('a.0', any, any); - result = _.method('a.0', any, any, any); + result = _.method('a.0', anything, anything); + result = _.method('a.0', anything, anything, anything); result = _.method(['a', 0]); - result = _.method(['a', 0], any); - result = _.method(['a', 0], any, any); - result = _.method(['a', 0], any, any, any); + result = _.method(['a', 0], anything); + result = _.method(['a', 0], anything, anything); + result = _.method(['a', 0], anything, anything, anything); } { let result: (object: {a: string}) => {b: string}; result = _.method('a.0'); - result = _.method('a.0', any, any); - result = _.method('a.0', any, any, any); + result = _.method('a.0', anything, anything); + result = _.method('a.0', anything, anything, anything); result = _.method(['a', 0]); - result = _.method(['a', 0], any); - result = _.method(['a', 0], any, any); - result = _.method(['a', 0], any, any, any); + result = _.method(['a', 0], anything); + result = _.method(['a', 0], anything, anything); + result = _.method(['a', 0], anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => {a: string}>; result = _('a.0').method(); - result = _('a.0').method(any); - result = _('a.0').method(any, any); - result = _('a.0').method(any, any, any); + result = _('a.0').method(anything); + result = _('a.0').method(anything, anything); + result = _('a.0').method(anything, anything, anything); result = _(['a', 0]).method(); - result = _(['a', 0]).method(any); - result = _(['a', 0]).method(any, any); - result = _(['a', 0]).method(any, any, any); + result = _(['a', 0]).method(anything); + result = _(['a', 0]).method(anything, anything); + result = _(['a', 0]).method(anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper<(object: {a: string}) => {b: string}>; result = _('a.0').method(); - result = _('a.0').method(any); - result = _('a.0').method(any, any); - result = _('a.0').method(any, any, any); + result = _('a.0').method(anything); + result = _('a.0').method(anything, anything); + result = _('a.0').method(anything, anything, anything); result = _(['a', 0]).method(); - result = _(['a', 0]).method(any); - result = _(['a', 0]).method(any, any); - result = _(['a', 0]).method(any, any, any); + result = _(['a', 0]).method(anything); + result = _(['a', 0]).method(anything, anything); + result = _(['a', 0]).method(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => {a: string}>; result = _('a.0').chain().method(); - result = _('a.0').chain().method(any); - result = _('a.0').chain().method(any, any); - result = _('a.0').chain().method(any, any, any); + result = _('a.0').chain().method(anything); + result = _('a.0').chain().method(anything, anything); + result = _('a.0').chain().method(anything, anything, anything); result = _(['a', 0]).chain().method(); - result = _(['a', 0]).chain().method(any); - result = _(['a', 0]).chain().method(any, any); - result = _(['a', 0]).chain().method(any, any, any); + result = _(['a', 0]).chain().method(anything); + result = _(['a', 0]).chain().method(anything, anything); + result = _(['a', 0]).chain().method(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper<(object: {a: string}) => {b: string}>; result = _('a.0').chain().method(); - result = _('a.0').chain().method(any); - result = _('a.0').chain().method(any, any); - result = _('a.0').chain().method(any, any, any); + result = _('a.0').chain().method(anything); + result = _('a.0').chain().method(anything, anything); + result = _('a.0').chain().method(anything, anything, anything); result = _(['a', 0]).chain().method(); - result = _(['a', 0]).chain().method(any); - result = _(['a', 0]).chain().method(any, any); - result = _(['a', 0]).chain().method(any, any, any); + result = _(['a', 0]).chain().method(anything); + result = _(['a', 0]).chain().method(anything, anything); + result = _(['a', 0]).chain().method(anything, anything, anything); } } // _.methodOf namespace TestMethodOf { - type SampleObject = { a: Array<{ b(): TResult }> }; - type ResultFn = (path: string | string[]) => TResult; + type SampleObject = { a: Array<{ b(): AbcObject }> }; + type ResultFn = (path: string | string[]) => AbcObject; let object: SampleObject = { a: [] }; @@ -13507,34 +13516,34 @@ namespace TestMethodOf { let result: ResultFn; result = _.methodOf(object); - result = _.methodOf(object, any); - result = _.methodOf(object, any, any); - result = _.methodOf(object, any, any, any); + result = _.methodOf(object, anything); + result = _.methodOf(object, anything, anything); + result = _.methodOf(object, anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper; result = _(object).methodOf(); - result = _(object).methodOf(any); - result = _(object).methodOf(any, any); - result = _(object).methodOf(any, any, any); + result = _(object).methodOf(anything); + result = _(object).methodOf(anything, anything); + result = _(object).methodOf(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().methodOf(); - result = _(object).chain().methodOf(any); - result = _(object).chain().methodOf(any, any); - result = _(object).chain().methodOf(any, any, any); + result = _(object).chain().methodOf(anything); + result = _(object).chain().methodOf(anything, anything); + result = _(object).chain().methodOf(anything, anything, anything); } } // _.mixin namespace TestMixin { let source: _.Dictionary<(...args: any[]) => any> = {}; - let dest: TResult = any; + let dest: AbcObject = anything; let options: {chain?: boolean} = {}; { @@ -13545,7 +13554,7 @@ namespace TestMixin { } { - let result: TResult; + let result: AbcObject; result = _.mixin(dest, source); result = _.mixin(dest, source, options); @@ -13559,7 +13568,7 @@ namespace TestMixin { } { - let result: _.LoDashImplicitWrapper; + let result: _.LoDashImplicitWrapper; result = _(dest).mixin(source); result = _(dest).mixin(source, options); @@ -13573,7 +13582,7 @@ namespace TestMixin { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(dest).chain().mixin(source); result = _(dest).chain().mixin(source, options); @@ -13614,7 +13623,7 @@ namespace TestNoop { result = _([1]).noop(true, 'a', 1); result = _(['']).noop(true, 'a', 1); result = _({}).noop(true, 'a', 1); - result = _(any).noop(true, 'a', 1); + result = _(anything).noop(true, 'a', 1); } { @@ -13624,7 +13633,7 @@ namespace TestNoop { result = _([1]).chain().noop(true, 'a', 1); result = _(['']).chain().noop(true, 'a', 1); result = _({}).chain().noop(true, 'a', 1); - result = _(any).chain().noop(true, 'a', 1); + result = _(anything).chain().noop(true, 'a', 1); } } @@ -13875,7 +13884,7 @@ namespace TestRangeRight { let result: any[]; result = _.stubArray(); - result = _(any).stubArray(); + result = _(anything).stubArray(); } { @@ -13885,7 +13894,7 @@ namespace TestRangeRight { result = _([1]).chain().stubArray(); result = _(['']).chain().stubArray(); result = _({}).chain().stubArray(); - result = _(any).chain().stubArray(); + result = _(anything).chain().stubArray(); } } @@ -13895,7 +13904,7 @@ namespace TestRangeRight { let result: boolean; result = _.stubFalse(); - result = _(any).stubFalse(); + result = _(anything).stubFalse(); } { @@ -13905,7 +13914,7 @@ namespace TestRangeRight { result = _([1]).chain().stubFalse(); result = _(['']).chain().stubFalse(); result = _({}).chain().stubFalse(); - result = _(any).chain().stubFalse(); + result = _(anything).chain().stubFalse(); } } @@ -13915,7 +13924,7 @@ namespace TestRangeRight { let result: object; result = _.stubObject(); - result = _(any).stubObject(); + result = _(anything).stubObject(); } { @@ -13925,7 +13934,7 @@ namespace TestRangeRight { result = _([1]).chain().stubObject(); result = _(['']).chain().stubObject(); result = _({}).chain().stubObject(); - result = _(any).chain().stubObject(); + result = _(anything).chain().stubObject(); } } @@ -13935,7 +13944,7 @@ namespace TestRangeRight { let result: string; result = _.stubString(); - result = _(any).stubString(); + result = _(anything).stubString(); } { @@ -13945,7 +13954,7 @@ namespace TestRangeRight { result = _([1]).chain().stubString(); result = _(['']).chain().stubString(); result = _({}).chain().stubString(); - result = _(any).chain().stubString(); + result = _(anything).chain().stubString(); } } @@ -13955,7 +13964,7 @@ namespace TestRangeRight { let result: boolean; result = _.stubTrue(); - result = _(any).stubTrue(); + result = _(anything).stubTrue(); } { @@ -13965,13 +13974,13 @@ namespace TestRangeRight { result = _([1]).chain().stubTrue(); result = _(['']).chain().stubTrue(); result = _({}).chain().stubTrue(); - result = _(any).chain().stubTrue(); + result = _(anything).chain().stubTrue(); } } // _.times namespace TestTimes { - let iteratee: (num: number) => TResult = (num: number) => ({ a: 1, b: "", c: true }); + let iteratee: (num: number) => AbcObject = (num: number) => ({ a: 1, b: "", c: true }); { let result: number[]; @@ -13981,7 +13990,7 @@ namespace TestTimes { } { - let result: TResult[]; + let result: AbcObject[]; result = _.times(42, iteratee); result = _(42).times(iteratee); @@ -13994,7 +14003,7 @@ namespace TestTimes { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(42).chain().times(iteratee); } diff --git a/types/lodash/math/add.d.ts b/types/lodash/math/add.d.ts index bed1f749f4..573178e0f4 100644 --- a/types/lodash/math/add.d.ts +++ b/types/lodash/math/add.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/ceil.d.ts b/types/lodash/math/ceil.d.ts index 4fcca60b3f..a51048c2f2 100644 --- a/types/lodash/math/ceil.d.ts +++ b/types/lodash/math/ceil.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/divide.d.ts b/types/lodash/math/divide.d.ts index 7a301014a4..be6bc0abbd 100644 --- a/types/lodash/math/divide.d.ts +++ b/types/lodash/math/divide.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/floor.d.ts b/types/lodash/math/floor.d.ts index edd71c16d4..81b490af1d 100644 --- a/types/lodash/math/floor.d.ts +++ b/types/lodash/math/floor.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/max.d.ts b/types/lodash/math/max.d.ts index 426c4c0fb7..20efcebef6 100644 --- a/types/lodash/math/max.d.ts +++ b/types/lodash/math/max.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/maxBy.d.ts b/types/lodash/math/maxBy.d.ts index 03be231888..adc787a911 100644 --- a/types/lodash/math/maxBy.d.ts +++ b/types/lodash/math/maxBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/mean.d.ts b/types/lodash/math/mean.d.ts index a67a1d7c33..ebaa42ce32 100644 --- a/types/lodash/math/mean.d.ts +++ b/types/lodash/math/mean.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/meanBy.d.ts b/types/lodash/math/meanBy.d.ts index 03bca381b8..a6bf558754 100644 --- a/types/lodash/math/meanBy.d.ts +++ b/types/lodash/math/meanBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/min.d.ts b/types/lodash/math/min.d.ts index be8e1c7caa..ac441afa83 100644 --- a/types/lodash/math/min.d.ts +++ b/types/lodash/math/min.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/minBy.d.ts b/types/lodash/math/minBy.d.ts index 1ddbe31c3a..fad6e5a284 100644 --- a/types/lodash/math/minBy.d.ts +++ b/types/lodash/math/minBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/multiply.d.ts b/types/lodash/math/multiply.d.ts index c86a73ec98..0767ee1154 100644 --- a/types/lodash/math/multiply.d.ts +++ b/types/lodash/math/multiply.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/round.d.ts b/types/lodash/math/round.d.ts index b4e0397220..59f97c3144 100644 --- a/types/lodash/math/round.d.ts +++ b/types/lodash/math/round.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/subtract.d.ts b/types/lodash/math/subtract.d.ts index 653b07a586..5b627db982 100644 --- a/types/lodash/math/subtract.d.ts +++ b/types/lodash/math/subtract.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/sum.d.ts b/types/lodash/math/sum.d.ts index 5b4499f0f5..ab9222900d 100644 --- a/types/lodash/math/sum.d.ts +++ b/types/lodash/math/sum.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/math/sumBy.d.ts b/types/lodash/math/sumBy.d.ts index dbb537283c..240dca6919 100644 --- a/types/lodash/math/sumBy.d.ts +++ b/types/lodash/math/sumBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/number/clamp.d.ts b/types/lodash/number/clamp.d.ts index 1ef3321b09..af2b47c995 100644 --- a/types/lodash/number/clamp.d.ts +++ b/types/lodash/number/clamp.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/number/inRange.d.ts b/types/lodash/number/inRange.d.ts index 499d71e8de..c3215a1c0f 100644 --- a/types/lodash/number/inRange.d.ts +++ b/types/lodash/number/inRange.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/number/random.d.ts b/types/lodash/number/random.d.ts index 621f29ffe9..a6522326f6 100644 --- a/types/lodash/number/random.d.ts +++ b/types/lodash/number/random.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/assign.d.ts b/types/lodash/object/assign.d.ts index e4a03fb995..17d282a8ec 100644 --- a/types/lodash/object/assign.d.ts +++ b/types/lodash/object/assign.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/assignIn.d.ts b/types/lodash/object/assignIn.d.ts index 1f877fb8af..01b38f7efa 100644 --- a/types/lodash/object/assignIn.d.ts +++ b/types/lodash/object/assignIn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/assignInWith.d.ts b/types/lodash/object/assignInWith.d.ts index 10a4c7297d..776a81b580 100644 --- a/types/lodash/object/assignInWith.d.ts +++ b/types/lodash/object/assignInWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type AssignCustomizer = (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; diff --git a/types/lodash/object/assignWith.d.ts b/types/lodash/object/assignWith.d.ts index e26494a3d6..4b98ad5e53 100644 --- a/types/lodash/object/assignWith.d.ts +++ b/types/lodash/object/assignWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/at.d.ts b/types/lodash/object/at.d.ts index a2b0bb926a..c95f8c9600 100644 --- a/types/lodash/object/at.d.ts +++ b/types/lodash/object/at.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/create.d.ts b/types/lodash/object/create.d.ts index f743b15022..836cc05425 100644 --- a/types/lodash/object/create.d.ts +++ b/types/lodash/object/create.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/defaults.d.ts b/types/lodash/object/defaults.d.ts index 908d44f364..956d5b4022 100644 --- a/types/lodash/object/defaults.d.ts +++ b/types/lodash/object/defaults.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/defaultsDeep.d.ts b/types/lodash/object/defaultsDeep.d.ts index 72985f8fe7..a9aa5d6b53 100644 --- a/types/lodash/object/defaultsDeep.d.ts +++ b/types/lodash/object/defaultsDeep.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/entries.d.ts b/types/lodash/object/entries.d.ts index 11925694c4..786b2a7abd 100644 --- a/types/lodash/object/entries.d.ts +++ b/types/lodash/object/entries.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/entriesIn.d.ts b/types/lodash/object/entriesIn.d.ts index d4a91f50bb..fcd378032e 100644 --- a/types/lodash/object/entriesIn.d.ts +++ b/types/lodash/object/entriesIn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/extend.d.ts b/types/lodash/object/extend.d.ts index d2a7a55200..3bdace2de1 100644 --- a/types/lodash/object/extend.d.ts +++ b/types/lodash/object/extend.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/extendWith.d.ts b/types/lodash/object/extendWith.d.ts index 9a6b1d1767..191c69dd8b 100644 --- a/types/lodash/object/extendWith.d.ts +++ b/types/lodash/object/extendWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/findKey.d.ts b/types/lodash/object/findKey.d.ts index f6fe55a2bd..2e35165e24 100644 --- a/types/lodash/object/findKey.d.ts +++ b/types/lodash/object/findKey.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/findLastKey.d.ts b/types/lodash/object/findLastKey.d.ts index 53f224d943..6a43330138 100644 --- a/types/lodash/object/findLastKey.d.ts +++ b/types/lodash/object/findLastKey.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/forIn.d.ts b/types/lodash/object/forIn.d.ts index a6f92dd690..7fa7e14a33 100644 --- a/types/lodash/object/forIn.d.ts +++ b/types/lodash/object/forIn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/forInRight.d.ts b/types/lodash/object/forInRight.d.ts index 72edd3a538..0364db0403 100644 --- a/types/lodash/object/forInRight.d.ts +++ b/types/lodash/object/forInRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/forOwn.d.ts b/types/lodash/object/forOwn.d.ts index 06d0c9e370..eeeb4adef6 100644 --- a/types/lodash/object/forOwn.d.ts +++ b/types/lodash/object/forOwn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/forOwnRight.d.ts b/types/lodash/object/forOwnRight.d.ts index d0526721fb..e760dfa78f 100644 --- a/types/lodash/object/forOwnRight.d.ts +++ b/types/lodash/object/forOwnRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/functions.d.ts b/types/lodash/object/functions.d.ts index 7226972151..bcc15d01e8 100644 --- a/types/lodash/object/functions.d.ts +++ b/types/lodash/object/functions.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/functionsIn.d.ts b/types/lodash/object/functionsIn.d.ts index e07972f0c0..84b8e88959 100644 --- a/types/lodash/object/functionsIn.d.ts +++ b/types/lodash/object/functionsIn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/get.d.ts b/types/lodash/object/get.d.ts index 04b66860d1..ff793192fb 100644 --- a/types/lodash/object/get.d.ts +++ b/types/lodash/object/get.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/has.d.ts b/types/lodash/object/has.d.ts index ddd762ad2e..53026153d1 100644 --- a/types/lodash/object/has.d.ts +++ b/types/lodash/object/has.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/hasIn.d.ts b/types/lodash/object/hasIn.d.ts index 05924d1c9d..5da20394b2 100644 --- a/types/lodash/object/hasIn.d.ts +++ b/types/lodash/object/hasIn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/invert.d.ts b/types/lodash/object/invert.d.ts index ebb0f2ebdf..d5c62aa9af 100644 --- a/types/lodash/object/invert.d.ts +++ b/types/lodash/object/invert.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/invertBy.d.ts b/types/lodash/object/invertBy.d.ts index 48b1fe6179..12b90969e1 100644 --- a/types/lodash/object/invertBy.d.ts +++ b/types/lodash/object/invertBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/invoke.d.ts b/types/lodash/object/invoke.d.ts index f51f6e35fb..9405c4fa6c 100644 --- a/types/lodash/object/invoke.d.ts +++ b/types/lodash/object/invoke.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/keys.d.ts b/types/lodash/object/keys.d.ts index af84fdab93..374e64ad2c 100644 --- a/types/lodash/object/keys.d.ts +++ b/types/lodash/object/keys.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/keysIn.d.ts b/types/lodash/object/keysIn.d.ts index 60efebf88a..fe05763414 100644 --- a/types/lodash/object/keysIn.d.ts +++ b/types/lodash/object/keysIn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/mapKeys.d.ts b/types/lodash/object/mapKeys.d.ts index dda3eecc9a..620977cdb1 100644 --- a/types/lodash/object/mapKeys.d.ts +++ b/types/lodash/object/mapKeys.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/mapValues.d.ts b/types/lodash/object/mapValues.d.ts index 9f30b1774b..e71e1c7f3e 100644 --- a/types/lodash/object/mapValues.d.ts +++ b/types/lodash/object/mapValues.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/merge.d.ts b/types/lodash/object/merge.d.ts index 70bcf5c5c2..0c18e6cfe5 100644 --- a/types/lodash/object/merge.d.ts +++ b/types/lodash/object/merge.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/mergeWith.d.ts b/types/lodash/object/mergeWith.d.ts index 42148ed3a8..01fb9264e6 100644 --- a/types/lodash/object/mergeWith.d.ts +++ b/types/lodash/object/mergeWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type MergeWithCustomizer = { bivariantHack(value: any, srcValue: any, key: string, object: any, source: any): any; }["bivariantHack"] diff --git a/types/lodash/object/omit.d.ts b/types/lodash/object/omit.d.ts index 6692221fc8..8684b37b61 100644 --- a/types/lodash/object/omit.d.ts +++ b/types/lodash/object/omit.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/omitBy.d.ts b/types/lodash/object/omitBy.d.ts index cf123af47a..d6c762e496 100644 --- a/types/lodash/object/omitBy.d.ts +++ b/types/lodash/object/omitBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/pick.d.ts b/types/lodash/object/pick.d.ts index d84e655efe..0561c58630 100644 --- a/types/lodash/object/pick.d.ts +++ b/types/lodash/object/pick.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/pickBy.d.ts b/types/lodash/object/pickBy.d.ts index dfe9023ba5..98b3c717dc 100644 --- a/types/lodash/object/pickBy.d.ts +++ b/types/lodash/object/pickBy.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/result.d.ts b/types/lodash/object/result.d.ts index 58814bb2a1..ea06014ae5 100644 --- a/types/lodash/object/result.d.ts +++ b/types/lodash/object/result.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/set.d.ts b/types/lodash/object/set.d.ts index 1d621b64d1..fe406347e7 100644 --- a/types/lodash/object/set.d.ts +++ b/types/lodash/object/set.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/setWith.d.ts b/types/lodash/object/setWith.d.ts index e347569709..63f470180b 100644 --- a/types/lodash/object/setWith.d.ts +++ b/types/lodash/object/setWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type SetWithCustomizer = (nsValue: any, key: string, nsObject: T) => any; diff --git a/types/lodash/object/toPairs.d.ts b/types/lodash/object/toPairs.d.ts index 12945f7941..42c4edab2f 100644 --- a/types/lodash/object/toPairs.d.ts +++ b/types/lodash/object/toPairs.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/toPairsIn.d.ts b/types/lodash/object/toPairsIn.d.ts index b9d1318cd6..ee6818c212 100644 --- a/types/lodash/object/toPairsIn.d.ts +++ b/types/lodash/object/toPairsIn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/transform.d.ts b/types/lodash/object/transform.d.ts index 67e16c4b86..817f51a4b2 100644 --- a/types/lodash/object/transform.d.ts +++ b/types/lodash/object/transform.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/unset.d.ts b/types/lodash/object/unset.d.ts index 8b473e48ba..0cf4b56f92 100644 --- a/types/lodash/object/unset.d.ts +++ b/types/lodash/object/unset.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/update.d.ts b/types/lodash/object/update.d.ts index 23db9431c4..4289efca72 100644 --- a/types/lodash/object/update.d.ts +++ b/types/lodash/object/update.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/updateWith.d.ts b/types/lodash/object/updateWith.d.ts index fc0b96ec35..4da0be8ce5 100644 --- a/types/lodash/object/updateWith.d.ts +++ b/types/lodash/object/updateWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/values.d.ts b/types/lodash/object/values.d.ts index 808335f9bc..d1dfa1177b 100644 --- a/types/lodash/object/values.d.ts +++ b/types/lodash/object/values.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/object/valuesIn.d.ts b/types/lodash/object/valuesIn.d.ts index a60a449c4e..22730438f5 100644 --- a/types/lodash/object/valuesIn.d.ts +++ b/types/lodash/object/valuesIn.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/seq/chain.d.ts b/types/lodash/seq/chain.d.ts index dedc92da2b..9edc42f881 100644 --- a/types/lodash/seq/chain.d.ts +++ b/types/lodash/seq/chain.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/seq/prototype.at.d.ts b/types/lodash/seq/prototype.at.d.ts index 01aa3c7f86..3a6a35d69b 100644 --- a/types/lodash/seq/prototype.at.d.ts +++ b/types/lodash/seq/prototype.at.d.ts @@ -1,4 +1,4 @@ -// import * as _ from "../index"; +// import _ = require("../index"); // declare module "../index" { // interface LoDashWrapper { // /** diff --git a/types/lodash/seq/prototype.chain.d.ts b/types/lodash/seq/prototype.chain.d.ts index dedc92da2b..9edc42f881 100644 --- a/types/lodash/seq/prototype.chain.d.ts +++ b/types/lodash/seq/prototype.chain.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/seq/prototype.commit.d.ts b/types/lodash/seq/prototype.commit.d.ts index 8d2393cb06..f22477f2f9 100644 --- a/types/lodash/seq/prototype.commit.d.ts +++ b/types/lodash/seq/prototype.commit.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashWrapper { /** diff --git a/types/lodash/seq/prototype.plant.d.ts b/types/lodash/seq/prototype.plant.d.ts index 72410991ec..6025b09381 100644 --- a/types/lodash/seq/prototype.plant.d.ts +++ b/types/lodash/seq/prototype.plant.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashImplicitWrapper { /** diff --git a/types/lodash/seq/prototype.reverse.d.ts b/types/lodash/seq/prototype.reverse.d.ts index 5bc1408784..66526e729b 100644 --- a/types/lodash/seq/prototype.reverse.d.ts +++ b/types/lodash/seq/prototype.reverse.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashWrapper { /** diff --git a/types/lodash/seq/prototype.toJSON.d.ts b/types/lodash/seq/prototype.toJSON.d.ts index d1838eaf2f..22da767aec 100644 --- a/types/lodash/seq/prototype.toJSON.d.ts +++ b/types/lodash/seq/prototype.toJSON.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashWrapper { /** diff --git a/types/lodash/seq/prototype.toString.d.ts b/types/lodash/seq/prototype.toString.d.ts index b829902207..4deef48ec0 100644 --- a/types/lodash/seq/prototype.toString.d.ts +++ b/types/lodash/seq/prototype.toString.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashWrapper { /** diff --git a/types/lodash/seq/prototype.value.d.ts b/types/lodash/seq/prototype.value.d.ts index 8a070267a5..9ba88a8250 100644 --- a/types/lodash/seq/prototype.value.d.ts +++ b/types/lodash/seq/prototype.value.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashWrapper { /** diff --git a/types/lodash/seq/prototype.valueOf.d.ts b/types/lodash/seq/prototype.valueOf.d.ts index 4b24dcc831..6a69f1f202 100644 --- a/types/lodash/seq/prototype.valueOf.d.ts +++ b/types/lodash/seq/prototype.valueOf.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashWrapper { /** diff --git a/types/lodash/seq/tap.d.ts b/types/lodash/seq/tap.d.ts index 14bff06e0d..dd4fc8d754 100644 --- a/types/lodash/seq/tap.d.ts +++ b/types/lodash/seq/tap.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/seq/thru.d.ts b/types/lodash/seq/thru.d.ts index 537431fee1..295011945a 100644 --- a/types/lodash/seq/thru.d.ts +++ b/types/lodash/seq/thru.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/camelCase.d.ts b/types/lodash/string/camelCase.d.ts index 3e92da188f..8362137353 100644 --- a/types/lodash/string/camelCase.d.ts +++ b/types/lodash/string/camelCase.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/capitalize.d.ts b/types/lodash/string/capitalize.d.ts index 0c4086db98..678f1c1de6 100644 --- a/types/lodash/string/capitalize.d.ts +++ b/types/lodash/string/capitalize.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/deburr.d.ts b/types/lodash/string/deburr.d.ts index 8e01b0c13a..85d3476be1 100644 --- a/types/lodash/string/deburr.d.ts +++ b/types/lodash/string/deburr.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/endsWith.d.ts b/types/lodash/string/endsWith.d.ts index 3261b90642..383c0acc41 100644 --- a/types/lodash/string/endsWith.d.ts +++ b/types/lodash/string/endsWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/escape.d.ts b/types/lodash/string/escape.d.ts index 4ef334a935..21131ee05f 100644 --- a/types/lodash/string/escape.d.ts +++ b/types/lodash/string/escape.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/escapeRegExp.d.ts b/types/lodash/string/escapeRegExp.d.ts index f21adb380e..a05b2b80ab 100644 --- a/types/lodash/string/escapeRegExp.d.ts +++ b/types/lodash/string/escapeRegExp.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/kebabCase.d.ts b/types/lodash/string/kebabCase.d.ts index 9c8527f4e4..eac11176a7 100644 --- a/types/lodash/string/kebabCase.d.ts +++ b/types/lodash/string/kebabCase.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/lowerCase.d.ts b/types/lodash/string/lowerCase.d.ts index 25db8151db..5349f3af18 100644 --- a/types/lodash/string/lowerCase.d.ts +++ b/types/lodash/string/lowerCase.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/lowerFirst.d.ts b/types/lodash/string/lowerFirst.d.ts index 4dc55d3590..54cacab3e6 100644 --- a/types/lodash/string/lowerFirst.d.ts +++ b/types/lodash/string/lowerFirst.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/pad.d.ts b/types/lodash/string/pad.d.ts index 2de1a43c36..d47f48afad 100644 --- a/types/lodash/string/pad.d.ts +++ b/types/lodash/string/pad.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/padEnd.d.ts b/types/lodash/string/padEnd.d.ts index cb27815729..ed4c552705 100644 --- a/types/lodash/string/padEnd.d.ts +++ b/types/lodash/string/padEnd.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/padStart.d.ts b/types/lodash/string/padStart.d.ts index e73fbf9923..02f2ce2752 100644 --- a/types/lodash/string/padStart.d.ts +++ b/types/lodash/string/padStart.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/parseInt.d.ts b/types/lodash/string/parseInt.d.ts index ec786dadae..082b45617d 100644 --- a/types/lodash/string/parseInt.d.ts +++ b/types/lodash/string/parseInt.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/repeat.d.ts b/types/lodash/string/repeat.d.ts index f634895d94..a72cda78b1 100644 --- a/types/lodash/string/repeat.d.ts +++ b/types/lodash/string/repeat.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/replace.d.ts b/types/lodash/string/replace.d.ts index 30284543d8..9245e2d712 100644 --- a/types/lodash/string/replace.d.ts +++ b/types/lodash/string/replace.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/snakeCase.d.ts b/types/lodash/string/snakeCase.d.ts index ffeb9ce551..efdaac05d0 100644 --- a/types/lodash/string/snakeCase.d.ts +++ b/types/lodash/string/snakeCase.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/split.d.ts b/types/lodash/string/split.d.ts index 73c0084798..e964d851ce 100644 --- a/types/lodash/string/split.d.ts +++ b/types/lodash/string/split.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/startCase.d.ts b/types/lodash/string/startCase.d.ts index dcb0ac8118..19e0551bf6 100644 --- a/types/lodash/string/startCase.d.ts +++ b/types/lodash/string/startCase.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/startsWith.d.ts b/types/lodash/string/startsWith.d.ts index 5185f48ac1..6090c2ed69 100644 --- a/types/lodash/string/startsWith.d.ts +++ b/types/lodash/string/startsWith.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/template.d.ts b/types/lodash/string/template.d.ts index ed1f6444da..a876c72fd8 100644 --- a/types/lodash/string/template.d.ts +++ b/types/lodash/string/template.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface TemplateOptions extends TemplateSettings { /** diff --git a/types/lodash/string/toLower.d.ts b/types/lodash/string/toLower.d.ts index 3fd92d0ca7..522014d583 100644 --- a/types/lodash/string/toLower.d.ts +++ b/types/lodash/string/toLower.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/toUpper.d.ts b/types/lodash/string/toUpper.d.ts index b2fd186b8a..5b2215685b 100644 --- a/types/lodash/string/toUpper.d.ts +++ b/types/lodash/string/toUpper.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/trim.d.ts b/types/lodash/string/trim.d.ts index f9636c232e..47e2a81d36 100644 --- a/types/lodash/string/trim.d.ts +++ b/types/lodash/string/trim.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/trimEnd.d.ts b/types/lodash/string/trimEnd.d.ts index 6f866e9a73..1af345dd74 100644 --- a/types/lodash/string/trimEnd.d.ts +++ b/types/lodash/string/trimEnd.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/trimStart.d.ts b/types/lodash/string/trimStart.d.ts index 255a13f2e9..1055f6b1d3 100644 --- a/types/lodash/string/trimStart.d.ts +++ b/types/lodash/string/trimStart.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/truncate.d.ts b/types/lodash/string/truncate.d.ts index 98a67d4671..23d4039356 100644 --- a/types/lodash/string/truncate.d.ts +++ b/types/lodash/string/truncate.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface TruncateOptions { /** The maximum string length. */ diff --git a/types/lodash/string/unescape.d.ts b/types/lodash/string/unescape.d.ts index 8a5c5e8cfc..3e2be90abb 100644 --- a/types/lodash/string/unescape.d.ts +++ b/types/lodash/string/unescape.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/upperCase.d.ts b/types/lodash/string/upperCase.d.ts index 11e7354c60..d33b6885b9 100644 --- a/types/lodash/string/upperCase.d.ts +++ b/types/lodash/string/upperCase.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/upperFirst.d.ts b/types/lodash/string/upperFirst.d.ts index f8f2e1ecd8..692aa702cd 100644 --- a/types/lodash/string/upperFirst.d.ts +++ b/types/lodash/string/upperFirst.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/string/words.d.ts b/types/lodash/string/words.d.ts index 4ff9508d1b..4ca4530513 100644 --- a/types/lodash/string/words.d.ts +++ b/types/lodash/string/words.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/attempt.d.ts b/types/lodash/util/attempt.d.ts index 6d8d140742..b539421d13 100644 --- a/types/lodash/util/attempt.d.ts +++ b/types/lodash/util/attempt.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/bindAll.d.ts b/types/lodash/util/bindAll.d.ts index 6e78003bff..1ebe05fe60 100644 --- a/types/lodash/util/bindAll.d.ts +++ b/types/lodash/util/bindAll.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/cond.d.ts b/types/lodash/util/cond.d.ts index ec34302904..036f518184 100644 --- a/types/lodash/util/cond.d.ts +++ b/types/lodash/util/cond.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/conforms.d.ts b/types/lodash/util/conforms.d.ts index 9ffd984ffe..9da61cedd1 100644 --- a/types/lodash/util/conforms.d.ts +++ b/types/lodash/util/conforms.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { type ConformsPredicateObject = { [P in keyof T]?: (val: T[P]) => boolean; diff --git a/types/lodash/util/constant.d.ts b/types/lodash/util/constant.d.ts index a0f5742342..9255171af1 100644 --- a/types/lodash/util/constant.d.ts +++ b/types/lodash/util/constant.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/defaultTo.d.ts b/types/lodash/util/defaultTo.d.ts index 1bb533f8cf..ced0e976c5 100644 --- a/types/lodash/util/defaultTo.d.ts +++ b/types/lodash/util/defaultTo.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/flow.d.ts b/types/lodash/util/flow.d.ts index 49f28d0678..90736c5da4 100644 --- a/types/lodash/util/flow.d.ts +++ b/types/lodash/util/flow.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/flowRight.d.ts b/types/lodash/util/flowRight.d.ts index 358ea933a3..e61f162ce3 100644 --- a/types/lodash/util/flowRight.d.ts +++ b/types/lodash/util/flowRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/identity.d.ts b/types/lodash/util/identity.d.ts index 9ecc96fd8d..6fff4525ad 100644 --- a/types/lodash/util/identity.d.ts +++ b/types/lodash/util/identity.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/iteratee.d.ts b/types/lodash/util/iteratee.d.ts index d80d154e85..b41c6d3cf2 100644 --- a/types/lodash/util/iteratee.d.ts +++ b/types/lodash/util/iteratee.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/matches.d.ts b/types/lodash/util/matches.d.ts index d5147ccb78..b919ffbbcc 100644 --- a/types/lodash/util/matches.d.ts +++ b/types/lodash/util/matches.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/matchesProperty.d.ts b/types/lodash/util/matchesProperty.d.ts index c96d2422a8..fc574be4f9 100644 --- a/types/lodash/util/matchesProperty.d.ts +++ b/types/lodash/util/matchesProperty.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/method.d.ts b/types/lodash/util/method.d.ts index 23b1600bc9..09c508caef 100644 --- a/types/lodash/util/method.d.ts +++ b/types/lodash/util/method.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/methodOf.d.ts b/types/lodash/util/methodOf.d.ts index acd9afa335..4ec4d15515 100644 --- a/types/lodash/util/methodOf.d.ts +++ b/types/lodash/util/methodOf.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/mixin.d.ts b/types/lodash/util/mixin.d.ts index 230b355322..02237ae751 100644 --- a/types/lodash/util/mixin.d.ts +++ b/types/lodash/util/mixin.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface MixinOptions { chain?: boolean; diff --git a/types/lodash/util/noConflict.d.ts b/types/lodash/util/noConflict.d.ts index 948ba75863..80ecca9f10 100644 --- a/types/lodash/util/noConflict.d.ts +++ b/types/lodash/util/noConflict.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/noop.d.ts b/types/lodash/util/noop.d.ts index c6b0475f69..ca66677e57 100644 --- a/types/lodash/util/noop.d.ts +++ b/types/lodash/util/noop.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/nthArg.d.ts b/types/lodash/util/nthArg.d.ts index 69a6087424..c5b6b0d5db 100644 --- a/types/lodash/util/nthArg.d.ts +++ b/types/lodash/util/nthArg.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/over.d.ts b/types/lodash/util/over.d.ts index 7b98d05618..2b4b49f573 100644 --- a/types/lodash/util/over.d.ts +++ b/types/lodash/util/over.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/overEvery.d.ts b/types/lodash/util/overEvery.d.ts index e88b3f2a27..d061d3ec72 100644 --- a/types/lodash/util/overEvery.d.ts +++ b/types/lodash/util/overEvery.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/overSome.d.ts b/types/lodash/util/overSome.d.ts index b177805dc2..1ff92f8d42 100644 --- a/types/lodash/util/overSome.d.ts +++ b/types/lodash/util/overSome.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/property.d.ts b/types/lodash/util/property.d.ts index 72658a89dc..8edab90248 100644 --- a/types/lodash/util/property.d.ts +++ b/types/lodash/util/property.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/propertyOf.d.ts b/types/lodash/util/propertyOf.d.ts index 2bfab04f86..cc272ec7bf 100644 --- a/types/lodash/util/propertyOf.d.ts +++ b/types/lodash/util/propertyOf.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/range.d.ts b/types/lodash/util/range.d.ts index f92af4de75..35bf7e3d2e 100644 --- a/types/lodash/util/range.d.ts +++ b/types/lodash/util/range.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/rangeRight.d.ts b/types/lodash/util/rangeRight.d.ts index b63da90370..ced80d5968 100644 --- a/types/lodash/util/rangeRight.d.ts +++ b/types/lodash/util/rangeRight.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/runInContext.d.ts b/types/lodash/util/runInContext.d.ts index 4bd523e96c..38fb1ff6b1 100644 --- a/types/lodash/util/runInContext.d.ts +++ b/types/lodash/util/runInContext.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/stubArray.d.ts b/types/lodash/util/stubArray.d.ts index 92b1bbeba1..b8440b7f25 100644 --- a/types/lodash/util/stubArray.d.ts +++ b/types/lodash/util/stubArray.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/stubFalse.d.ts b/types/lodash/util/stubFalse.d.ts index deb8d92543..394bdc5cce 100644 --- a/types/lodash/util/stubFalse.d.ts +++ b/types/lodash/util/stubFalse.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/stubObject.d.ts b/types/lodash/util/stubObject.d.ts index 2fa401fa75..877decfcf0 100644 --- a/types/lodash/util/stubObject.d.ts +++ b/types/lodash/util/stubObject.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/stubString.d.ts b/types/lodash/util/stubString.d.ts index 8badcdf7f6..6967aafc14 100644 --- a/types/lodash/util/stubString.d.ts +++ b/types/lodash/util/stubString.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/stubTrue.d.ts b/types/lodash/util/stubTrue.d.ts index 1191db4cfb..2a18d82e88 100644 --- a/types/lodash/util/stubTrue.d.ts +++ b/types/lodash/util/stubTrue.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/times.d.ts b/types/lodash/util/times.d.ts index 9860d13ea6..1056080ebf 100644 --- a/types/lodash/util/times.d.ts +++ b/types/lodash/util/times.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/toPath.d.ts b/types/lodash/util/toPath.d.ts index 74905ff4ef..e98a9eb30f 100644 --- a/types/lodash/util/toPath.d.ts +++ b/types/lodash/util/toPath.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/lodash/util/uniqueId.d.ts b/types/lodash/util/uniqueId.d.ts index 7f1e8c252f..75bedcaa94 100644 --- a/types/lodash/util/uniqueId.d.ts +++ b/types/lodash/util/uniqueId.d.ts @@ -1,4 +1,4 @@ -import * as _ from "../index"; +import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** diff --git a/types/material-components-web/index.d.ts b/types/material-components-web/index.d.ts new file mode 100644 index 0000000000..c5d1434942 --- /dev/null +++ b/types/material-components-web/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import autoInit from 'material__auto-init'; +import * as base from 'material__base'; +import * as checkbox from 'material__checkbox'; +import * as dialog from 'material__dialog'; +import * as drawer from 'material__drawer'; +import * as formField from 'material__form-field'; +import * as gridList from 'material__grid-list'; +import * as iconToggle from 'material__icon-toggle'; +import * as linearProgress from 'material__linear-progress'; +import * as menu from 'material__menu'; +import * as radio from 'material__radio'; +import * as ripple from 'material__ripple'; +import * as select from 'material__select'; +import * as selectionControl from 'material__selection-control'; +import * as slider from 'material__slider'; +import * as snackbar from 'material__snackbar'; +import * as tabs from 'material__tabs'; +import * as textField from 'material__textfield'; +import * as toolbar from 'material__toolbar'; + +// Export all components. +export { + autoInit, + base, + checkbox, + dialog, + drawer, + formField, + gridList, + iconToggle, + linearProgress, + menu, + radio, + ripple, + select, + selectionControl, + slider, + snackbar, + tabs, + textField, + toolbar, +}; diff --git a/types/material-components-web/tsconfig.json b/types/material-components-web/tsconfig.json new file mode 100644 index 0000000000..72ab99ccfc --- /dev/null +++ b/types/material-components-web/tsconfig.json @@ -0,0 +1,23 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material-components-web/tslint.json b/types/material-components-web/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material-components-web/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__animation/index.d.ts b/types/material__animation/index.d.ts new file mode 100644 index 0000000000..8baf562003 --- /dev/null +++ b/types/material__animation/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const transformStyleProperties: string[]; + +export function getCorrectEventName(windowObj: Window, eventType: string): string; + +export function getCorrectPropertyName(windowObj: Window, eventType: string): string; diff --git a/types/material__animation/tsconfig.json b/types/material__animation/tsconfig.json new file mode 100644 index 0000000000..d25bb531d1 --- /dev/null +++ b/types/material__animation/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__animation/tslint.json b/types/material__animation/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__animation/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__auto-init/index.d.ts b/types/material__auto-init/index.d.ts new file mode 100644 index 0000000000..026b692b99 --- /dev/null +++ b/types/material__auto-init/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type MDCLogger = (message?: any, ...optionalParams: any[]) => void; + +export interface MDCAutoInit { + (root?: Document, warn?: MDCLogger): MDCAutoInit; + register(componentName: string, Ctor: (...args: any[]) => any, warn?: MDCLogger): void; + deregister(componentName: string): void; + deregisterAll(): void; +} + +/** + * Auto-initializes all mdc components on a page. + */ +declare const mdcAutoInit: MDCAutoInit; + +export default mdcAutoInit; diff --git a/types/material__auto-init/tsconfig.json b/types/material__auto-init/tsconfig.json new file mode 100644 index 0000000000..d25bb531d1 --- /dev/null +++ b/types/material__auto-init/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__auto-init/tslint.json b/types/material__auto-init/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__auto-init/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__base/component.d.ts b/types/material__base/component.d.ts new file mode 100644 index 0000000000..0a645b26a4 --- /dev/null +++ b/types/material__base/component.d.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from './foundation'; + +export class MDCComponent> { + static attachTo(root: Element): MDCComponent>; + + constructor(root: Element, foundation?: F, ...args: any[]); + + // Subclasses can override this to do any additional setup work that would be considered part of a + // "constructor". Essentially, it is a hook into the parent constructor before the foundation is + // initialized. Any additional arguments besides root and foundation will be passed in here. + initialize(...args: any[]): void; + + // Subclasses must override this method to return a properly configured foundation class for the + // component. + getDefaultFoundation(): F; + + // Subclasses should override this method if they need to perform work to synchronize with a host DOM + // object. An example of this would be a form control wrapper that needs to synchronize its internal state + // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM + // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor. + initialSyncWithDOM(): void; + + // Subclasses may implement this method to release any resources / deregister any listeners they have + // attached. An example of this might be deregistering a resize event from the window object. + destroy(): void; + + /** + * Wrapper method to add an event listener to the component's root element. This is most useful when + * listening for custom events. + */ + listen(evtType: string, handler: EventListenerOrEventListenerObject): void; + + /** + * Wrapper method to remove an event listener to the component's root element. This is most useful when + * unlistening for custom events. + */ + unlisten(evtType: string, handler: EventListenerOrEventListenerObject): void; + + /** + * Fires a cross-browser-compatible custom event from the component root of the given type, + * with the given data. + */ + emit(evtType: string, evtData: any, shouldBubble?: boolean): void; +} + +export default MDCComponent; diff --git a/types/material__base/foundation.d.ts b/types/material__base/foundation.d.ts new file mode 100644 index 0000000000..7612d0daea --- /dev/null +++ b/types/material__base/foundation.d.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCStrings { + [key: string]: string; +} + +export interface MDCNumbers { + [key: string]: number; +} + +export class MDCFoundation { + static readonly cssClasses: MDCStrings; + + static readonly strings: MDCStrings; + + static readonly numbers: MDCNumbers; + + static readonly defaultAdapter: any; + + constructor(adapter: A); + + // Subclasses should override this method to perform initialization routines (registering events, etc.) + init(): void; + + // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.) + destroy(): void; +} + +export default MDCFoundation; diff --git a/types/material__base/index.d.ts b/types/material__base/index.d.ts new file mode 100644 index 0000000000..0172cb35f6 --- /dev/null +++ b/types/material__base/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCNumbers, MDCStrings, MDCFoundation } from './foundation'; +import MDCComponent from './component'; + +export {MDCNumbers, MDCStrings, MDCFoundation, MDCComponent}; diff --git a/types/material__base/tsconfig.json b/types/material__base/tsconfig.json new file mode 100644 index 0000000000..4f144a4c20 --- /dev/null +++ b/types/material__base/tsconfig.json @@ -0,0 +1,26 @@ +{ + "files": [ + "component.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__base/tslint.json b/types/material__base/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__base/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__checkbox/adapter.d.ts b/types/material__checkbox/adapter.d.ts new file mode 100644 index 0000000000..aedeed30f5 --- /dev/null +++ b/types/material__checkbox/adapter.d.ts @@ -0,0 +1,54 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSelectionControlState } from 'material__selection-control'; + +/** + * Adapter for MDC Checkbox. Provides an interface for managing + * - classes + * - dom + * - event handlers + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + */ +export class MDCCheckboxAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerAnimationEndHandler(handler: EventListener): void; + + deregisterAnimationEndHandler(handler: EventListener): void; + + registerChangeHandler(handler: EventListener): void; + + deregisterChangeHandler(handler: EventListener): void; + + getNativeControl(): MDCSelectionControlState; + + forceLayout(): void; + + isAttachedToDOM(): boolean; +} + +export default MDCCheckboxAdapter; diff --git a/types/material__checkbox/constants.d.ts b/types/material__checkbox/constants.d.ts new file mode 100644 index 0000000000..ee665f4c05 --- /dev/null +++ b/types/material__checkbox/constants.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + UPGRADED: 'mdc-checkbox--upgraded'; + CHECKED: 'mdc-checkbox--checked'; + INDETERMINATE: 'mdc-checkbox--indeterminate'; + DISABLED: 'mdc-checkbox--disabled'; + ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked'; + ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate'; + ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked'; + ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate'; + ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked'; + ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'; +} + +export interface strings extends MDCStrings { + NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control'; + TRANSITION_STATE_INIT: 'init'; + TRANSITION_STATE_CHECKED: 'checked'; + TRANSITION_STATE_UNCHECKED: 'unchecked'; + TRANSITION_STATE_INDETERMINATE: 'indeterminate'; +} + +export interface numbers extends MDCNumbers { + ANIM_END_LATCH_MS: 100; +} diff --git a/types/material__checkbox/foundation.d.ts b/types/material__checkbox/foundation.d.ts new file mode 100644 index 0000000000..73216efcd6 --- /dev/null +++ b/types/material__checkbox/foundation.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCCheckboxAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; + +export class MDCCheckboxFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCCheckboxAdapter; + + isChecked(): boolean; + + setChecked(checked: boolean): boolean; + + isIndeterminate(): boolean; + + setIndeterminate(indeterminate: boolean): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + getValue(): string; + + setValue(value: string): void; +} + +export default MDCCheckboxFoundation; diff --git a/types/material__checkbox/index.d.ts b/types/material__checkbox/index.d.ts new file mode 100644 index 0000000000..9190c3d5a9 --- /dev/null +++ b/types/material__checkbox/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCCheckboxAdapter from './adapter'; +import { MDCSelectionControl } from 'material__selection-control'; +import MDCCheckboxFoundation from './foundation'; +import { MDCRipple } from 'material__ripple'; + +export {MDCCheckboxAdapter, MDCCheckboxFoundation}; + +export class MDCCheckbox extends MDCComponent implements MDCSelectionControl { + static attachTo(root: Element): MDCCheckbox; + + getDefaultFoundation(): MDCCheckboxFoundation; + + readonly ripple: MDCRipple; + + checked: boolean; + + indeterminate: boolean; + + disabled: boolean; + + value: string; + + destroy(): void; +} diff --git a/types/material__checkbox/tsconfig.json b/types/material__checkbox/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__checkbox/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__checkbox/tslint.json b/types/material__checkbox/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__checkbox/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__dialog/adapter.d.ts b/types/material__dialog/adapter.d.ts new file mode 100644 index 0000000000..fd6bc3cf9f --- /dev/null +++ b/types/material__dialog/adapter.d.ts @@ -0,0 +1,55 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MSDDialogAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + addBodyClass(className: string): void; + + removeBodyClass(className: string): void; + + eventTargetHasClass(target: EventTarget, className: string): boolean; + + registerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterInteractionHandler(evt: string, handler: EventListener): void; + + registerSurfaceInteractionHandler(evt: string, handler: EventListener): void; + + deregisterSurfaceInteractionHandler(evt: string, handler: EventListener): void; + + registerDocumentKeydownHandler(handler: EventListener): void; + + deregisterDocumentKeydownHandler(handler: EventListener): void; + + registerTransitionEndHandler(handler: EventListener): void; + + deregisterTransitionEndHandler(handler: EventListener): void; + + notifyAccept(): void; + + notifyCancel(): void; + + trapFocusOnSurface(): void; + + untrapFocusOnSurface(): void; + + isDialog(el: Element): boolean; + + layoutFooterRipples(): void; +} diff --git a/types/material__dialog/constants.d.ts b/types/material__dialog/constants.d.ts new file mode 100644 index 0000000000..a45628627c --- /dev/null +++ b/types/material__dialog/constants.d.ts @@ -0,0 +1,35 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-dialog'; + OPEN: 'mdc-dialog--open'; + ANIMATING: 'mdc-dialog--animating'; + BACKDROP: 'mdc-dialog__backdrop'; + SCROLL_LOCK: 'mdc-dialog-scroll-lock'; + ACCEPT_BTN: 'mdc-dialog__footer__button--accept'; + CANCEL_BTN: 'mdc-dialog__footer__button--cancel'; +} + +export interface strings extends MDCStrings { + OPEN_DIALOG_SELECTOR: '.mdc-dialog--open'; + DIALOG_SURFACE_SELECTOR: '.mdc-dialog__surface'; + ACCEPT_SELECTOR: '.mdc-dialog__footer__button--accept'; + ACCEPT_EVENT: 'MDCDialog:accept'; + CANCEL_EVENT: 'MDCDialog:cancel'; +} diff --git a/types/material__dialog/foundation.d.ts b/types/material__dialog/foundation.d.ts new file mode 100644 index 0000000000..f28c541dd2 --- /dev/null +++ b/types/material__dialog/foundation.d.ts @@ -0,0 +1,39 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings } from './constants'; +import { MSDDialogAdapter } from './adapter'; + +export class MDCDialogFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MSDDialogAdapter; + + open(): void; + + close(): void; + + isOpen(): boolean; + + accept(shouldNotify: boolean): void; + + cancel(shouldNotify: boolean): void; +} + +export default MDCDialogFoundation; diff --git a/types/material__dialog/index.d.ts b/types/material__dialog/index.d.ts new file mode 100644 index 0000000000..7d8ab69e30 --- /dev/null +++ b/types/material__dialog/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCRipple } from 'material__ripple'; + +import MDCDialogFoundation from './foundation'; +import { MSDDialogAdapter } from './adapter'; +import * as util from './util'; + +export {MSDDialogAdapter, MDCDialogFoundation, util}; + +export class MDCDialog extends MDCComponent { + static attachTo(root: Element): MDCDialog; + + readonly open: boolean; + + initialize(): void; + + destroy(): void; + + show(): void; + + close(): void; + + getDefaultFoundation(): MDCDialogFoundation; +} diff --git a/types/material__dialog/tsconfig.json b/types/material__dialog/tsconfig.json new file mode 100644 index 0000000000..3feaa72ba5 --- /dev/null +++ b/types/material__dialog/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__dialog/tslint.json b/types/material__dialog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__dialog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__dialog/util.d.ts b/types/material__dialog/util.d.ts new file mode 100644 index 0000000000..cfc7e3fda0 --- /dev/null +++ b/types/material__dialog/util.d.ts @@ -0,0 +1,19 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type MDCFocusTrapFactory = (a: Element, b: {initialFocus: Element, clickOutsideDeactivates: boolean}) => any; + +export function createFocusTrapInstance(surfaceEl: Element, acceptButtonEl: Element, focusTrapFactory?: MDCFocusTrapFactory): any; diff --git a/types/material__drawer/index.d.ts b/types/material__drawer/index.d.ts new file mode 100644 index 0000000000..379ed35599 --- /dev/null +++ b/types/material__drawer/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as util from './util'; +export {MDCSlidableDrawerAdapter} from './slidable'; +export {MDCTemporaryDrawer, MDCTemporaryDrawerFoundation} from './temporary'; +export {MDCPersistentDrawer, MDCPersistentDrawerFoundation} from './persistent'; +export {util}; diff --git a/types/material__drawer/persistent/constants.d.ts b/types/material__drawer/persistent/constants.d.ts new file mode 100644 index 0000000000..3d5f7c56ba --- /dev/null +++ b/types/material__drawer/persistent/constants.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-persistent-drawer'; + OPEN: 'mdc-persistent-drawer--open'; + ANIMATING: 'mdc-persistent-drawer--animating'; +} + +export interface strings extends MDCStrings { + DRAWER_SELECTOR: '.mdc-persistent-drawer__drawer'; + FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]'; + OPEN_EVENT: 'MDCPersistentDrawer:open'; + CLOSE_EVENT: 'MDCPersistentDrawer:close'; +} diff --git a/types/material__drawer/persistent/foundation.d.ts b/types/material__drawer/persistent/foundation.d.ts new file mode 100644 index 0000000000..7d4d53f884 --- /dev/null +++ b/types/material__drawer/persistent/foundation.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSlidableDrawerAdapter, MDCSlidableDrawerFoundation } from '../slidable'; +import { cssClasses, strings } from './constants'; + +export class MDCPersistentDrawerFoundation extends MDCSlidableDrawerFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSlidableDrawerAdapter; +} + +export default MDCPersistentDrawerFoundation; diff --git a/types/material__drawer/persistent/index.d.ts b/types/material__drawer/persistent/index.d.ts new file mode 100644 index 0000000000..1c2286fd01 --- /dev/null +++ b/types/material__drawer/persistent/index.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCPersistentDrawerFoundation } from './foundation'; +import { MDCSlidableDrawerAdapter } from '../slidable'; +import * as util from '../util'; + +export {MDCSlidableDrawerAdapter, MDCPersistentDrawerFoundation, util}; + +export class MDCPersistentDrawer extends MDCComponent { + static attachTo(root: Element): MDCPersistentDrawer; + + open: boolean; + + // Return the drawer element inside the component. + readonly drawer: Element | null; + + getDefaultFoundation(): MDCPersistentDrawerFoundation; +} diff --git a/types/material__drawer/slidable/adapter.d.ts b/types/material__drawer/slidable/adapter.d.ts new file mode 100644 index 0000000000..3659742558 --- /dev/null +++ b/types/material__drawer/slidable/adapter.d.ts @@ -0,0 +1,59 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSlidableDrawerAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + hasClass(className: string): void; + + hasNecessaryDom(): boolean; + + registerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterInteractionHandler(evt: string, handler: EventListener): void; + + registerDrawerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterDrawerInteractionHandler(evt: string, handler: EventListener): void; + + registerTransitionEndHandler(handler: EventListener): void; + + deregisterTransitionEndHandler(handler: EventListener): void; + + registerDocumentKeydownHandler(handler: EventListener): void; + + deregisterDocumentKeydownHandler(handler: EventListener): void; + + setTranslateX(value: number | null): void; + + getFocusableElements(): NodeList; + + saveElementTabState(el: Element): void; + + restoreElementTabState(el: Element): void; + + makeElementUntabbable(el: Element): void; + + notifyOpen(): void; + + notifyClose(): void; + + isRtl(): boolean; + + getDrawerWidth(): number; +} diff --git a/types/material__drawer/slidable/constants.d.ts b/types/material__drawer/slidable/constants.d.ts new file mode 100644 index 0000000000..bfae67fa90 --- /dev/null +++ b/types/material__drawer/slidable/constants.d.ts @@ -0,0 +1,17 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const FOCUSABLE_ELEMENTS: string; diff --git a/types/material__drawer/slidable/foundation.d.ts b/types/material__drawer/slidable/foundation.d.ts new file mode 100644 index 0000000000..60995e0a95 --- /dev/null +++ b/types/material__drawer/slidable/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { MDCSlidableDrawerAdapter } from './adapter'; + +export class MDCSlidableDrawerFoundation extends MDCFoundation { + static readonly defaultAdapter: MDCSlidableDrawerAdapter; + + constructor(adapter: MDCSlidableDrawerAdapter, rootCssClass: string, animatingCssClass: string, openCssClass: string); + + open(): void; + + close(): void; + + isOpen(): boolean; +} diff --git a/types/material__drawer/slidable/index.d.ts b/types/material__drawer/slidable/index.d.ts new file mode 100644 index 0000000000..b56661948d --- /dev/null +++ b/types/material__drawer/slidable/index.d.ts @@ -0,0 +1,19 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {FOCUSABLE_ELEMENTS} from './constants'; +export {MDCSlidableDrawerFoundation} from './foundation'; +export {MDCSlidableDrawerAdapter} from './adapter'; diff --git a/types/material__drawer/temporary/constants.d.ts b/types/material__drawer/temporary/constants.d.ts new file mode 100644 index 0000000000..b175492a82 --- /dev/null +++ b/types/material__drawer/temporary/constants.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-temporary-drawer'; + OPEN: 'mdc-temporary-drawer--open'; + ANIMATING: 'mdc-temporary-drawer--animating'; + SCROLL_LOCK: 'mdc-drawer-scroll-lock'; +} + +export interface strings extends MDCStrings { + DRAWER_SELECTOR: '.mdc-temporary-drawer__drawer'; + OPACITY_VAR_NAME: '--mdc-temporary-drawer-opacity'; + FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]'; + OPEN_EVENT: 'MDCTemporaryDrawer:open'; + CLOSE_EVENT: 'MDCTemporaryDrawer:close'; +} diff --git a/types/material__drawer/temporary/foundation.d.ts b/types/material__drawer/temporary/foundation.d.ts new file mode 100644 index 0000000000..df1763c274 --- /dev/null +++ b/types/material__drawer/temporary/foundation.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSlidableDrawerFoundation, MDCSlidableDrawerAdapter } from '../slidable'; +import { cssClasses, strings } from './constants'; + +export class MDCTemporaryDrawerFoundation extends MDCSlidableDrawerFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSlidableDrawerAdapter; + + open(): void; + + close(): void; +} + +export default MDCTemporaryDrawerFoundation; diff --git a/types/material__drawer/temporary/index.d.ts b/types/material__drawer/temporary/index.d.ts new file mode 100644 index 0000000000..4e27965e43 --- /dev/null +++ b/types/material__drawer/temporary/index.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import MDCTemporaryDrawerFoundation from './foundation'; +import { MDCSlidableDrawerAdapter } from '../slidable'; +import * as util from '../util'; + +export {MDCSlidableDrawerAdapter, MDCTemporaryDrawerFoundation, util}; + +export class MDCTemporaryDrawer extends MDCComponent { + static attachTo(root: Element): MDCTemporaryDrawer; + + open: boolean; + + /* Return the drawer element inside the component. */ + readonly drawer: Element | null; + + getDefaultFoundation(): MDCTemporaryDrawerFoundation; +} diff --git a/types/material__drawer/tsconfig.json b/types/material__drawer/tsconfig.json new file mode 100644 index 0000000000..ab4f18b399 --- /dev/null +++ b/types/material__drawer/tsconfig.json @@ -0,0 +1,35 @@ +{ + "files": [ + "persistent/constants.d.ts", + "persistent/index.d.ts", + "persistent/foundation.d.ts", + "slidable/constants.d.ts", + "slidable/adapter.d.ts", + "slidable/index.d.ts", + "slidable/foundation.d.ts", + "temporary/constants.d.ts", + "temporary/index.d.ts", + "temporary/foundation.d.ts", + "util.d.ts", + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__drawer/tslint.json b/types/material__drawer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__drawer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__drawer/util.d.ts b/types/material__drawer/util.d.ts new file mode 100644 index 0000000000..66fa930b43 --- /dev/null +++ b/types/material__drawer/util.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Remap touch events to pointer events, if the browser doesn't support touch events. +export function remapEvent(eventName: string, globalObj?: Window): string; + +// Choose the correct transform property to use on the current browser. +export function getTransformPropertyName(globalObj?: Window, forceRefresh?: boolean): string; + +// Determine whether the current browser supports CSS properties. +export function supportsCssCustomProperties(globalObj?: Window): boolean; + +// Determine whether the current browser supports passive event listeners, and if so, use them. +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean; + +// Save the tab state for an element. +export function saveElementTabState(el: Element): void; + +// Restore the tab state for an element, if it was saved. +export function restoreElementTabState(el: Element): void; diff --git a/types/material__form-field/adapter.d.ts b/types/material__form-field/adapter.d.ts new file mode 100644 index 0000000000..7033f363eb --- /dev/null +++ b/types/material__form-field/adapter.d.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Form Field. Provides an interface for managing + * - event handlers + * - ripple activation + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export class MDCFormFieldAdapter { + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + activateInputRipple(): void; + + deactivateInputRipple(): void; +} + +export default MDCFormFieldAdapter; diff --git a/types/material__form-field/constants.d.ts b/types/material__form-field/constants.d.ts new file mode 100644 index 0000000000..ba55acabcd --- /dev/null +++ b/types/material__form-field/constants.d.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-form-field'; +} + +export interface strings extends MDCStrings { + LABEL_SELECTOR: '.mdc-form-field > label'; +} diff --git a/types/material__form-field/foundation.d.ts b/types/material__form-field/foundation.d.ts new file mode 100644 index 0000000000..026beedfc2 --- /dev/null +++ b/types/material__form-field/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCFormFieldAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCFormFieldFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCFormFieldAdapter; +} + +export default MDCFormFieldFoundation; diff --git a/types/material__form-field/index.d.ts b/types/material__form-field/index.d.ts new file mode 100644 index 0000000000..1fcc30b4c4 --- /dev/null +++ b/types/material__form-field/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCFormFieldFoundation from './foundation'; +import MDCFormFieldAdapter from './adapter'; +import { MDCSelectionControl } from 'material__selection-control'; + +export {MDCFormFieldAdapter, MDCFormFieldFoundation}; + +export class MDCFormField extends MDCComponent { + static attachTo(root: Element): MDCFormField; + + input: MDCSelectionControl; + + getDefaultFoundation(): MDCFormFieldFoundation; +} diff --git a/types/material__form-field/tsconfig.json b/types/material__form-field/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__form-field/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__form-field/tslint.json b/types/material__form-field/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__form-field/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__grid-list/adapter.d.ts b/types/material__grid-list/adapter.d.ts new file mode 100644 index 0000000000..1dcbcbf251 --- /dev/null +++ b/types/material__grid-list/adapter.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCGridListAdapter { + getOffsetWidth(): number; + + getNumberOfTiles(): number; + + getOffsetWidthForTileAtIndex(index: number): number; + + setStyleForTilesElement(property: string, value: string): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; +} diff --git a/types/material__grid-list/constants.d.ts b/types/material__grid-list/constants.d.ts new file mode 100644 index 0000000000..22cf67bbfc --- /dev/null +++ b/types/material__grid-list/constants.d.ts @@ -0,0 +1,22 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + TILES_SELECTOR: '.mdc-grid-list__tiles'; + TILE_SELECTOR: '.mdc-grid-tile'; +} diff --git a/types/material__grid-list/foundation.d.ts b/types/material__grid-list/foundation.d.ts new file mode 100644 index 0000000000..04843273d6 --- /dev/null +++ b/types/material__grid-list/foundation.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { strings } from './constants'; +import { MDCGridListAdapter } from './adapter'; + +export class MDCGridListFoundation extends MDCFoundation { + static readonly strings: strings; + + static readonly defaultAdapter: MDCGridListAdapter; + + alignCenter(): void; +} + +export default MDCGridListFoundation; diff --git a/types/material__grid-list/index.d.ts b/types/material__grid-list/index.d.ts new file mode 100644 index 0000000000..2a1e98d912 --- /dev/null +++ b/types/material__grid-list/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCGridListAdapter } from './adapter'; +import MDCGridListFoundation from './foundation'; + +export {MDCGridListAdapter, MDCGridListFoundation}; + +export class MDCGridList extends MDCComponent { + static attachTo(root: Element): MDCGridList; + + getDefaultFoundation(): MDCGridListFoundation; +} diff --git a/types/material__grid-list/tsconfig.json b/types/material__grid-list/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__grid-list/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__grid-list/tslint.json b/types/material__grid-list/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__grid-list/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__icon-toggle/adapter.d.ts b/types/material__icon-toggle/adapter.d.ts new file mode 100644 index 0000000000..52481fe732 --- /dev/null +++ b/types/material__icon-toggle/adapter.d.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Icon Toggle. Provides an interface for managing + * - classes + * - dom + * - inner text + * - event handlers + * - event dispatch + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ + +export class MDCIconToggleAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + setText(text: string): void; + + getTabIndex(): number; + + setTabIndex(tabIndex: number): void; + + getAttr(name: string): string; + + setAttr(name: string, value: string): void; + + rmAttr(name: string): void; + + notifyChange(evtData: IconToggleEvent): void; +} + +export interface IconToggleEvent { + isOn: boolean; +} diff --git a/types/material__icon-toggle/constants.d.ts b/types/material__icon-toggle/constants.d.ts new file mode 100644 index 0000000000..e7140ecefa --- /dev/null +++ b/types/material__icon-toggle/constants.d.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-icon-toggle'; + DISABLED: 'mdc-icon-toggle--disabled'; +} + +export interface strings extends MDCStrings { + DATA_TOGGLE_ON: 'data-toggle-on'; + DATA_TOGGLE_OFF: 'data-toggle-off'; + ARIA_PRESSED: 'aria-pressed'; + ARIA_DISABLED: 'aria-disabled'; + ARIA_LABEL: 'aria-label'; + CHANGE_EVENT: 'MDCIconToggle:change'; +} diff --git a/types/material__icon-toggle/foundation.d.ts b/types/material__icon-toggle/foundation.d.ts new file mode 100644 index 0000000000..65d25c1307 --- /dev/null +++ b/types/material__icon-toggle/foundation.d.ts @@ -0,0 +1,64 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCIconToggleAdapter, IconToggleEvent } from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCIconToggleFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCIconToggleAdapter; + + refreshToggleData(): void; + + isOn(): boolean; + + toggle(isOn?: boolean): void; + + isDisabled(): boolean; + + setDisabled(isDisabled: boolean): void; + + isKeyboardActivated(): boolean; +} + +export interface KeyboardKey { + key: string; + keyCode: number; +} + +export function isSpace(keyboardKey: KeyboardKey): boolean; + +export class IconToggleState { + /** + * The aria-label value of the icon toggle, or undefined if there is no aria-label. + */ + label: string|undefined; + /** + * The text for the icon toggle, or undefined if there is no text. + */ + content: string|undefined; + /** + * The CSS class to add to the icon toggle, or undefined if there is no CSS class. + */ + cssClass: string|undefined; +} + +export default MDCIconToggleFoundation; diff --git a/types/material__icon-toggle/index.d.ts b/types/material__icon-toggle/index.d.ts new file mode 100644 index 0000000000..bfced0b532 --- /dev/null +++ b/types/material__icon-toggle/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCIconToggleFoundation from './foundation'; +import { MDCIconToggleAdapter } from './adapter'; +import { MDCRipple, MDCRippleFoundation } from 'material__ripple'; + +export {MDCIconToggleAdapter, MDCIconToggleFoundation}; + +export class MDCIconToggle extends MDCComponent { + static attachTo(root: Element): MDCIconToggle; + + destroy(): void; + + getDefaultFoundation(): MDCIconToggleFoundation; + + initialSyncWithDOM(): void; + + readonly ripple: MDCRipple; + + on: boolean; + + disabled: boolean; + + refreshToggleData(): void; +} diff --git a/types/material__icon-toggle/tsconfig.json b/types/material__icon-toggle/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__icon-toggle/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__icon-toggle/tslint.json b/types/material__icon-toggle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__icon-toggle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__linear-progress/adapter.d.ts b/types/material__linear-progress/adapter.d.ts new file mode 100644 index 0000000000..92afccc19d --- /dev/null +++ b/types/material__linear-progress/adapter.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCLinearProgressAdapter { + addClass(className: string): void; + + getPrimaryBar(): Element; + + getBuffer(): Element; + + hasClass(className: string): boolean; + + removeClass(className: string): void; + + setStyle(el: Element, styleProperty: string, value: number): void; +} diff --git a/types/material__linear-progress/constants.d.ts b/types/material__linear-progress/constants.d.ts new file mode 100644 index 0000000000..af83ae9922 --- /dev/null +++ b/types/material__linear-progress/constants.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + CLOSED_CLASS: 'mdc-linear-progress--closed'; + INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate'; + REVERSED_CLASS: 'mdc-linear-progress--reversed'; +} + +export interface strings extends MDCStrings { + PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar'; + BUFFER_SELECTOR: '.mdc-linear-progress__buffer'; +} diff --git a/types/material__linear-progress/foundation.d.ts b/types/material__linear-progress/foundation.d.ts new file mode 100644 index 0000000000..4abd553a09 --- /dev/null +++ b/types/material__linear-progress/foundation.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { transformStyleProperties } from 'material__animation'; +import { MDCLinearProgressAdapter } from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCLinearProgressFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCLinearProgressAdapter; + + setDeterminate(isDeterminate: boolean): void; + + setProgress(value: number): void; + + setBuffer(value: number): void; + + setReverse(isReversed: boolean): void; + + open(): void; + + close(): void; +} diff --git a/types/material__linear-progress/index.d.ts b/types/material__linear-progress/index.d.ts new file mode 100644 index 0000000000..765d8cb368 --- /dev/null +++ b/types/material__linear-progress/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCLinearProgressAdapter } from './adapter'; +import { MDCLinearProgressFoundation } from './foundation'; + +export {MDCLinearProgressAdapter, MDCLinearProgressFoundation}; + +export class MDCLinearProgress extends MDCComponent { + static attachTo(root: Element): MDCLinearProgress; + + determinate: boolean; + + progress: number; + + buffer: number; + + reverse: boolean; + + open(): void; + + close(): void; + + getDefaultFoundation(): MDCLinearProgressFoundation; +} diff --git a/types/material__linear-progress/tsconfig.json b/types/material__linear-progress/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__linear-progress/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__linear-progress/tslint.json b/types/material__linear-progress/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__linear-progress/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__menu/index.d.ts b/types/material__menu/index.d.ts new file mode 100644 index 0000000000..af9360d1a8 --- /dev/null +++ b/types/material__menu/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as util from './util'; +import { MDCSimpleMenu, MDCSimpleMenuAdapter, MDCSimpleMenuFoundation } from './simple/index'; +export { MDCSimpleMenu, MDCSimpleMenuAdapter, MDCSimpleMenuFoundation, util }; diff --git a/types/material__menu/simple/adapter.d.ts b/types/material__menu/simple/adapter.d.ts new file mode 100644 index 0000000000..7fdd1e4f3a --- /dev/null +++ b/types/material__menu/simple/adapter.d.ts @@ -0,0 +1,104 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Simple Menu. Provides an interface for managing + * - classes + * - dom + * - focus + * - position + * - dimensions + * - event handlers + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export default class MDCSimpleMenuAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + hasClass(className: string): boolean; + + hasNecessaryDom(): boolean; + + getAttributeForEventTarget(target: EventTarget, attributeName: string): string; + + getInnerDimensions(): {width: number, height: number}; + + hasAnchor(): boolean; + + getAnchorDimensions(): {width: number, height: number, top: number, right: number, bottom: number, left: number}; + + getWindowDimensions(): {width: number, height: number}; + + setScale(x: number, y: number): void; + + setInnerScale(x: number, y: number): void; + + getNumberOfItems(): number; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + registerBodyClickHandler(handler: EventListener): void; + + deregisterBodyClickHandler(handler: EventListener): void; + + getYParamsForItemAtIndex(index: number): {top: number, height: number}; + + setTransitionDelayForItemAtIndex(index: number, value: string|null): void; + + getIndexForEventTarget(target: EventTarget): number; + + notifySelected(evtData: {index: number}): void; + + notifyCancel(): void; + + saveFocus(): void; + + restoreFocus(): void; + + isFocused(): boolean; + + focus(): void; + + getFocusedItemIndex(): number; + + focusItemAtIndex(index: number): void; + + isRtl(): boolean; + + setTransformOrigin(origin: string): void; + + setPosition(position: { + top: string|undefined, + right: string|undefined, + bottom: string|undefined, + left: string|undefined + }): void; + + getAccurateTime(): number; +} diff --git a/types/material__menu/simple/constants.d.ts b/types/material__menu/simple/constants.d.ts new file mode 100644 index 0000000000..58e2f16614 --- /dev/null +++ b/types/material__menu/simple/constants.d.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-simple-menu'; + OPEN: 'mdc-simple-menu--open'; + ANIMATING: 'mdc-simple-menu--animating'; + TOP_RIGHT: 'mdc-simple-menu--open-from-top-right'; + BOTTOM_LEFT: 'mdc-simple-menu--open-from-bottom-left'; + BOTTOM_RIGHT: 'mdc-simple-menu--open-from-bottom-right'; +} + +export interface strings extends MDCStrings { + ITEMS_SELECTOR: '.mdc-simple-menu__items'; + SELECTED_EVENT: 'MDCSimpleMenu:selected'; + CANCEL_EVENT: 'MDCSimpleMenu:cancel'; + ARIA_DISABLED_ATTR: 'aria-disabled'; +} + +export interface numbers extends MDCNumbers { + // Amount of time to wait before triggering a selected event on the menu. Note that this time + // will most likely be bumped up once interactive lists are supported to allow for the ripple to + // animate before closing the menu + SELECTED_TRIGGER_DELAY: 50; + // Total duration of the menu animation. + TRANSITION_DURATION_MS: 300; + // The menu starts its open animation with the X axis at this time value (0 - 1). + TRANSITION_SCALE_ADJUSTMENT_X: 0.5; + // The time value the menu waits until the animation starts on the Y axis (0 - 1). + TRANSITION_SCALE_ADJUSTMENT_Y: 0.2; + // The cubic bezier control points for the animation (cubic-bezier(0, 0, 0.2, 1)). + TRANSITION_X1: 0; + TRANSITION_Y1: 0; + TRANSITION_X2: 0.2; + TRANSITION_Y2: 1; +} diff --git a/types/material__menu/simple/foundation.d.ts b/types/material__menu/simple/foundation.d.ts new file mode 100644 index 0000000000..78071374b3 --- /dev/null +++ b/types/material__menu/simple/foundation.d.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCSimpleMenuAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; +import { clamp, bezierProgress } from '../util'; + +export default class MDCSimpleMenuFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCSimpleMenuAdapter; + + /** + * Open the menu. + */ + open(options?: {focusIndex?: number}): void; + + /** + * Closes the menu. + */ + close(evt?: Event): void; + + isOpen(): boolean; +} diff --git a/types/material__menu/simple/index.d.ts b/types/material__menu/simple/index.d.ts new file mode 100644 index 0000000000..c2315810ba --- /dev/null +++ b/types/material__menu/simple/index.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCSimpleMenuFoundation from './foundation'; +import MDCSimpleMenuAdapter from './adapter'; +import { getTransformPropertyName } from '../util'; + +export {MDCSimpleMenuAdapter, MDCSimpleMenuFoundation}; + +export class MDCSimpleMenu extends MDCComponent { + static attachTo(root: Element): MDCSimpleMenu; + + open: boolean; + + show(options?: {focusIndex?: number}): void; + + hide(): void; + + /** + * Return the items within the menu. Note that this only contains the set of elements within + * the items container that are proper list items, and not supplemental / presentational DOM + * elements. + */ + readonly items: Element[]; + + getDefaultFoundation(): MDCSimpleMenuFoundation; +} diff --git a/types/material__menu/tsconfig.json b/types/material__menu/tsconfig.json new file mode 100644 index 0000000000..7903a23031 --- /dev/null +++ b/types/material__menu/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "simple/constants.d.ts", + "simple/adapter.d.ts", + "simple/index.d.ts", + "simple/foundation.d.ts", + "util.d.ts", + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__menu/tslint.json b/types/material__menu/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__menu/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__menu/util.d.ts b/types/material__menu/util.d.ts new file mode 100644 index 0000000000..d5e02a37e2 --- /dev/null +++ b/types/material__menu/util.d.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Returns the name of the correct transform property to use on the current browser. + */ +export function getTransformPropertyName(globalObj: Window, forceRefresh?: boolean): string|undefined; + +/** + * Clamps a value between the minimum and the maximum, returning the clamped value. + */ +export function clamp(value: number, min?: number, max?: number): number; + +/** + * Returns the easing value to apply at time t, for a given cubic bezier curve. + * Control points P0 and P3 are assumed to be (0,0) and (1,1), respectively. + * Parameters are as follows: + * - time: The current time in the animation, scaled between 0 and 1. + * - x1: The x value of control point P1. + * - y1: The y value of control point P1. + * - x2: The x value of control point P2. + * - y2: The y value of control point P2. + */ +export function bezierProgress(time: number, x1: number, y1: number, x2: number, y2: number): number; diff --git a/types/material__radio/adapter.d.ts b/types/material__radio/adapter.d.ts new file mode 100644 index 0000000000..91035ea177 --- /dev/null +++ b/types/material__radio/adapter.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSelectionControlState } from 'material__selection-control'; + +/** + * Adapter for MDC Radio. Provides an interface for managing + * - classes + * - dom + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + */ +export class MDCRadioAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + getNativeControl(): MDCSelectionControlState; +} + +export default MDCRadioAdapter; diff --git a/types/material__radio/constants.d.ts b/types/material__radio/constants.d.ts new file mode 100644 index 0000000000..5c73f72faf --- /dev/null +++ b/types/material__radio/constants.d.ts @@ -0,0 +1,26 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'; +} + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-radio'; + DISABLED: 'mdc-radio--disabled'; +} diff --git a/types/material__radio/foundation.d.ts b/types/material__radio/foundation.d.ts new file mode 100644 index 0000000000..f27bd30f1b --- /dev/null +++ b/types/material__radio/foundation.d.ts @@ -0,0 +1,42 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCSelectionControlState } from 'material__selection-control'; +import MDCRadioAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCRadioFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCRadioAdapter; + + isChecked(): boolean; + + setChecked(checked: boolean): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + getValue(): string; + + setValue(value?: string): void; +} + +export default MDCRadioFoundation; diff --git a/types/material__radio/index.d.ts b/types/material__radio/index.d.ts new file mode 100644 index 0000000000..e9001d9d84 --- /dev/null +++ b/types/material__radio/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCSelectionControl } from 'material__selection-control'; +import MDCRadioAdapter from './adapter'; +import MDCRadioFoundation from './foundation'; +import { MDCRipple, MDCRippleFoundation } from 'material__ripple'; + +export {MDCRadioAdapter, MDCRadioFoundation}; + +export class MDCRadio extends MDCComponent implements MDCSelectionControl { + static attachTo(root: Element): MDCRadio; + + checked: boolean; + + disabled: boolean; + + value: string; + + readonly ripple: MDCRipple; + + destroy(): void; + + getDefaultFoundation(): MDCRadioFoundation; +} diff --git a/types/material__radio/tsconfig.json b/types/material__radio/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__radio/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__radio/tslint.json b/types/material__radio/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__radio/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__ripple/adapter.d.ts b/types/material__ripple/adapter.d.ts new file mode 100644 index 0000000000..0d2d319aab --- /dev/null +++ b/types/material__ripple/adapter.d.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Ripple. Provides an interface for managing + * - classes + * - dom + * - CSS variables + * - position + * - dimensions + * - scroll position + * - event handlers + * - unbounded, active and disabled states + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export default class MDCRippleAdapter { + browserSupportsCssVars(): boolean; + + isUnbounded(): boolean; + + isSurfaceActive(): boolean; + + isSurfaceDisabled(): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(evtType: string, handler: EventListener): void; + + deregisterInteractionHandler(evtType: string, handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + updateCssVariable(varName: string, value: number|string): void; + + computeBoundingRect(): ClientRect; + + getWindowPageOffset(): {x: number, y: number}; +} diff --git a/types/material__ripple/constants.d.ts b/types/material__ripple/constants.d.ts new file mode 100644 index 0000000000..285d5f3f2c --- /dev/null +++ b/types/material__ripple/constants.d.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + // Ripple is a special case where the "root" component is really a "mixin" of sorts, + // given that it's an 'upgrade' to an existing component. That being said it is the root + // CSS class that all other CSS classes derive from. + ROOT: 'mdc-ripple-upgraded'; + UNBOUNDED: 'mdc-ripple-upgraded--unbounded'; + BG_FOCUSED: 'mdc-ripple-upgraded--background-focused'; + BG_ACTIVE_FILL: 'mdc-ripple-upgraded--background-active-fill'; + FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation'; + FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'; +} + +export interface strings extends MDCStrings { + VAR_FG_SIZE: '--mdc-ripple-fg-size'; + VAR_LEFT: '--mdc-ripple-left'; + VAR_TOP: '--mdc-ripple-top'; + VAR_FG_SCALE: '--mdc-ripple-fg-scale'; + VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start'; + VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'; +} + +export interface numbers extends MDCNumbers { + PADDING: 10; + INITIAL_ORIGIN_SCALE: 0.6; + DEACTIVATION_TIMEOUT_MS: 300; + FG_DEACTIVATION_MS: 83; +} diff --git a/types/material__ripple/foundation.d.ts b/types/material__ripple/foundation.d.ts new file mode 100644 index 0000000000..b67632e441 --- /dev/null +++ b/types/material__ripple/foundation.d.ts @@ -0,0 +1,69 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCRippleAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; +import { getNormalizedEventCoords } from './util'; + +export interface ActivationStateType { + isActivated: boolean|undefined; + hasDeactivationUXRun: boolean|undefined; + wasActivatedByPointer: boolean|undefined; + wasElementMadeActive: boolean|undefined; + activationStartTime: number|undefined; + activationEvent: Event; + isProgrammatic: boolean|undefined; +} + +export interface ListenerInfoType { + activate: string|undefined; + deactivate: string|undefined; + focus: string|undefined; + blur: string|undefined; +} + +export interface ListenersType { + activate(e: Event): void; + + deactivate(e: Event): void; + + focus(): void; + + blur(): void; +} + +export interface PointType { + x: number; + y: number; +} + +export default class MDCRippleFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCRippleAdapter; + + activate(event?: Event): void; + + deactivate(event?: Event): void; + + layout(): void; +} diff --git a/types/material__ripple/index.d.ts b/types/material__ripple/index.d.ts new file mode 100644 index 0000000000..2f8379ac84 --- /dev/null +++ b/types/material__ripple/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCRippleAdapter from './adapter'; +import MDCRippleFoundation from './foundation'; +import * as util from './util'; + +export {MDCRippleAdapter, MDCRippleFoundation, util}; + +export class MDCRipple extends MDCComponent { + static attachTo(root: Element, bound?: {isUnbounded: boolean|undefined}): MDCRipple; + + static createAdapter(instance: RippleCapableSurface): MDCRippleAdapter; + + unbounded: boolean; + + activate(): void; + + deactivate(): void; + + layout(): void; + + getDefaultFoundation(): MDCRippleFoundation; + + initialSyncWithDOM(): void; +} + +/** + * See Material Design spec for more details on when to use ripples. + * https://material.io/guidelines/motion/choreography.html#choreography-creation + * @record + */ +export class RippleCapableSurface { + protected root_: Element; + + /** + * Whether or not the ripple bleeds out of the bounds of the element. + */ + unbounded: boolean|undefined; + + /** + * Whether or not the ripple is attached to a disabled component. + */ + disabled: boolean|undefined; +} diff --git a/types/material__ripple/tsconfig.json b/types/material__ripple/tsconfig.json new file mode 100644 index 0000000000..3feaa72ba5 --- /dev/null +++ b/types/material__ripple/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__ripple/tslint.json b/types/material__ripple/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__ripple/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__ripple/util.d.ts b/types/material__ripple/util.d.ts new file mode 100644 index 0000000000..ed684eca8f --- /dev/null +++ b/types/material__ripple/util.d.ts @@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export function supportsCssVariables(windowObj: Window, forceRefresh?: boolean): boolean|undefined; + +/** + * Determine whether the current browser supports passive event listeners, and if so, use them. + */ +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean|{passive: boolean}; + +export function getMatchesProperty(HTMLElementPrototype: object): string[]; + +export function getNormalizedEventCoords(ev: Event, pageOffset: {x: number, y: number}, clientRect: ClientRect): {x: number, y: number}; diff --git a/types/material__select/adapter.d.ts b/types/material__select/adapter.d.ts new file mode 100644 index 0000000000..2828b77361 --- /dev/null +++ b/types/material__select/adapter.d.ts @@ -0,0 +1,81 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSelectAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + addBodyClass(className: string): void; + + removeBodyClass(className: string): void; + + setAttr(attr: string, value: string): void; + + rmAttr(attr: string): void; + + computeBoundingRect(): {left: number, top: number}; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + focus(): void; + + makeTabbable(): void; + + makeUntabbable(): void; + + getComputedStyleValue(propertyName: string): string; + + setStyle(propertyName: string, value: string): void; + + create2dRenderingContext(): {font: string, measureText: (val: string) => {width: number}}; + + setMenuElStyle(propertyName: string, value: string): void; + + setMenuElAttr(attr: string, value: string): void; + + rmMenuElAttr(attr: string): void; + + getMenuElOffsetHeight(): number; + + openMenu(focusIndex: number): void; + + isMenuOpen(): boolean; + + setSelectedTextContent(textContent: string): void; + + getNumberOfOptions(): number; + + getTextForOptionAtIndex(index: number): string; + + getValueForOptionAtIndex(index: number): string; + + setAttrForOptionAtIndex(index: number, attr: string, value: string): void; + + rmAttrForOptionAtIndex(index: number, attr: string): void; + + getOffsetTopForOptionAtIndex(index: number): number; + + registerMenuInteractionHandler(type: string, handler: EventListener): void; + + deregisterMenuInteractionHandler(type: string, handler: EventListener): void; + + notifyChange(): void; + + getWindowInnerHeight(): number; +} diff --git a/types/material__select/constants.d.ts b/types/material__select/constants.d.ts new file mode 100644 index 0000000000..1566d71322 --- /dev/null +++ b/types/material__select/constants.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-select'; + OPEN: 'mdc-select--open'; + DISABLED: 'mdc-select--disabled'; + SCROLL_LOCK: 'mdc-select-scroll-lock'; +} + +export interface strings extends MDCStrings { + CHANGE_EVENT: 'MDCSelect:change'; +} diff --git a/types/material__select/foundation.d.ts b/types/material__select/foundation.d.ts new file mode 100644 index 0000000000..6f66f79b5f --- /dev/null +++ b/types/material__select/foundation.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings } from './constants'; +import { MDCSimpleMenuFoundation } from 'material__menu'; +import { MDCSelectAdapter } from './adapter'; + +export default class MDCSelectFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSelectAdapter; + + getValue(): string; + + getSelectedIndex(): number; + + setSelectedIndex(index: number): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + resize(): void; +} diff --git a/types/material__select/index.d.ts b/types/material__select/index.d.ts new file mode 100644 index 0000000000..78746a97d1 --- /dev/null +++ b/types/material__select/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCSimpleMenu } from 'material__menu'; + +import { MDCSelectAdapter } from './adapter'; +import MDCSelectFoundation from './foundation'; + +export {MDCSelectAdapter, MDCSelectFoundation}; + +export class MDCSelect extends MDCComponent { + static attachTo(root: Element): MDCSelect; + + readonly value: string; + + readonly options: Element[]; + + readonly selectedOptions: NodeListOf; + + selectedIndex: number; + + disabled: boolean; + + item(index: number): Element|null; + + nameditem(key: string): Element|null; + + initialize(menuFactory?: (el: Element) => MDCSimpleMenu): void; + + getDefaultFoundation(): MDCSelectFoundation; + + initialSyncWithDOM(): void; +} diff --git a/types/material__select/tsconfig.json b/types/material__select/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__select/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__select/tslint.json b/types/material__select/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__select/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__selection-control/index.d.ts b/types/material__selection-control/index.d.ts new file mode 100644 index 0000000000..9c7f90c3fd --- /dev/null +++ b/types/material__selection-control/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCRipple } from 'material__ripple'; + +export interface MDCSelectionControlState { + checked: boolean; + indeterminate: boolean; + disabled: boolean; + value?: string; +} + +export class MDCSelectionControl { + readonly ripple: MDCRipple; +} diff --git a/types/material__selection-control/tsconfig.json b/types/material__selection-control/tsconfig.json new file mode 100644 index 0000000000..d25bb531d1 --- /dev/null +++ b/types/material__selection-control/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__selection-control/tslint.json b/types/material__selection-control/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__selection-control/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__slider/adapter.d.ts b/types/material__slider/adapter.d.ts new file mode 100644 index 0000000000..940ae04d76 --- /dev/null +++ b/types/material__slider/adapter.d.ts @@ -0,0 +1,67 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSliderAdapter { + hasClass(className: string): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + getAttribute(name: string): string|null; + + setAttribute(name: string, value: string): void; + + removeAttribute(name: string): void; + + computeBoundingRect(): ClientRect; + + getTabIndex(): number; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + registerThumbContainerInteractionHandler(type: string, handler: EventListener): void; + + deregisterThumbContainerInteractionHandler(type: string, handler: EventListener): void; + + registerBodyInteractionHandler(type: string, handler: EventListener): void; + + deregisterBodyInteractionHandler(type: string, handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + notifyInput(): void; + + notifyChange(): void; + + setThumbContainerStyleProperty(propertyName: string, value: string): void; + + setTrackStyleProperty(propertyName: string, value: string): void; + + setMarkerValue(value: number): void; + + appendTrackMarkers(numMarkers: number): void; + + removeTrackMarkers(): void; + + setLastTrackMarkersStyleProperty(propertyName: string, value: string): void; + + isRTL(): boolean; +} diff --git a/types/material__slider/constants.d.ts b/types/material__slider/constants.d.ts new file mode 100644 index 0000000000..444eb38f91 --- /dev/null +++ b/types/material__slider/constants.d.ts @@ -0,0 +1,46 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ACTIVE: 'mdc-slider--active'; + DISABLED: 'mdc-slider--disabled'; + DISCRETE: 'mdc-slider--discrete'; + FOCUS: 'mdc-slider--focus'; + IN_TRANSIT: 'mdc-slider--in-transit'; + IS_DISCRETE: 'mdc-slider--discrete'; + HAS_TRACK_MARKER: 'mdc-slider--display-markers'; +} + +export interface strings extends MDCStrings { + TRACK_SELECTOR: '.mdc-slider__track'; + TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container'; + LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child'; + THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container'; + PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker'; + ARIA_VALUEMIN: 'aria-valuemin'; + ARIA_VALUEMAX: 'aria-valuemax'; + ARIA_VALUENOW: 'aria-valuenow'; + ARIA_DISABLED: 'aria-disabled'; + STEP_DATA_ATTR: 'data-step'; + CHANGE_EVENT: 'MDCSlider:change'; + INPUT_EVENT: 'MDCSlider:input'; +} + +export interface numbers extends MDCNumbers { + PAGE_FACTOR: 4; +} diff --git a/types/material__slider/foundation.d.ts b/types/material__slider/foundation.d.ts new file mode 100644 index 0000000000..5da6942f49 --- /dev/null +++ b/types/material__slider/foundation.d.ts @@ -0,0 +1,55 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { cssClasses, strings, numbers } from './constants'; + +import { getCorrectEventName, getCorrectPropertyName } from 'material__animation'; +import MDCFoundation from 'material__base/foundation'; +import { MDCSliderAdapter } from './adapter'; + +export default class MDCSliderFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCSliderAdapter; + + setupTrackMarker(): void; + + layout(): void; + + getValue(): number; + + setValue(value: number): void; + + getMax(): number; + + setMax(max: number): void; + + getMin(): number; + + setMin(min: number): void; + + getStep(): number; + + setStep(step: number): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; +} diff --git a/types/material__slider/index.d.ts b/types/material__slider/index.d.ts new file mode 100644 index 0000000000..0d0e472775 --- /dev/null +++ b/types/material__slider/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCSliderFoundation from './foundation'; +import { MDCSliderAdapter } from './adapter'; + +export {MDCSliderAdapter, MDCSliderFoundation}; + +export class MDCSlider extends MDCComponent { + static attachTo(root: Element): MDCSlider; + + value: number; + + min: number; + + max: number; + + step: number; + + disabled: boolean; + + initialize(): void; + + getDefaultFoundation(): MDCSliderFoundation; + + initialSyncWithDOM(): void; + + layout(): void; + + stepUp(amount?: number): void; + + stepDown(amount?: number): void; +} diff --git a/types/material__slider/tsconfig.json b/types/material__slider/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__slider/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__slider/tslint.json b/types/material__slider/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__slider/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__snackbar/adapter.d.ts b/types/material__snackbar/adapter.d.ts new file mode 100644 index 0000000000..412329bd97 --- /dev/null +++ b/types/material__snackbar/adapter.d.ts @@ -0,0 +1,38 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSnackbarAdapter { + addClass(className: string): void; + removeClass(className: string): void; + setAriaHidden(): void; + unsetAriaHidden(): void; + setActionAriaHidden(): void; + unsetActionAriaHidden(): void; + setActionText(actionText: string): void; + setMessageText(message: string): void; + setFocus(): void; + visibilityIsHidden(): boolean; + registerCapturedBlurHandler(handler: EventListener): void; + deregisterCapturedBlurHandler(handler: EventListener): void; + registerVisibilityChangeHandler(handler: EventListener): void; + deregisterVisibilityChangeHandler(handler: EventListener): void; + registerCapturedInteractionHandler(evtType: string, handler: EventListener): void; + deregisterCapturedInteractionHandler(evtType: string, handler: EventListener): void; + registerActionClickHandler(handler: EventListener): void; + deregisterActionClickHandler(handler: EventListener): void; + registerTransitionEndHandler(handler: EventListener): void; + deregisterTransitionEndHandler(handler: EventListener): void; +} diff --git a/types/material__snackbar/constants.d.ts b/types/material__snackbar/constants.d.ts new file mode 100644 index 0000000000..7bf6758a0a --- /dev/null +++ b/types/material__snackbar/constants.d.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-snackbar'; + TEXT: 'mdc-snackbar__text'; + ACTION_WRAPPER: 'mdc-snackbar__action-wrapper'; + ACTION_BUTTON: 'mdc-snackbar__action-button'; + ACTIVE: 'mdc-snackbar--active'; + MULTILINE: 'mdc-snackbar--multiline'; + ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'; +} + +export interface strings extends MDCStrings { + TEXT_SELECTOR: '.mdc-snackbar__text'; + ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper'; + ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button'; +} + +export interface numbers extends MDCNumbers { + MESSAGE_TIMEOUT: 2750; +} diff --git a/types/material__snackbar/foundation.d.ts b/types/material__snackbar/foundation.d.ts new file mode 100644 index 0000000000..5c85ab5f85 --- /dev/null +++ b/types/material__snackbar/foundation.d.ts @@ -0,0 +1,44 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings, numbers } from './constants'; +import { MDCSnackbarAdapter } from './adapter'; + +export interface MDCSnackbarData { + message: string; + actionHandler: EventListener; + actionText: string; + multiline?: boolean; + actionOnBottom?: boolean; + timeout?: number; +} + +export class MDCSnackbarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSnackbarAdapter; + + readonly active: boolean; + + dismissesOnAction(): boolean; + + setDismissOnAction(dismissOnAction: boolean): void; + + show(data: MDCSnackbarData): void; +} diff --git a/types/material__snackbar/index.d.ts b/types/material__snackbar/index.d.ts new file mode 100644 index 0000000000..11ac69f573 --- /dev/null +++ b/types/material__snackbar/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCSnackbarAdapter } from './adapter'; +import { MDCSnackbarFoundation, MDCSnackbarData } from './foundation'; +import { getCorrectEventName } from 'material__animation'; + +export {MDCSnackbarAdapter, MDCSnackbarFoundation}; + +export class MDCSnackbar extends MDCComponent { + static attachTo(root: Element): MDCSnackbar; + + show(data: MDCSnackbarData): void; + + getDefaultFoundation(): MDCSnackbarFoundation; + + dismissesOnAction: boolean; +} diff --git a/types/material__snackbar/tsconfig.json b/types/material__snackbar/tsconfig.json new file mode 100644 index 0000000000..741c98e44a --- /dev/null +++ b/types/material__snackbar/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__snackbar/tslint.json b/types/material__snackbar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__snackbar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__tabs/index.d.ts b/types/material__tabs/index.d.ts new file mode 100644 index 0000000000..b268e55a8d --- /dev/null +++ b/types/material__tabs/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {MDCTabFoundation, MDCTab} from './tab/index'; +export {MDCTabBarAdapter, MDCTabBarFoundation, MDCTabBar} from './tab-bar/index'; +export {MDCTabBarScrollerAdapter, MDCTabBarScrollerFoundation, MDCTabBarScroller} from './tab-bar-scroller/index'; diff --git a/types/material__tabs/tab-bar-scroller/adapter.d.ts b/types/material__tabs/tab-bar-scroller/adapter.d.ts new file mode 100644 index 0000000000..8c1286fc74 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/adapter.d.ts @@ -0,0 +1,69 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabBarScrollerAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + eventTargetHasClass(target: EventTarget, className: string): boolean; + + addClassToForwardIndicator(className: string): void; + + removeClassFromForwardIndicator(className: string): void; + + addClassToBackIndicator(className: string): void; + + removeClassFromBackIndicator(className: string): void; + + isRTL(): boolean; + + registerBackIndicatorClickHandler(handler: EventListener): void; + + deregisterBackIndicatorClickHandler(handler: EventListener): void; + + registerForwardIndicatorClickHandler(handler: EventListener): void; + + deregisterForwardIndicatorClickHandler(handler: EventListener): void; + + registerCapturedInteractionHandler(evt: string, handler: EventListener): void; + + deregisterCapturedInteractionHandler(evt: string, handler: EventListener): void; + + registerWindowResizeHandler(handler: EventListener): void; + + deregisterWindowResizeHandler(handler: EventListener): void; + + getNumberOfTabs(): number; + + getComputedWidthForTabAtIndex(): number; + + getComputedLeftForTabAtIndex(): number; + + getOffsetWidthForScrollFrame(): number; + + getScrollLeftForScrollFrame(): number; + + setScrollLeftForScrollFrame(scrollLeftAmount: number): void; + + getOffsetWidthForTabBar(): number; + + setTransformStyleForTabBar(value: string): void; + + getOffsetLeftForEventTarget(target: EventTarget): number; + + getOffsetWidthForEventTarget(target: EventTarget): number; +} diff --git a/types/material__tabs/tab-bar-scroller/constants.d.ts b/types/material__tabs/tab-bar-scroller/constants.d.ts new file mode 100644 index 0000000000..b78ac1b937 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/constants.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + INDICATOR_FORWARD: 'mdc-tab-bar-scroller__indicator--forward'; + INDICATOR_BACK: 'mdc-tab-bar-scroller__indicator--back'; + INDICATOR_ENABLED: 'mdc-tab-bar-scroller__indicator--enabled'; + TAB: 'mdc-tab'; +} + +export interface strings extends MDCStrings { + FRAME_SELECTOR: '.mdc-tab-bar-scroller__scroll-frame'; + TABS_SELECTOR: '.mdc-tab-bar-scroller__scroll-frame__tabs'; + TAB_SELECTOR: '.mdc-tab'; + INDICATOR_FORWARD_SELECTOR: '.mdc-tab-bar-scroller__indicator--forward'; + INDICATOR_BACK_SELECTOR: '.mdc-tab-bar-scroller__indicator--back'; +} diff --git a/types/material__tabs/tab-bar-scroller/foundation.d.ts b/types/material__tabs/tab-bar-scroller/foundation.d.ts new file mode 100644 index 0000000000..ed470c20d2 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/foundation.d.ts @@ -0,0 +1,36 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; + +import { cssClasses, strings } from './constants'; +import { MDCTabBarScrollerAdapter } from './adapter'; + +export default class MDCTabBarScrollerFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabBarScrollerAdapter; + + scrollBack(evt?: Event): void; + + scrollForward(evt?: Event): void; + + layout(): void; + + scrollToTabAtIndex(index: number): void; +} diff --git a/types/material__tabs/tab-bar-scroller/index.d.ts b/types/material__tabs/tab-bar-scroller/index.d.ts new file mode 100644 index 0000000000..a9d71b305c --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/index.d.ts @@ -0,0 +1,36 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { getCorrectPropertyName } from 'material__animation'; +import MDCComponent from 'material__base/component'; + +import { MDCTabBar } from '../tab-bar/index'; +import MDCTabBarScrollerFoundation from './foundation'; +import { MDCTabBarScrollerAdapter } from './adapter'; + +export {MDCTabBarScrollerAdapter, MDCTabBarScrollerFoundation}; + +export class MDCTabBarScroller extends MDCComponent { + static attachTo(root: Element): MDCTabBarScroller; + + readonly tabBar: MDCTabBar; + + initialize(tabBarFactory?: (el: Element) => MDCTabBar): void; + + getDefaultFoundation(): MDCTabBarScrollerFoundation; + + layout(): void; +} diff --git a/types/material__tabs/tab-bar/adapter.d.ts b/types/material__tabs/tab-bar/adapter.d.ts new file mode 100644 index 0000000000..1efa73f52c --- /dev/null +++ b/types/material__tabs/tab-bar/adapter.d.ts @@ -0,0 +1,53 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabBarAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + bindOnMDCTabSelectedEvent(): void; + + unbindOnMDCTabSelectedEvent(): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + getOffsetWidth(): number; + + setStyleForIndicator(propertyName: string, value: string): void; + + getOffsetWidthForIndicator(): number; + + notifyChange(evtData: {activeTabIndex: number}): void; + + getNumberOfTabs(): number; + + isTabActiveAtIndex(index: number): boolean; + + setTabActiveAtIndex(index: number, isActive: true): void; + + isDefaultPreventedOnClickForTabAtIndex(index: number): boolean; + + setPreventDefaultOnClickForTabAtIndex(index: number, preventDefaultOnClick: boolean): void; + + measureTabAtIndex(index: number): void; + + getComputedWidthForTabAtIndex(index: number): number; + + getComputedLeftForTabAtIndex(index: number): number; +} diff --git a/types/material__tabs/tab-bar/constants.d.ts b/types/material__tabs/tab-bar/constants.d.ts new file mode 100644 index 0000000000..21120fb1e9 --- /dev/null +++ b/types/material__tabs/tab-bar/constants.d.ts @@ -0,0 +1,27 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + UPGRADED: 'mdc-tab-bar-upgraded'; +} + +export interface strings extends MDCStrings { + TAB_SELECTOR: '.mdc-tab'; + INDICATOR_SELECTOR: '.mdc-tab-bar__indicator'; + CHANGE_EVENT: 'MDCTabBar:change'; +} diff --git a/types/material__tabs/tab-bar/foundation.d.ts b/types/material__tabs/tab-bar/foundation.d.ts new file mode 100644 index 0000000000..2e5ccb1de2 --- /dev/null +++ b/types/material__tabs/tab-bar/foundation.d.ts @@ -0,0 +1,35 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { getCorrectPropertyName } from 'material__animation'; + +import { cssClasses, strings } from './constants'; +import { MDCTabBarAdapter } from './adapter'; + +export default class MDCTabBarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabBarAdapter; + + layout(): void; + + switchToTabAtIndex(index: number, shouldNotify: boolean): void; + + getActiveTabIndex(): number; +} diff --git a/types/material__tabs/tab-bar/index.d.ts b/types/material__tabs/tab-bar/index.d.ts new file mode 100644 index 0000000000..127a62217f --- /dev/null +++ b/types/material__tabs/tab-bar/index.d.ts @@ -0,0 +1,39 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import { MDCTab, MDCTabFoundation } from '../tab/index'; +import MDCTabBarFoundation from './foundation'; +import { MDCTabBarAdapter } from './adapter'; + +export {MDCTabBarAdapter, MDCTabBarFoundation}; + +export class MDCTabBar extends MDCComponent { + static attachTo(root: Element): MDCTabBar; + + readonly tabs: MDCTab[]; + + activeTab: MDCTab; + + activeTabIndex: number; + + initialize(tabFactory?: (el: Element) => MDCTab): void; + + getDefaultFoundation(): MDCTabBarFoundation; + + layout(): void; +} diff --git a/types/material__tabs/tab/adapter.d.ts b/types/material__tabs/tab/adapter.d.ts new file mode 100644 index 0000000000..bc07aa5aa7 --- /dev/null +++ b/types/material__tabs/tab/adapter.d.ts @@ -0,0 +1,31 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + getOffsetWidth(): number; + + getOffsetLeft(): number; + + notifySelected(): void; +} diff --git a/types/material__tabs/tab/constants.d.ts b/types/material__tabs/tab/constants.d.ts new file mode 100644 index 0000000000..1023f253db --- /dev/null +++ b/types/material__tabs/tab/constants.d.ts @@ -0,0 +1,25 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ACTIVE: 'mdc-tab--active'; +} + +export interface strings extends MDCStrings { + SELECTED_EVENT: 'MDCTab:selected'; +} diff --git a/types/material__tabs/tab/foundation.d.ts b/types/material__tabs/tab/foundation.d.ts new file mode 100644 index 0000000000..46e14065c8 --- /dev/null +++ b/types/material__tabs/tab/foundation.d.ts @@ -0,0 +1,41 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { cssClasses, strings } from './constants'; +import { MDCTabAdapter } from './adapter'; + +export class MDCTabFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabAdapter; + + getComputedWidth(): number; + + getComputedLeft(): number; + + isActive(): boolean; + + setActive(isActive: boolean): void; + + preventsDefaultOnClick(): boolean; + + setPreventDefaultOnClick(preventDefaultOnClick: boolean): void; + + measureSelf(): void; +} diff --git a/types/material__tabs/tab/index.d.ts b/types/material__tabs/tab/index.d.ts new file mode 100644 index 0000000000..bf41b77e65 --- /dev/null +++ b/types/material__tabs/tab/index.d.ts @@ -0,0 +1,44 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCRipple } from 'material__ripple'; + +import { MDCTabAdapter } from './adapter'; +import { cssClasses } from './constants'; +import { MDCTabFoundation } from './foundation'; + +export {MDCTabAdapter, MDCTabFoundation}; + +export class MDCTab extends MDCComponent { + static attachTo(root: Element): MDCTab; + + readonly computedWidth: number; + + readonly computedLeft: number; + + isActive: boolean; + + preventDefaultOnClick: boolean; + + destroy(): void; + + getDefaultFoundation(): MDCTabFoundation; + + initialSyncWithDOM(): void; + + measureSelf(): void; +} diff --git a/types/material__tabs/tsconfig.json b/types/material__tabs/tsconfig.json new file mode 100644 index 0000000000..0eb3952185 --- /dev/null +++ b/types/material__tabs/tsconfig.json @@ -0,0 +1,36 @@ +{ + "files": [ + "tab-bar/constants.d.ts", + "tab-bar/adapter.d.ts", + "tab-bar/index.d.ts", + "tab-bar/foundation.d.ts", + "tab/constants.d.ts", + "tab/adapter.d.ts", + "tab/index.d.ts", + "tab/foundation.d.ts", + "index.d.ts", + "tab-bar-scroller/constants.d.ts", + "tab-bar-scroller/adapter.d.ts", + "tab-bar-scroller/index.d.ts", + "tab-bar-scroller/foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__tabs/tslint.json b/types/material__tabs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__tabs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__textfield/adapter.d.ts b/types/material__textfield/adapter.d.ts new file mode 100644 index 0000000000..ca13544c26 --- /dev/null +++ b/types/material__textfield/adapter.d.ts @@ -0,0 +1,161 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCTextFieldBottomLineFoundation from './bottom-line/foundation'; +import MDCTextFieldHelperTextFoundation from './helper-text/foundation'; + +export interface NativeInputType { + value: string; + disabled: boolean; + badInput: boolean; + checkValidity(): boolean; +} + +/** + * Adapter for MDC Text Field. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the Text Field into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export class MDCTextFieldAdapter { + /** + * Adds a class to the root Element. + */ + addClass(className: string): void; + + /** + * Removes a class from the root Element. + */ + removeClass(className: string): void; + + /** + * Adds a class to the label Element. We recommend you add a conditional + * check here, and in removeClassFromLabel for whether or not the label is + * present so that the JS component could be used with text fields that don't + * require a label, such as the full-width text field. + */ + addClassToLabel(className: string): void; + + /** + * Removes a class from the label Element. + */ + removeClassFromLabel(className: string): void; + + /** + * Sets an attribute on the icon Element. + */ + setIconAttr(name: string, value: string): void; + + /** + * Returns true if classname exists for a given target element. + */ + eventTargetHasClass(target: EventTarget, className: string): boolean; + + /** + * Registers an event handler on the root element for a given event. + */ + registerTextFieldInteractionHandler(type: string, handler: EventListener): void; + + /** + * Deregisters an event handler on the root element for a given event. + */ + deregisterTextFieldInteractionHandler(type: string, handler: EventListener): void; + + /** + * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon. + */ + notifyIconAction(): void; + + /** + * Adds a class to the helper text element. Note that in our code we check for + * whether or not we have a helper text element and if we don't, we simply + * return. + */ + addClassToHelperText(className: string): void; + + /** + * Removes a class from the helper text element. + */ + removeClassFromHelperText(className: string): void; + + /** + * Returns whether or not the helper text element contains the given class. + */ + helperTextHasClass(className: string): boolean; + + /** + * Registers an event listener on the native input element for a given event. + */ + registerInputInteractionHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the native input element for a given event. + */ + deregisterInputInteractionHandler(evtType: string, handler: EventListener): void; + + /** + * Registers an event listener on the bottom line element for a given event. + */ + registerBottomLineEventHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the bottom line element for a given event. + */ + deregisterBottomLineEventHandler(evtType: string, handler: EventListener): void; + + /** + * Sets an attribute with a given value on the helper text element. + */ + setHelperTextAttr(name: string, value: string): void; + + /** + * Removes an attribute from the helper text element. + */ + removeHelperTextAttr(name: string): void; + + /** + * Sets the text content for the help text element + */ + setHelperTextContent(content: string): void; + + /** + * Returns an object representing the native text input element, with a + * similar API shape. The object returned should include the value, disabled + * and badInput properties, as well as the checkValidity() function. We never + * alter the value within our code, however we do update the disabled + * property, so if you choose to duck-type the return value for this method + * in your implementation it's important to keep this in mind. Also note that + * this method can return null, which the foundation will handle gracefully. + */ + getNativeInput(): Element|NativeInputType; + + /** + * Returns the foundation for the bottom line element. Returns undefined if + * there is no bottom line element. + */ + getBottomLineFoundation(): MDCTextFieldBottomLineFoundation; + + /** + * Returns the foundation for the helper text element. Returns undefined if + * there is no helper text element. + */ + getHelperTextFoundation(): MDCTextFieldHelperTextFoundation; +} diff --git a/types/material__textfield/bottom-line/adapter.d.ts b/types/material__textfield/bottom-line/adapter.d.ts new file mode 100644 index 0000000000..25b8de0477 --- /dev/null +++ b/types/material__textfield/bottom-line/adapter.d.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC TextField Bottom Line. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the TextField bottom line into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export default class MDCTextFieldBottomLineAdapter { + /** + * Adds a class to the bottom line element. + */ + addClass(className: string): void; + + /** + * Removes a class from the bottom line element. + */ + removeClass(className: string): void; + + /** + * Sets an attribute with a given value on the bottom line element. + */ + setAttr(attr: string, value: string): void; + + /** + * Registers an event listener on the bottom line element for a given event. + */ + registerEventHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the bottom line element for a given event. + */ + deregisterEventHandler(evtType: string, handler: EventListener): void; + + /** + * Emits a custom event "MDCTextFieldBottomLine:animation-end" denoting the + * bottom line has finished its animation; either the activate or + * deactivate animation + */ + notifyAnimationEnd(): void; +} diff --git a/types/material__textfield/bottom-line/constants.d.ts b/types/material__textfield/bottom-line/constants.d.ts new file mode 100644 index 0000000000..519b9fb8e5 --- /dev/null +++ b/types/material__textfield/bottom-line/constants.d.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ANIMATION_END_EVENT: 'MDCTextFieldBottomLine:animation-end'; +} + +export interface cssClasses extends MDCStrings { + BOTTOM_LINE_ACTIVE: 'mdc-text-field__bottom-line--active'; +} diff --git a/types/material__textfield/bottom-line/foundation.d.ts b/types/material__textfield/bottom-line/foundation.d.ts new file mode 100644 index 0000000000..6945695348 --- /dev/null +++ b/types/material__textfield/bottom-line/foundation.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCTextFieldBottomLineAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldBottomLineFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldBottomLineAdapter; + + /** + * Activates the bottom line + */ + activate(): void; + + /** + * Sets the transform origin given a user's click location. + */ + setTransformOrigin(evt: Event): void; + + /** + * Deactivates the bottom line + */ + deactivate(): void; + + /** + * Handles a transition end event + */ + handleTransitionEnd(evt: Event): void; +} diff --git a/types/material__textfield/bottom-line/index.d.ts b/types/material__textfield/bottom-line/index.d.ts new file mode 100644 index 0000000000..a0ed4ff36d --- /dev/null +++ b/types/material__textfield/bottom-line/index.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCTextFieldBottomLineAdapter from './adapter'; +import MDCTextFieldBottomLineFoundation from './foundation'; + +export {MDCTextFieldBottomLineAdapter, MDCTextFieldBottomLineFoundation}; + +export class MDCTextFieldBottomLine extends MDCComponent { + static attachTo(root: Element): MDCTextFieldBottomLine; + + readonly foundation: MDCTextFieldBottomLineFoundation; + + getDefaultFoundation(): MDCTextFieldBottomLineFoundation; +} diff --git a/types/material__textfield/constants.d.ts b/types/material__textfield/constants.d.ts new file mode 100644 index 0000000000..7150bb4b14 --- /dev/null +++ b/types/material__textfield/constants.d.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ARIA_CONTROLS: 'aria-controls'; + INPUT_SELECTOR: '.mdc-text-field__input'; + LABEL_SELECTOR: '.mdc-text-field__label'; + ICON_SELECTOR: '.mdc-text-field__icon'; + ICON_EVENT: 'MDCTextField:icon'; + BOTTOM_LINE_SELECTOR: '.mdc-text-field__bottom-line'; +} + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-text-field'; + UPGRADED: 'mdc-text-field--upgraded'; + DISABLED: 'mdc-text-field--disabled'; + FOCUSED: 'mdc-text-field--focused'; + INVALID: 'mdc-text-field--invalid'; + LABEL_FLOAT_ABOVE: 'mdc-text-field__label--float-above'; + LABEL_SHAKE: 'mdc-text-field__label--shake'; + BOX: 'mdc-text-field--box'; + TEXT_FIELD_ICON: 'mdc-text-field__icon'; + TEXTAREA: 'mdc-text-field--textarea'; +} diff --git a/types/material__textfield/foundation.d.ts b/types/material__textfield/foundation.d.ts new file mode 100644 index 0000000000..d36d83867e --- /dev/null +++ b/types/material__textfield/foundation.d.ts @@ -0,0 +1,79 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCTextFieldAdapter, NativeInputType } from './adapter'; +import MDCTextFieldBottomLineFoundation from './bottom-line/foundation'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldAdapter; + + handleTextFieldInteraction(evt: Event): void; + + /** + * Activates the text field focus state. + */ + activateFocus(): void; + + /** + * Sets the bottom line's transform origin, so that the bottom line activate + * animation will animate out from the user's click location. + */ + setBottomLineTransformOrigin(evt: Event): void; + + /** + * Activates the Text Field's focus state in cases when the input value + * changes without user input (e.g. programatically). + */ + autoCompleteFocus(): void; + + /** + * Handles when bottom line animation ends, performing actions that must wait + * for animations to finish. + */ + handleBottomLineAnimationEnd(): void; + + /** + * Deactives the Text Field's focus state. + */ + deactivateFocus(): void; + + /** + * True if the Text Field is disabled. + */ + isDisabled(): boolean; + + /** + * Sets the text-field disabled or enabled. + */ + setDisabled(disabled: boolean): void; + + /** + * Sets the content of the helper text. + */ + setHelperTextContent(content: string): void; + + /** + * Sets the validity state of the Text Field. + */ + setValid(isValid: boolean): void; +} diff --git a/types/material__textfield/helper-text/adapter.d.ts b/types/material__textfield/helper-text/adapter.d.ts new file mode 100644 index 0000000000..d8320bd0f4 --- /dev/null +++ b/types/material__textfield/helper-text/adapter.d.ts @@ -0,0 +1,58 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Text Field Helper Text. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the TextField helper text into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export default class MDCTextFieldHelperTextAdapter { + /** + * Adds a class to the helper text element. + */ + addClass(className: string): void; + + /** + * Removes a class from the helper text element. + */ + removeClass(className: string): void; + + /** + * Returns whether or not the helper text element contains the given class. + */ + hasClass(className: string): boolean; + + /** + * Sets an attribute with a given value on the helper text element. + */ + setAttr(attr: string, value: string): void; + + /** + * Removes an attribute from the helper text element. + */ + removeAttr(attr: string): void; + + /** + * Sets the text content for the helper text element. + */ + setContent(content: string): void; +} diff --git a/types/material__textfield/helper-text/constants.d.ts b/types/material__textfield/helper-text/constants.d.ts new file mode 100644 index 0000000000..5418851e63 --- /dev/null +++ b/types/material__textfield/helper-text/constants.d.ts @@ -0,0 +1,28 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ARIA_HIDDEN: 'aria-hidden'; + ROLE: 'role'; +} + +export interface cssClasses extends MDCStrings { + HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent'; + HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'; +} diff --git a/types/material__textfield/helper-text/foundation.d.ts b/types/material__textfield/helper-text/foundation.d.ts new file mode 100644 index 0000000000..eccf531e51 --- /dev/null +++ b/types/material__textfield/helper-text/foundation.d.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCTextFieldHelperTextAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldHelperTextFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldHelperTextAdapter; + + /** + * Sets the content of the helper text field. + */ + setContent(content: string): void; + + /** Makes the helper text visible to the screen reader. */ + showToScreenReader(): void; + + /** + * Sets the validity of the helper text based on the input validity. + */ + setValidity(inputIsValid: boolean): void; +} diff --git a/types/material__textfield/helper-text/index.d.ts b/types/material__textfield/helper-text/index.d.ts new file mode 100644 index 0000000000..6c26000366 --- /dev/null +++ b/types/material__textfield/helper-text/index.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCTextFieldHelperTextAdapter from './adapter'; +import MDCTextFieldHelperTextFoundation from './foundation'; + +export {MDCTextFieldHelperTextAdapter, MDCTextFieldHelperTextFoundation}; + +export class MDCTextFieldHelperText extends MDCComponent { + static attachTo(root: Element): MDCTextFieldHelperText; + + readonly foundation: MDCTextFieldHelperTextFoundation; + + getDefaultFoundation(): MDCTextFieldHelperTextFoundation; +} diff --git a/types/material__textfield/index.d.ts b/types/material__textfield/index.d.ts new file mode 100644 index 0000000000..85d4c36420 --- /dev/null +++ b/types/material__textfield/index.d.ts @@ -0,0 +1,61 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCRipple } from 'material__ripple'; + +import { cssClasses, strings } from './constants'; +import { MDCTextFieldAdapter } from './adapter'; +import MDCTextFieldFoundation from './foundation'; +import { MDCTextFieldBottomLine } from './bottom-line/index'; +import { MDCTextFieldHelperText } from './helper-text/index'; + +export {MDCTextFieldAdapter, MDCTextFieldFoundation}; + +export class MDCTextField extends MDCComponent { + static attachTo(root: Element): MDCTextField; + + initialize( + rippleFactory?: (el: Element) => MDCRipple, + bottomLineFactory?: (el: Element) => MDCTextFieldBottomLine + ): void; + + destroy(): void; + + /** + * Initiliazes the Text Field's internal state based on the environment's + * state. + */ + initialSyncWithDom(): void; + + disabled: boolean; + + valid: boolean; + + /** + * Sets the helper text element content. + */ + helperTextContent: string; + + getDefaultFoundation(): MDCTextFieldFoundation; +} diff --git a/types/material__textfield/tsconfig.json b/types/material__textfield/tsconfig.json new file mode 100644 index 0000000000..a483098ccd --- /dev/null +++ b/types/material__textfield/tsconfig.json @@ -0,0 +1,35 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "helper-text/constants.d.ts", + "helper-text/adapter.d.ts", + "helper-text/index.d.ts", + "helper-text/foundation.d.ts", + "bottom-line/constants.d.ts", + "bottom-line/adapter.d.ts", + "bottom-line/index.d.ts", + "bottom-line/foundation.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__textfield/tslint.json b/types/material__textfield/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__textfield/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__toolbar/adapter.d.ts b/types/material__toolbar/adapter.d.ts new file mode 100644 index 0000000000..625b296cf8 --- /dev/null +++ b/types/material__toolbar/adapter.d.ts @@ -0,0 +1,49 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCToolbarAdapter { + hasClass(className: string): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + registerScrollHandler(handler: EventListener): void; + + deregisterScrollHandler(handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + getViewportWidth(): number; + + getViewportScrollY(): number; + + getOffsetHeight(): number; + + getFirstRowElementOffsetHeight(): number; + + notifyChange(evtData: {flexibleExpansionRatio: number}): void; + + setStyle(property: string, value: string): void; + + setStyleForTitleElement(property: string, value: string): void; + + setStyleForFlexibleRowElement(property: string, value: string): void; + + setStyleForFixedAdjustElement(property: string, value: string): void; +} diff --git a/types/material__toolbar/constants.d.ts b/types/material__toolbar/constants.d.ts new file mode 100644 index 0000000000..8f984ac113 --- /dev/null +++ b/types/material__toolbar/constants.d.ts @@ -0,0 +1,41 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + FIXED: 'mdc-toolbar--fixed'; + FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only'; + FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row'; + TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible'; + FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior'; + FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized'; + FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'; +} + +export interface strings extends MDCStrings { + TITLE_SELECTOR: '.mdc-toolbar__title'; + FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child'; + CHANGE_EVENT: 'MDCToolbar:change'; +} + +export interface numbers extends MDCNumbers { + MAX_TITLE_SIZE: 2.125; + MIN_TITLE_SIZE: 1.25; + TOOLBAR_ROW_HEIGHT: 64; + TOOLBAR_ROW_MOBILE_HEIGHT: 56; + TOOLBAR_MOBILE_BREAKPOINT: 600; +} diff --git a/types/material__toolbar/foundation.d.ts b/types/material__toolbar/foundation.d.ts new file mode 100644 index 0000000000..883c0b19e0 --- /dev/null +++ b/types/material__toolbar/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import MDCFoundation from 'material__base/foundation'; +import { cssClasses, strings, numbers } from './constants'; +import { MDCToolbarAdapter } from './adapter'; + +export default class MDCToolbarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCToolbarAdapter; + + updateAdjustElementStyles(): void; +} diff --git a/types/material__toolbar/index.d.ts b/types/material__toolbar/index.d.ts new file mode 100644 index 0000000000..1b048c64c9 --- /dev/null +++ b/types/material__toolbar/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; + +import MDCToolbarFoundation from './foundation'; +import { MDCToolbarAdapter } from './adapter'; +import * as util from './util'; + +export {MDCToolbarAdapter, MDCToolbarFoundation, util}; + +export class MDCToolbar extends MDCComponent { + static attachTo(root: HTMLElement): MDCToolbar; + + fixedAdjustElement: HTMLElement; + + getDefaultFoundation(): MDCToolbarFoundation; +} diff --git a/types/material__toolbar/tsconfig.json b/types/material__toolbar/tsconfig.json new file mode 100644 index 0000000000..3feaa72ba5 --- /dev/null +++ b/types/material__toolbar/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/material__toolbar/tslint.json b/types/material__toolbar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__toolbar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__toolbar/util.d.ts b/types/material__toolbar/util.d.ts new file mode 100644 index 0000000000..37506958e7 --- /dev/null +++ b/types/material__toolbar/util.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Determine whether the current browser supports passive event listeners, and if so, use them. +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean; diff --git a/types/meow/index.d.ts b/types/meow/index.d.ts index 2585d421ae..20e40c63f7 100644 --- a/types/meow/index.d.ts +++ b/types/meow/index.d.ts @@ -1,11 +1,13 @@ -// Type definitions for meow 3.6 +// Type definitions for meow 4.x // Project: https://github.com/sindresorhus/meow -// Definitions by: KnisterPeter +// Definitions by: KnisterPeter , Lindsey Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -import * as minimist from 'minimist'; +import * as buildOptions from "minimist-options"; -declare function meow(options: string | string[] | meow.Options, minimistOptions?: minimist.Opts): meow.Result; +declare function meow(helpMessage: string | string[], options: meow.Options): meow.Result; +declare function meow(options: string | string[] | meow.Options): meow.Result; declare namespace meow { interface Options { description?: string | boolean; @@ -14,14 +16,18 @@ declare namespace meow { pkg?: any; argv?: string[]; inferType?: boolean; + flags?: buildOptions.Options; + autoHelp?: boolean; + autoVersion?: boolean; } interface Result { input: string[]; flags: { [name: string]: any }; - pkg: any; + pkg: object; help: string; showHelp(code?: number): void; + showVersion(): void; } } diff --git a/types/meow/meow-tests.ts b/types/meow/meow-tests.ts index 6560b76bef..8915603292 100644 --- a/types/meow/meow-tests.ts +++ b/types/meow/meow-tests.ts @@ -1,19 +1,39 @@ import meow = require('meow'); -import Options = meow.Options; -const options: Options = {}; -options.description = true; -options.description = 'string'; -options.help = true; -options.help = 'string'; -options.version = true; -options.version = 'string'; -options.argv = ['string', 'string']; -options.inferType = true; +const cli = meow("Help text", + { + flags: { + unicorn: { + type: 'boolean', + alias: 'u' + }, + fooBar: { + type: 'string', + default: 'foo' + } + } + } +); -meow(options); -meow('Usage text', { - alias: { - opt: 'opt' - } +const cli2 = meow("Help text"); + +const cli3 = meow({ + description: "version string", + help: "help string", + version: "1.0.0", + pkg: {}, + argv: ['foo', 'bar'], + inferType: true, + autoHelp: true, + autoVersion: true, + flags: { + unicorn: { + type: 'boolean', + alias: 'u' + }, + fooBar: { + type: 'string', + default: 'foo' + } + } }); diff --git a/types/mocha/index.d.ts b/types/mocha/index.d.ts index 236c3429b1..06ef96c618 100644 --- a/types/mocha/index.d.ts +++ b/types/mocha/index.d.ts @@ -147,6 +147,7 @@ declare namespace Mocha { sync: boolean; timedOut: boolean; timeout(n: number | string): this; + duration?: number; } /** Partial interface for Mocha's `Suite` class. */ @@ -170,9 +171,30 @@ declare namespace Mocha { currentTest: ITest; } + interface IStats { + suites: number; + tests: number; + passes: number; + pending: number; + failures: number; + start?: Date; + end?: Date; + duration?: Date; + } /** Partial interface for Mocha's `Runner` class. */ - interface IRunner { } + interface IRunner { + stats?: IStats; + started: boolean; + suite: ISuite; + total: number; + failures: number; + grep: (re: string, invert: boolean) => this; + grepTotal: (suite: ISuite) => number; + globals: (arr: ReadonlyArray) => this | string[]; + abort: () => this; + run: (fn?: (failures: number) => void) => this; + } interface IContextDefinition { (description: string, callback: (this: ISuiteCallbackContext) => void): ISuite; @@ -191,13 +213,7 @@ declare namespace Mocha { export module reporters { export class Base { - stats: { - suites: number; - tests: number; - passes: number; - pending: number; - failures: number; - }; + stats: IStats; constructor(runner: IRunner); } diff --git a/types/mocha/mocha-tests.ts b/types/mocha/mocha-tests.ts index 2549c3cb68..0146c04b13 100644 --- a/types/mocha/mocha-tests.ts +++ b/types/mocha/mocha-tests.ts @@ -1,5 +1,8 @@ let boolean: boolean; let string: string; +let number: number; +let stringOrUndefined: string | undefined; +let dateOrUndefined: Date | undefined; function test_describe() { describe('something', () => { }); @@ -112,7 +115,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); setup(function () { @@ -123,7 +126,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); setup(function (done) { @@ -134,7 +137,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -158,7 +161,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); teardown(function () { @@ -169,7 +172,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); teardown(function (done) { @@ -180,7 +183,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -192,7 +195,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach(function () { @@ -203,7 +206,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach(function (done) { @@ -214,7 +217,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach("my description", function () { @@ -224,7 +227,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach("my description", function (done) { @@ -235,7 +238,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -255,7 +258,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach(function () { @@ -266,7 +269,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach(function (done) { @@ -277,7 +280,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach("my description", function () { @@ -287,7 +290,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach("my description", function (done) { @@ -298,7 +301,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -455,3 +458,44 @@ function test_run_withOnComplete() { function test_throwError() { mocha.throwError(new Error("I'm an error!")); } + +function test_mochaRunner_properties(runner: MochaDef.IRunner, suite: MochaDef.ISuite) { + runner = runner.abort(); + + if (runner.stats !== undefined) { + number = runner.stats.failures; + number = runner.stats.passes; + number = runner.stats.pending; + number = runner.stats.suites; + number = runner.stats.tests; + + dateOrUndefined = runner.stats.start; + dateOrUndefined = runner.stats.end; + dateOrUndefined = runner.stats.duration; + } + + let s: MochaDef.ISuite = runner.suite; + boolean = runner.started; + number = runner.total; + number = runner.failures; + + runner = runner.grep("regex", false); + number = runner.grepTotal(suite); + + let globals: string[] | MochaDef.IRunner= runner.globals(["hello", "world"]); + + runner = runner.run(); + runner = runner.run((f: number) => {}); +} + +function test_base_reporter_properties(reporter: MochaDef.reporters.Base) { + number = reporter.stats.failures; + number = reporter.stats.passes; + number = reporter.stats.pending; + number = reporter.stats.suites; + number = reporter.stats.tests; + + dateOrUndefined = reporter.stats.start; + dateOrUndefined = reporter.stats.end; + dateOrUndefined = reporter.stats.duration; +} \ No newline at end of file diff --git a/types/mocha/tsconfig.json b/types/mocha/tsconfig.json index 43be806414..6e88356fe4 100644 --- a/types/mocha/tsconfig.json +++ b/types/mocha/tsconfig.json @@ -6,8 +6,8 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/moment-timezone/index.d.ts b/types/moment-timezone/index.d.ts index c3927415c6..da5e42bc2d 100644 --- a/types/moment-timezone/index.d.ts +++ b/types/moment-timezone/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Michel Salib , Alan Brazil Lins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as moment from 'moment'; +import moment = require('moment'); // require("moment-timezone") === require("moment") export = moment; diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 7ac3ee7e41..3cf4e4ca2a 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -694,7 +694,7 @@ declare module "mongoose" { } interface SchemaOptions { - /** defaults to null (which means use the connection's autoIndex option) */ + /** defaults to false (which means use the connection's autoIndex option) */ autoIndex?: boolean; /** defaults to true */ bufferCommands?: boolean; diff --git a/types/new-relic-browser/index.d.ts b/types/new-relic-browser/index.d.ts index 59b2f9a8e6..0064ee4ad2 100644 --- a/types/new-relic-browser/index.d.ts +++ b/types/new-relic-browser/index.d.ts @@ -133,7 +133,6 @@ declare namespace NewRelic { * @param name This will be used as the name of the tracer. If you do not include a name, * New Relic Browser does not add a node to the interaction tree. The callback time will be * attributed to the parent node. - * @param syncCallback * @returns This method ends the async time. It calls (and times) the callback that was passed into createTracer(). * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-create-tracer */ @@ -170,7 +169,6 @@ declare namespace NewRelic { * has finished. You can invoke methods to modify the interaction, but methods that have asynchronous * side effects will not have an effect. * - * @param callback * @returns This method returns the same API object created by interaction(). * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-on-end */ diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index a5d3f078fe..2784d95fa3 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -14,7 +14,7 @@ declare module "node-forge" { type Utf8 = string; type OID = string; - namespace pem { + namespace pem { interface EncodeOptions { maxline?: number; @@ -32,7 +32,7 @@ declare module "node-forge" { function encode(msg: ObjectPEM, options?: EncodeOptions): string; function decode(str: string): ObjectPEM[]; } - + namespace pki { type PEM = string; @@ -79,10 +79,11 @@ declare module "node-forge" { interface CertificateField extends CertificateFieldOptions { valueConstructed?: boolean; valueTagClass?: asn1.Class; - value?: any[]; + value?: any[] | string; extensions?: any[]; } + interface Certificate { version: number; serialNumber: string; @@ -107,11 +108,61 @@ declare module "node-forge" { extensions: any[]; publicKey: any; md: any; + /** + * Sets the subject of this certificate. + * + * @param attrs the array of subject attributes to use. + * @param uniqueId an optional a unique ID to use. + */ + setSubject(attrs: CertificateField[], uniqueId?: string): void; + /** + * Sets the subject of this certificate. + * + * @param attrs the array of subject attributes to use. + * @param uniqueId an optional a unique ID to use. + */ + setIssuer(attrs: CertificateField[], uniqueId?: string): void; + /** + * Sets the extensions of this certificate. + * + * @param exts the array of extensions to use. + */ + setExtensions(exts: any[]): void; + /** + * Gets an extension by its name or id. + * + * @param options the name to use or an object with: + * name the name to use. + * id the id to use. + * + * @return the extension or null if not found. + */ + getExtension(options: string | {name: string;} | {id: number;}): {} | undefined; + + /** + * Signs this certificate using the given private key. + * + * @param key the private key to sign with. + * @param md the message digest object to use (defaults to forge.md.sha1). + */ + sign(key: pki.Key, md: md.MessageDigest): void; + /** + * Attempts verify the signature on the passed certificate using this + * certificate's public key. + * + * @param child the certificate to verify. + * + * @return true if verified, false if not. + */ + verify(child: Certificate): boolean; + } function certificateFromAsn1(obj: asn1.Asn1, computeHash?: boolean): Certificate; function decryptRsaPrivateKey(pem: PEM, passphrase?: string): Key; + + function createCertificate(): Certificate; } namespace ssh { diff --git a/types/node-forge/node-forge-tests.ts b/types/node-forge/node-forge-tests.ts index 63ccca6c70..29b8267714 100644 --- a/types/node-forge/node-forge-tests.ts +++ b/types/node-forge/node-forge-tests.ts @@ -1,4 +1,4 @@ -import * as forge from "node-forge"; +import * as forge from 'node-forge'; let keypair = forge.pki.rsa.generateKeyPair({ bits: 512 }); let privateKeyPem = forge.pki.privateKeyToPem(keypair.privateKey); @@ -8,19 +8,23 @@ let x: string = forge.ssh.privateKeyToOpenSSH(key); let pemKey: forge.pki.PEM = publicKeyPem; let publicKeyRsa = forge.pki.publicKeyFromPem(pemKey); let privateKeyRsa = forge.pki.privateKeyFromPem(privateKeyPem); +let cert = forge.pki.createCertificate(); { let subjectPublicKeyInfo = forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.OID, false, - forge.asn1.oidToDer(forge.pki.oids['rsaEncryption']).getBytes(), + forge.asn1.create( + forge.asn1.Class.UNIVERSAL, + forge.asn1.Type.OID, + false, + forge.asn1.oidToDer(forge.pki.oids['rsaEncryption']).getBytes() ), - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.NULL, false, ''), + forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.NULL, false, '') ]), forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.BITSTRING, false, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []), - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []), + forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []) ]) ]) ]); @@ -52,12 +56,14 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin src = new Uint8Array(2); encode = forge.util.binary.hex.encode(src); decode = forge.util.binary.hex.decode(encode); - if (encode !== '0000' || src.byteLength !== decode.byteLength) throw Error('forge.util.binary.hex.encode / decode fail'); + if (encode !== '0000' || src.byteLength !== decode.byteLength) + throw Error('forge.util.binary.hex.encode / decode fail'); src = new Uint8Array(2); encode = forge.util.binary.base64.encode(src); decode = forge.util.binary.base64.decode(encode); - if (encode !== 'AAA=' || src.byteLength !== decode.byteLength) throw Error('forge.util.binary.base64.encode / decode fail'); + if (encode !== 'AAA=' || src.byteLength !== decode.byteLength) + throw Error('forge.util.binary.base64.encode / decode fail'); src = new Uint8Array(10); encode = forge.util.binary.raw.encode(src); @@ -97,7 +103,6 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin if (hex.length !== 40) throw Error('forge.md.MessageDigest.update / digest fail'); } - { let md: forge.md.MessageDigest; let hex: string; @@ -110,26 +115,74 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin } { - let payload = { "asd": "asd" } - let cipher = forge.cipher.createCipher( - "3DES-ECB", - forge.util.createBuffer(key, "raw") - ); + let payload = { asd: 'asd' }; + let cipher = forge.cipher.createCipher('3DES-ECB', forge.util.createBuffer(key, 'raw')); cipher.start(); - cipher.update(forge.util.createBuffer(JSON.stringify(payload), "raw")); + cipher.update(forge.util.createBuffer(JSON.stringify(payload), 'raw')); cipher.finish(); let encrypted = cipher.output; let token = forge.util.encode64(encrypted.getBytes()); - let decipher = forge.cipher.createDecipher( - "3DES-ECB", - forge.util.createBuffer(key, "raw") - ); + let decipher = forge.cipher.createDecipher('3DES-ECB', forge.util.createBuffer(key, 'raw')); decipher.start(); - decipher.update(forge.util.createBuffer(forge.util.decode64(token), "raw")); + decipher.update(forge.util.createBuffer(forge.util.decode64(token), 'raw')); decipher.finish(); let decrypted = decipher.output as forge.util.ByteStringBuffer; let content = JSON.parse(forge.util.encodeUtf8(decrypted.getBytes())); if (content.asd == payload.asd) throw Error('forge.cipher.createCipher failed'); -} \ No newline at end of file +} + +{ + cert.publicKey = keypair.publicKey; + cert.serialNumber = new Date().getTime() + ''; + cert.validity.notBefore = new Date(); + cert.validity.notAfter = new Date(); + cert.validity.notAfter.setFullYear(cert.validity.notAfter.getFullYear() + 20); + const attrs = [ + { + name: 'commonName', + value: 'x22x22' + }, + { + name: 'countryName', + value: 'GitHub' + }, + { + shortName: 'ST', + value: 'GitHub' + }, + { + name: 'localityName', + value: 'GitHub' + }, + { + name: 'organizationName', + value: 'x22x22' + }, + { + shortName: 'OU', + value: 'https://github.com/x22x22' + } + ]; + cert.setSubject(attrs); + cert.setIssuer(attrs); + cert.setExtensions([ + { + name: 'basicConstraints', + critical: true, + cA: true + }, + { + name: 'keyUsage', + critical: true, + keyCertSign: true + }, + { + name: 'subjectKeyIdentifier' + } + ]); + + // self-sign certificate + cert.sign(keypair.privateKey, forge.md.sha256.create()); +} diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 5bd4315bfd..3f57526a19 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -3237,6 +3237,16 @@ declare module paper { * Deselects all selected items in the project. */ deselectAll(): void; + + /** + * Adds the specified layer at the end of the this project’s layers list. + */ + addLayer(layer: Layer): Layer; + + /** + * Inserts the specified layer at the specified index in this project’s layers list. + */ + insertLayer(index: number, layer: Layer): Layer; /** * Perform a hit-test on the items contained within the project at the location of the specified point. diff --git a/types/parse-torrent/index.d.ts b/types/parse-torrent/index.d.ts index c6bd901976..9b410759a3 100644 --- a/types/parse-torrent/index.d.ts +++ b/types/parse-torrent/index.d.ts @@ -5,7 +5,7 @@ /// -import * as MagnetUri from 'magnet-uri'; +import MagnetUri = require('magnet-uri'); import * as ParseTorrentFile from 'parse-torrent-file'; declare const ParseTorrent: ParseTorrent.ParseTorrent; diff --git a/types/passport-jwt/index.d.ts b/types/passport-jwt/index.d.ts index c300276fe2..0a71c4b725 100644 --- a/types/passport-jwt/index.d.ts +++ b/types/passport-jwt/index.d.ts @@ -4,11 +4,13 @@ // Alex Young // David Ng // Carlos Eduardo Scheffer +// Byungjin Kim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import { Strategy as PassportStrategy } from 'passport-strategy'; import {Request} from 'express'; +import { VerifyOptions } from 'jsonwebtoken' export declare class Strategy extends PassportStrategy { constructor(opt: StrategyOptions, verify: VerifyCallback); @@ -24,6 +26,7 @@ export interface StrategyOptions { algorithms?: string[]; ignoreExpiration?: boolean; passReqToCallback?: boolean; + jsonWebTokenOptions?: VerifyOptions; } export interface VerifyCallback { diff --git a/types/qrcode/index.d.ts b/types/qrcode/index.d.ts index cb2ce4a9b7..c04a07c20f 100644 --- a/types/qrcode/index.d.ts +++ b/types/qrcode/index.d.ts @@ -127,65 +127,127 @@ export interface QRCode { */ export function create(text: string | QRCodeSegment[], options: QRCodeOptions): QRCode; +/** + * Draws qr code symbol to canvas. + */ +export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], callback: (error: Error) => void): void; +/** + * Draws qr code symbol to canvas. + */ +export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error) => void): void; +/** + * Draws qr code symbol to canvas. + */ +export function toCanvas(text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(text: string | QRCodeSegment[], callback: (error: Error, canvas: HTMLCanvasElement) => void): void; +/** + * Draws qr code symbol to canvas. + */ +export function toCanvas(text: string | QRCodeSegment[], options: QRCodeOptions): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error, canvas: HTMLCanvasElement) => void): void; +/** + * Draws qr code symbol to node canvas. + */ +export function toCanvas(canvas: any, text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to node canvas. */ export function toCanvas(canvas: any, text: string | QRCodeSegment[], callback: (error: Error) => void): void; +/** + * Draws qr code symbol to node canvas. + */ +export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; /** * Draws qr code symbol to node canvas. */ export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error) => void): void; +/** + * Returns a Data URI containing a representation of the QR Code image. + */ +export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[]): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], callback: (error: Error, url: string) => void): void; +/** + * Returns a Data URI containing a representation of the QR Code image. + */ +export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void; +/** + * Returns a Data URI containing a representation of the QR Code image. + */ +export function toDataURL(text: string | QRCodeSegment[]): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(text: string | QRCodeSegment[], callback: (error: Error, url: string) => void): void; +/** + * Returns a Data URI containing a representation of the QR Code image. + */ +export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void; +/** + * Returns a string representation of the QR Code. + * If choosen output format is svg it will returns a string containing xml code. + */ +export function toString(text: string | QRCodeSegment[]): Promise; /** * Returns a string representation of the QR Code. * If choosen output format is svg it will returns a string containing xml code. */ export function toString(text: string | QRCodeSegment[], callback: (error: Error, string: string) => void): void; +/** + * Returns a string representation of the QR Code. + * If choosen output format is svg it will returns a string containing xml code. + */ +export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions): Promise; /** * Returns a string representation of the QR Code. * If choosen output format is svg it will returns a string containing xml code. */ export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions, callback: (error: Error, string: string) => void): void; +/** + * Saves QR Code to image file. + * If options.type is not specified, the format will be guessed from file extension. + * Recognized extensions are png, svg, txt. + */ +export function toFile(path: string, text: string | QRCodeSegment[]): Promise; /** * Saves QR Code to image file. * If options.type is not specified, the format will be guessed from file extension. * Recognized extensions are png, svg, txt. */ export function toFile(path: string, text: string | QRCodeSegment[], callback: (error: Error) => void): void; +/** + * Saves QR Code to image file. + * If options.type is not specified, the format will be guessed from file extension. + * Recognized extensions are png, svg, txt. + */ +export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions): Promise; /** * Saves QR Code to image file. * If options.type is not specified, the format will be guessed from file extension. @@ -193,10 +255,18 @@ export function toFile(path: string, text: string | QRCodeSegment[], callback: ( */ export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions, callback: (error: Error) => void): void; +/** + * Writes QR Code image to stream. Only works with png format for now. + */ +export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[]): Promise; /** * Writes QR Code image to stream. Only works with png format for now. */ export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], callback: (error: Error) => void): void; +/** + * Writes QR Code image to stream. Only works with png format for now. + */ +export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; /** * Writes QR Code image to stream. Only works with png format for now. */ diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index ccd73c53d3..4ee63e0975 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1245,10 +1245,10 @@ declare namespace R { * Takes a predicate and a list and returns the pair of lists of elements * which do and do not satisfy the predicate, respectively. */ - partition(fn: (a: string) => boolean, list: ReadonlyArray): string[][]; - partition(fn: (a: T) => boolean, list: ReadonlyArray): T[][]; - partition(fn: (a: T) => boolean): (list: ReadonlyArray) => T[][]; - partition(fn: (a: string) => boolean): (list: ReadonlyArray) => string[][]; + partition(fn: (a: string) => boolean, list: ReadonlyArray): [string[], string[]]; + partition(fn: (a: T) => boolean, list: ReadonlyArray): [T[], T[]]; + partition(fn: (a: T) => boolean): (list: ReadonlyArray) => [T[], T[]]; + partition(fn: (a: string) => boolean): (list: ReadonlyArray) => [string[], string[]]; /** * Retrieve the value at a given path. diff --git a/types/react-dates/index.d.ts b/types/react-dates/index.d.ts index ef501229ff..2038b8a5d2 100644 --- a/types/react-dates/index.d.ts +++ b/types/react-dates/index.d.ts @@ -66,6 +66,7 @@ declare namespace ReactDates { reopenPickerOnClearDates?: boolean, renderCalendarInfo?: () => (string | JSX.Element), hideKeyboardShortcutsPanel?: boolean, + daySize?: number, isRTL?: boolean, // navigation related props diff --git a/types/react-infinite/index.d.ts b/types/react-infinite/index.d.ts index 28d3ead9b7..442764fe76 100644 --- a/types/react-infinite/index.d.ts +++ b/types/react-infinite/index.d.ts @@ -8,10 +8,10 @@ import * as React from "react"; -import Infinite = ReactInfinite.Infinite; export = Infinite; +export as namespace Infinite; -declare namespace ReactInfinite { +declare namespace Infinite { interface InfiniteProps extends React.Props { elementHeight: number | number[]; containerHeight?: number; @@ -28,8 +28,8 @@ declare namespace ReactInfinite { useWindowAsScrollContainer?: boolean; displayBottomUpwards?: boolean; } +} - export class Infinite extends React.Component { - static containerHeightScaleFactor(n: number): any; - } +declare class Infinite extends React.Component { + static containerHeightScaleFactor(n: number): any; } diff --git a/types/react-infinite/react-infinite-tests.tsx b/types/react-infinite/react-infinite-tests.tsx index 2aa7a23192..295be25528 100644 --- a/types/react-infinite/react-infinite-tests.tsx +++ b/types/react-infinite/react-infinite-tests.tsx @@ -1,13 +1,14 @@ import * as React from 'react'; import Infinite = require('react-infinite'); +import * as ReactInfinite from 'react-infinite'; class Test1 extends React.Component { render() { return ( -
-
-
+
+
+
); } @@ -17,9 +18,9 @@ class Test2 extends React.Component { render() { return ( -
-
-
+
+
+
); } @@ -29,10 +30,10 @@ class Test3 extends React.Component { render() { return ( -
-
-
+ useWindowAsScrollContainer> +
+
+
); } @@ -42,24 +43,37 @@ class Test4 extends React.Component { render() { return ( -
-
-
+ displayBottomUpwards> +
+
+
); } } -class ListItem extends React.Component<{key: number; num: number}, {}> { +class Test5 extends React.Component { + render() { + return ( + +
+
+
+ + ); + } +} + +class ListItem extends React.Component<{ key: number; num: number }, {}> { render() { return
- List Item {this.props.num} + List Item {this.props.num}
; } } -class InfiniteList extends React.Component<{}, {elements: React.ReactElement[], isInfiniteLoading: boolean}> { +class InfiniteList extends React.Component<{}, { elements: React.ReactElement[], isInfiniteLoading: boolean }> { constructor(props?: {}, context?: any) { super(props, context); this.state = { @@ -71,7 +85,7 @@ class InfiniteList extends React.Component<{}, {elements: React.ReactElement[]; for (var i = start; i < end; i++) { - elements.push() + elements.push() } return elements; } @@ -81,7 +95,7 @@ class InfiniteList extends React.Component<{}, {elements: React.ReactElement + containerHeight={250} + infiniteLoadBeginEdgeOffset={200} + onInfiniteLoad={this.handleInfiniteLoad} + loadingSpinnerDelegate={this.elementInfiniteLoad()} + isInfiniteLoading={this.state.isInfiniteLoading} + > {this.state.elements} ; } diff --git a/types/react-loadable/index.d.ts b/types/react-loadable/index.d.ts index 8b591d3f3a..08c5b52e39 100644 --- a/types/react-loadable/index.d.ts +++ b/types/react-loadable/index.d.ts @@ -1,12 +1,15 @@ // Type definitions for react-loadable 5.3 // Project: https://github.com/thejameskyle/react-loadable#readme -// Definitions by: Diogo Franco , Oden S. , Ian Ker-Seymer +// Definitions by: Diogo Franco +// Oden S. +// Ian Ker-Seymer +// Tomek Łaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 /// -declare namespace Loadable { +declare namespace LoadableExport { interface LoadingComponentProps { isLoading: boolean; pastDelay: boolean; @@ -182,7 +185,7 @@ declare namespace Loadable { } } -declare const LoadableExport: Loadable.Loadable; +declare const LoadableExport: LoadableExport.Loadable; /* tslint:disable-next-line */ declare module "react-loadable" { diff --git a/types/react-loadable/test/index.tsx b/types/react-loadable/test/index.tsx index 5045fdf125..7d25d849a7 100644 --- a/types/react-loadable/test/index.tsx +++ b/types/react-loadable/test/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import Loadable = require('react-loadable'); +import * as Loadable from 'react-loadable'; class LoadingComponent extends React.Component { render() { diff --git a/types/react-native-datepicker/index.d.ts b/types/react-native-datepicker/index.d.ts index 548de52db4..19b2f488ca 100644 --- a/types/react-native-datepicker/index.d.ts +++ b/types/react-native-datepicker/index.d.ts @@ -38,6 +38,9 @@ export interface DatePickerProps { declare class DatePicker extends React.Component { constructor(props: DatePickerProps); + + onPressDate(): void; + onPressCancel(): void; } export default DatePicker; diff --git a/types/react-native-datepicker/react-native-datepicker-tests.tsx b/types/react-native-datepicker/react-native-datepicker-tests.tsx index f21a1bc874..b208b5982c 100644 --- a/types/react-native-datepicker/react-native-datepicker-tests.tsx +++ b/types/react-native-datepicker/react-native-datepicker-tests.tsx @@ -6,14 +6,23 @@ interface MyDatePickerState { } export default class MyDatePicker extends React.Component<{}, MyDatePickerState> { + datepicker: DatePicker | null; + constructor(props: {}) { super(props); this.state = {date: "2016-05-15"}; } + componentDidMount() { + if (this.datepicker) { + this.datepicker.onPressDate(); + } + } + render() { return ( this.datepicker = datepicker} style={{width: 200}} date={this.state.date} mode="date" diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 8d40ad33a3..c2ca58a5f3 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -758,11 +758,7 @@ export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900"; letterSpacing?: number; lineHeight?: number; - /** - * Specifies text alignment. - * The value 'justify' is only supported on iOS. - */ - textAlign?: "auto" | "left" | "right" | "center"; + textAlign?: "auto" | "left" | "right" | "center" | "justify"; textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through"; textDecorationStyle?: "solid" | "double" | "dotted" | "dashed"; textDecorationColor?: string; @@ -7730,8 +7726,7 @@ export interface EasingStatic { } export namespace Animated { - // Most (all?) functions where AnimatedValue is used any subclass of Animated can be used as well. - type AnimatedValue = Animated; + type AnimatedValue = Value; type AnimatedValueXY = ValueXY; type Base = Animated; diff --git a/types/react-redux-toastr/index.d.ts b/types/react-redux-toastr/index.d.ts index 29570b99a2..125e0f138e 100644 --- a/types/react-redux-toastr/index.d.ts +++ b/types/react-redux-toastr/index.d.ts @@ -100,6 +100,7 @@ interface ReduxToastrProps { toastr?: ToastrState; transitionIn?: transitionInType; transitionOut?: transitionOutType; + className?: string; } interface ToastrEmitter { diff --git a/types/react-relay/classic.d.ts b/types/react-relay/classic.d.ts index 0db5308975..c600992669 100644 --- a/types/react-relay/classic.d.ts +++ b/types/react-relay/classic.d.ts @@ -209,13 +209,17 @@ export type OnReadyStateChange = ( } ) => void; -export interface RelayProp { +export interface RelayProp { readonly route: { name: string }; // incomplete, also has params and queries - readonly variables: any; - readonly pendingVariables?: any; - setVariables(variables: any, onReadyStateChange?: OnReadyStateChange): void; - forceFetch(variables: any, onReadyStateChange?: OnReadyStateChange): void; + readonly variables: V; + readonly pendingVariables?: V; + setVariables(variables: V, onReadyStateChange?: OnReadyStateChange): void; + forceFetch(variables: V, onReadyStateChange?: OnReadyStateChange): void; hasOptimisticUpdate(record: any): boolean; getPendingTransactions(record: any): RelayMutationTransaction[]; commitUpdate(mutation: Mutation, callbacks?: StoreUpdateCallbacks): any; } + +export interface RelayProps { + readonly relay: RelayProp; +} diff --git a/types/react-relay/index.d.ts b/types/react-relay/index.d.ts index 04c173e9e2..0b7d87ce58 100644 --- a/types/react-relay/index.d.ts +++ b/types/react-relay/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Johannes Schickling // Matt Martin // Eloy Durán +// Nicolas Pirotte // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 diff --git a/types/react-relay/test/react-relay-classic-tests.tsx b/types/react-relay/test/react-relay-classic-tests.tsx index 7aae267dfc..d8eaf005ca 100644 --- a/types/react-relay/test/react-relay-classic-tests.tsx +++ b/types/react-relay/test/react-relay-classic-tests.tsx @@ -43,11 +43,14 @@ export default class AddTweetMutation extends Relay.Mutation { } } -interface ArtworkProps { +interface ArtwokRelayVariables { + artworkID: string; +} + +interface ArtworkProps extends Relay.RelayProps { artwork: { title: string; }; - relay: Relay.RelayProp; } class Artwork extends React.Component { diff --git a/types/react-relay/test/react-relay-tests.tsx b/types/react-relay/test/react-relay-tests.tsx index f73b7c00c7..6fbd2dea3f 100644 --- a/types/react-relay/test/react-relay-tests.tsx +++ b/types/react-relay/test/react-relay-tests.tsx @@ -424,11 +424,14 @@ export default class AddTweetMutation extends Relay.Mutation { } } -interface ArtworkProps { +interface ArtwokRelayVariables { + artworkID: string; +} + +interface ArtworkProps extends Relay.RelayProps { artwork: { title: string; }; - relay: Relay.RelayProp; } class Artwork extends React.Component { diff --git a/types/react-widgets/index.d.ts b/types/react-widgets/index.d.ts index 00c6cbbc2a..883b94a897 100644 --- a/types/react-widgets/index.d.ts +++ b/types/react-widgets/index.d.ts @@ -1,6 +1,9 @@ -// Type definitions for react-widgets 3.2 +// Type definitions for react-widgets 4.1 // Project: https://github.com/jquense/react-widgets -// Definitions by: Rogier Schouten , Balázs Sándor , Frode Hansen +// Definitions by: Rogier Schouten +// Balázs Sándor +// Frode Hansen +// Andrew Makarov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/react-widgets/lib/Calendar.d.ts b/types/react-widgets/lib/Calendar.d.ts index d9d0a6d540..4cb97805d6 100644 --- a/types/react-widgets/lib/Calendar.d.ts +++ b/types/react-widgets/lib/Calendar.d.ts @@ -1,7 +1,13 @@ import * as React from 'react'; -import { ReactWidgetsCommonProps } from './CommonProps'; +import { ReactWidgetsCommonProps, AutoFocus } from './CommonProps'; -interface CalendarProps extends ReactWidgetsCommonProps{ +type CalendarView = 'month' | 'year' | 'decade' | 'century'; + +interface CalendarProps extends ReactWidgetsCommonProps, AutoFocus { + /** + * Set the culture of the Calendar, passed to the configured localizer. + */ + culture?: string; /** * The current selected date, should be a Date object or null. */ @@ -15,11 +21,19 @@ interface CalendarProps extends ReactWidgetsCommonProps{ * the Date object */ onChange?: (date?: Date) => void; + /** + * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. + */ + onKeyDown?: (event: KeyboardEvent) => void; /** * Callback fired when the Calendar navigates between views, or forward and backwards in * time. */ onNavigate?: (date: Date, direction: string, view: string ) => void; + /** + * A callback fired when the view changes. + */ + onViewChange?: () => void; /** * The minimum date that the Calendar can navigate from. */ @@ -99,6 +113,18 @@ interface CalendarProps extends ReactWidgetsCommonProps{ */ centuryFormat?: string | ((day: Date) => string); messages?: CalendarMessages; + /** + * Set a unique starting view + */ + defaultView?: CalendarView; + /** + * Controls the currently displayed calendar view. Use defaultView to set a unique starting view. + */ + view?: CalendarView; + /** + * Defines a list of views the Calendar can traverse through, starting with the first in the list to the last. + */ + views?: CalendarView[]; } interface CalendarMessages { diff --git a/types/react-widgets/lib/Combobox.d.ts b/types/react-widgets/lib/Combobox.d.ts index a3b6aadb94..0a059f102d 100644 --- a/types/react-widgets/lib/Combobox.d.ts +++ b/types/react-widgets/lib/Combobox.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { ReactWidgetsCommonDropdownProps } from './CommonProps'; +import { ReactWidgetsCommonDropdownProps, AutoFocus } from './CommonProps'; interface ComboBoxMessages { /** @@ -16,7 +16,7 @@ interface ComboBoxMessages { emptyFilter: string | ((props: ComboBoxProps) => string); } -interface ComboBoxProps extends ReactWidgetsCommonDropdownProps { +interface ComboBoxProps extends ReactWidgetsCommonDropdownProps, AutoFocus { /** * The current value of the Combobox. This can be an object (such as a member of the data * array) or a primitive value, hinted to by the valueField. The widget value does not need @@ -44,6 +44,11 @@ interface ComboBoxProps extends ReactWidgetsCommonDropdownProps { * comprise the value field (such as an id) and the field used to label the item. */ data?: any[]; + /** + * Delay + * @default 500 + */ + delay?: number; /** * A dataItem field name for uniquely identifying items in the data list. A valueField is * required when the value prop is not itself a dataItem. A valueField is useful when @@ -63,6 +68,15 @@ interface ComboBoxProps extends ReactWidgetsCommonDropdownProps { * component renders the text of the selected item (specified by textfield) */ itemComponent?: React.ReactType; + /** + * An object of props that is passed directly to the underlying input component. + */ + inputProps?: object; + listComponent?: React.ReactType | string; + /** + * An object of props that is passed directly to the underlying List component. + */ + listProps?: object; /** * Determines how to group the Combobox. Providing a string will group the data array by * that property. You can also provide a function which should return the group value. @@ -83,6 +97,12 @@ interface ComboBoxProps extends ReactWidgetsCommonDropdownProps { * always "startsWith", meaning it will search from the start of the textField property */ suggest?: boolean; + /** + * A Transition component from react-transition-group v2. The provided component will be used + * instead of the default SlideDownTransition for fully customizable animations. + * The transition component is also injected with a dropUp prop indicating the direction it should open. + */ + popupTransition?: React.ReactType | string; /** * Specify a filtering method used to reduce the items in the dropdown as you type. It can * be used in conjunction with the suggest prop or instead of it. There are a few built-in @@ -123,6 +143,10 @@ interface ComboBoxProps extends ReactWidgetsCommonDropdownProps { * The speed, in milliseconds, of the dropdown animation. */ duration?: number; + /** + * The HTML name attribute, passed directly to the input element. + */ + name?: string; /** * Object hash containing display text and/or text for screen readers. Use the messages * object to localize widget text and increase accessibility. diff --git a/types/react-widgets/lib/CommonProps.d.ts b/types/react-widgets/lib/CommonProps.d.ts index 2547a579a8..b407b96fe5 100644 --- a/types/react-widgets/lib/CommonProps.d.ts +++ b/types/react-widgets/lib/CommonProps.d.ts @@ -21,6 +21,13 @@ interface ReactWidgetsCommonProps extends React.Props { isRtl?: boolean; } +export interface AutoFocus { + /** + * Pass focus to component when it mounts. + */ + autoFocus?: boolean; +} + interface ReactWidgetsCommonDropdownProps extends ReactWidgetsCommonProps { /** * Show "drop up" not "drop down" diff --git a/types/react-widgets/lib/DateTimePicker.d.ts b/types/react-widgets/lib/DateTimePicker.d.ts index 3596f6063a..ee0428c67b 100644 --- a/types/react-widgets/lib/DateTimePicker.d.ts +++ b/types/react-widgets/lib/DateTimePicker.d.ts @@ -1,7 +1,12 @@ import * as React from 'react'; -import { ReactWidgetsCommonDropdownProps } from './CommonProps'; +import { ReactWidgetsCommonDropdownProps, AutoFocus } from './CommonProps'; +import { KeyboardEvent } from 'react'; -interface DateTimePickerProps extends ReactWidgetsCommonDropdownProps { +interface DateTimePickerProps extends ReactWidgetsCommonDropdownProps, AutoFocus { + /** + * Set the culture of the DateTimePicker, passed to the configured localizer. + */ + culture?: string; /** * Whether to show the date picker button. * @default true @@ -12,6 +17,10 @@ interface DateTimePickerProps extends ReactWidgetsCommonDropdownProps void; + /** + * The native onBlur event, called when focus leaves the DateTimePicker entirely. + */ + onBlur?: () => void; + /** + * The native onFocus event, called when focus enters the DateTimePicker. + */ + onFocus?: () => void; + /** + * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. + */ + onKeyDown?: (event: KeyboardEvent) => void; + /** + * The native onKeyPress event, called preventDefault will stop any custom behavior. + */ + onKeyPress?: (event: KeyboardEvent) => void; /** * This handler fires when an item has been selected from the list or calendar. It fires * before the onChange handler, and fires regardless of whether the value has actually @@ -98,10 +127,11 @@ interface DateTimePickerProps extends ReactWidgetsCommonDropdownProps void; /** * Whether or not the DateTimePicker is open. When unset (undefined) the DateTimePicker will - * handle the opening and closing internally. - * @enum false "calendar" "time" + * handle the opening and closing internally. + * @enum false "date" "time" + * @default false */ - open?: boolean | "calendar" | "time"; + open?: boolean | "date" | "time"; /** * The defaultOpen prop can be used to set an * initialization value for uncontrolled widgets. @@ -126,6 +156,20 @@ interface DateTimePickerProps extends ReactWidgetsCommonDropdownProps { +interface DropdownListProps extends ReactWidgetsCommonDropdownProps, AutoFocus { /** * The current value of the DropdownList. This can be an object (such as a member of the * data array) or a primitive value, hinted to by the valueField. The widget value does not @@ -21,12 +21,25 @@ interface DropdownListProps extends ReactWidgetsCommonDropdownProps void; + /** + * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. + */ + onKeyDown?: (event: KeyboardEvent) => void; + /** + * The native onKeyPress event, called preventDefault will stop any custom behavior. + */ + onKeyPress?: (event: KeyboardEvent) => void; /** * Provide an array of possible values for the DropdownList. If an array of objects is * provided you should use the valueField and textField props, to specify which object * properties comprise the value field (such as an id) and the field used to label the item. */ data?: any[]; + /** + * Delay + * @default 250 + */ + delay?: number; /** * A dataItem field name for uniquely identifying items in the data list. A valueField is * required when the value prop is not itself a dataItem. A valueField is useful when @@ -50,7 +63,7 @@ interface DropdownListProps extends ReactWidgetsCommonDropdownProps void; /** * Whether or not the DropdownList is open. When unset (undefined) the DropdownList will - * handle the opening and closing internally. + * handle the opening and closing internally. */ open?: boolean; /** @@ -128,6 +141,20 @@ interface DropdownListProps extends ReactWidgetsCommonDropdownProps { +interface MultiselectProps extends ReactWidgetsCommonDropdownProps, AutoFocus { + /** + * Enables the list option creation UI. onFilter will only the UI when actively filtering for a list item. + * @default 'onFilter' + */ + allowCreate?: boolean | 'onFilter'; /** * The current values of the Multiselect. The value should can null, or an array of * valueField values, or an array of objects (such as a few items in the data array) @@ -15,12 +20,20 @@ interface MultiselectProps extends ReactWidgetsCommonDropdownProps void; + onChange?: (dataItems: any[], metadata: { + dataItem: any; + action: 'insert' | 'remove'; + originalEvent?: any; + lastValue?: any[]; + searchTerm?: string; + }) => void; /** * This handler fires when an item has been selected from the list. It fires before the * onChange handler, and fires regardless of whether the value has actually changed */ - onSelect?: (value: any) => void; + onSelect?: (value: any, metadata: { + originalEvent: any; + }) => void; /** * This handler fires when the user chooses to create a new tag, not in the data list. It is * up to the widget parent to implement creation logic, a common implementation is shown @@ -51,7 +64,11 @@ interface MultiselectProps extends ReactWidgetsCommonDropdownProps void; + onSearch?: (searchTerm: string, metadata: { + action: 'clear' | 'input'; + lastSearchTerm?: string; + originalEvent?: any; + }) => void; /** * Whether or not the Multiselect is open. When unset (undefined) the Multiselect will * handle the opening and closing internally. The defaultOpen prop can be used to set an @@ -133,9 +154,29 @@ interface MultiselectProps extends ReactWidgetsCommonDropdownProps string); + createOption?: string | ((props: MultiselectProps) => string); + tagsLabel?: string | ((props: MultiselectProps) => string); + selectedItems?: string | ((props: MultiselectProps) => string); + noneSelected?: string | ((props: MultiselectProps) => string); + removeLabel?: string | ((props: MultiselectProps) => string); /** * The text label for creating new tags. * @default "(create new tag)" diff --git a/types/react-widgets/lib/NumberPicker.d.ts b/types/react-widgets/lib/NumberPicker.d.ts index 0feaee5bf1..474fe4dc39 100644 --- a/types/react-widgets/lib/NumberPicker.d.ts +++ b/types/react-widgets/lib/NumberPicker.d.ts @@ -1,7 +1,15 @@ import * as React from 'react'; -import { ReactWidgetsCommonProps } from './CommonProps'; +import { ReactWidgetsCommonProps, AutoFocus } from './CommonProps'; -interface NumberPickerProps extends ReactWidgetsCommonProps{ +interface NumberPickerProps extends ReactWidgetsCommonProps, AutoFocus { + /** + * Set the culture of the NumberPicker, passed to the configured localizer. + */ + culture?: string; + /** + * An object of props that is passed directly to the underlying input component. + */ + inputProps?: object; /** * The current value of the NumberPicker. */ @@ -51,6 +59,27 @@ interface NumberPickerProps extends ReactWidgetsCommonProps{ * object to localize widget text and increase accessibility. */ messages?: NumberPickerMessages; + /** + * The HTML name attribute, passed directly to the input element. + */ + name?: string; + /** + * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. + */ + onKeyDown?: (event: KeyboardEvent) => void; + /** + * The native onKeyPress event, called preventDefault will stop any custom behavior. + */ + onKeyPress?: (event: KeyboardEvent) => void; + /** + * Controls the visibility of the NumberPicker popup. Use defaultOpen to set an initial value for uncontrolled widgets. + * @default false + */ + open?: boolean; + /** + * Text to display in the input when the value is empty. + */ + placeholder?: string; } interface NumberPickerMessages { diff --git a/types/react-widgets/lib/SelectList.d.ts b/types/react-widgets/lib/SelectList.d.ts index a70f4c4de8..cf3539a56a 100644 --- a/types/react-widgets/lib/SelectList.d.ts +++ b/types/react-widgets/lib/SelectList.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; -import { ReactWidgetsCommonProps } from './CommonProps'; +import { ReactWidgetsCommonProps, AutoFocus } from './CommonProps'; -interface SelectListProps extends ReactWidgetsCommonProps{ +interface SelectListProps extends ReactWidgetsCommonProps, AutoFocus { /** * The current value or values of the SelectList. This can be an object (such as a member of * the data array) or a primitive value, hinted to by the valueField. The widget value does @@ -23,6 +23,11 @@ interface SelectListProps extends ReactWidgetsCommonProps{ * properties comprise the value field (such as an id) and the field used to label the item. */ data?: any[]; + /** + * Delay + * @default 250 + */ + delay?: number; /** * A dataItem field name for uniquely identifying items in the data list. A valueField is * required when the value prop is not itself a dataItem. A valueField is useful when @@ -58,6 +63,14 @@ interface SelectListProps extends ReactWidgetsCommonProps{ * the groupBy value will be used. */ groupComponent?: React.ReactType; + /** + * The native onKeyDown event, called preventDefault will prevent any custom behavior, included keyboard shortcuts. + */ + onKeyDown?: (event: KeyboardEvent) => void; + /** + * The native onKeyPress event, called preventDefault will stop any custom behavior. + */ + onKeyPress?: (event: KeyboardEvent) => void; /** * A handler called when focus shifts on the SelectList. Internally this is used to ensure * the focused item is in view. If you want to define your own "scrollTo" behavior or just @@ -77,6 +90,22 @@ interface SelectListProps extends ReactWidgetsCommonProps{ * object to localize widget text and increase accessibility. */ messages?: SelectListMessages; + /** + * @default List + */ + listComponent?: React.ReactType | string; + /** + * An object of props that is passed directly to the underlying List component. + */ + listProps?: object; + /** + * The HTML name attribute used to group checkboxes and radio buttons together. + */ + name?: string; + /** + * The HTML tabindex attribute, controls the order in which focus moves via the TAB key + */ + tabIndex?: number; } interface SelectListMessages { /** diff --git a/types/react-widgets/react-widgets-tests.tsx b/types/react-widgets/react-widgets-tests.tsx index d0af494394..c4e672c7b2 100644 --- a/types/react-widgets/react-widgets-tests.tsx +++ b/types/react-widgets/react-widgets-tests.tsx @@ -11,6 +11,10 @@ function itemComponent(props: { value: string }) { return {props.value}; } +function listComponent(props: { value: string }) { + return {props.value}; +} + class Test extends React.Component> { render() { return ( @@ -26,12 +30,12 @@ class Test extends React.Component> {
- - - - + + + + - +
> { /> + +
@@ -52,7 +64,45 @@ class Test extends React.Component> { - + +
+
+ + + + + + +
); diff --git a/types/react-widgets/tsconfig.json b/types/react-widgets/tsconfig.json index cb7126a5e5..87d8f47b06 100644 --- a/types/react-widgets/tsconfig.json +++ b/types/react-widgets/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", @@ -22,4 +22,4 @@ "index.d.ts", "react-widgets-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 83ab445356..c39e5eeb6c 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -3723,7 +3723,7 @@ declare namespace React { // ---------------------------------------------------------------------- interface ErrorInfo { /** - * Captures which component contained the exception, and it's ancestors. + * Captures which component contained the exception, and its ancestors. */ componentStack: string; } diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index 3b9afac937..c6207cd48e 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -161,7 +161,7 @@ export interface AreaProps extends EventAttributes, Partial | ContentRenderer; dot?: boolean | object | React.ReactElement | ContentRenderer; - label?: boolean | object | React.ReactElement | Label['content']; + label?: boolean | object | React.ReactElement | LabelProps['content']; hide?: boolean; layout?: LayoutType; baseLine?: number | any[]; @@ -399,7 +399,7 @@ export interface LineProps extends EventAttributes, Partial | Label['content']; + label?: boolean | object | React.ReactElement | LabelProps['content']; points?: Point[]; } @@ -432,7 +432,7 @@ export interface PieProps extends EventAttributes, Partial | React.ReactElement | boolean; label?: { offsetRadius: number; - } | Label['content'] | React.ReactElement | boolean; + } | LabelProps['content'] | React.ReactElement | boolean; activeShape?: object |ContentRenderer | React.ReactElement; activeIndex?: number | number[]; } @@ -547,7 +547,7 @@ export interface RadarProps extends EventAttributes, Partial | ContentRenderer; activeDot?: object | React.ReactElement | ContentRenderer | boolean; dot?: object | React.ReactElement | ContentRenderer | boolean; - label?: object | React.ReactElement | Label['content'] | boolean; + label?: object | React.ReactElement | LabelProps['content'] | boolean; legendType?: LegendType; hide?: boolean; } @@ -586,7 +586,7 @@ export interface RadialBarProps extends EventAttributes, Partial | Label['content'] | object; + label?: boolean | React.ReactElement | LabelProps['content'] | object; background?: boolean | React.ReactElement | ContentRenderer | object; hide?: boolean; } @@ -821,22 +821,16 @@ export interface TreemapProps extends EventAttributes, Animatable { export class Treemap extends React.Component { } -export interface Label { - className?: string; +export class Label extends React.Component { } + +export interface LabelProps { viewBox?: ViewBox | PolarViewBox; formatter?: LabelFormatter; - value: string | number; + value?: number | string; offset?: number; position?: PositionType; children?: React.ReactNode[] | React.ReactNode; - content?: React.ReactElement | ContentRenderer
CanvasRenderingContext2D.measureText() to measure the width of text elements. - */ - CANVAS - } - /** - * A basic label style which renders the label's {@link yfiles.graph.ILabel#text} and optionally a {@link yfiles.styles.DefaultLabelStyle#backgroundFill background} and {@link yfiles.styles.DefaultLabelStyle#backgroundStroke border}. - *

- * This style uses a {@link yfiles.styles.DefaultLabelStyleRenderer} to create its visualization. - *

- * @class - * @implements {yfiles.styles.ILabelStyle} - */ - export interface DefaultLabelStyle extends yfiles.lang.Object,yfiles.styles.ILabelStyle{} - export class DefaultLabelStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.ILabelStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#autoFlip} property on the created object. - *

- * @param {yfiles.view.Fill} options.backgroundFill The brush to use for the background box of the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundFill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.backgroundStroke The pen to use for the background box of the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundStroke} property on the created object. - *

- * @param {boolean} options.clipText A value that determines whether text should be clipped. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#clipText} property on the created object. - *

- * @param {yfiles.view.HorizontalTextAlignment} options.horizontalTextAlignment The text alignment. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#horizontalTextAlignment} property on the created object. - *

- * @param {yfiles.view.Fill} options.textFill The brush to use for the label's text. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#textFill} property on the created object. - *

- * @param {number} options.textSize The size of the text. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#textSize} property on the created object. - *

- * @param {yfiles.view.TextWrapping} options.wrapping The text trimming. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#wrapping} property on the created object. - *

- * @param {yfiles.view.Font} options.font The typeface to use for the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#font} property on the created object. - *

- * @param {yfiles.view.VerticalTextAlignment} options.verticalTextAlignment The vertical text alignment to use if the label is assigned more space than needed. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#verticalTextAlignment} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.ILabelStyleRenderer,autoFlip?:boolean,backgroundFill?:yfiles.view.Fill,backgroundStroke?:yfiles.view.Stroke,clipText?:boolean,horizontalTextAlignment?:yfiles.view.HorizontalTextAlignment,textFill?:yfiles.view.Fill,textSize?:number,wrapping?:yfiles.view.TextWrapping,font?:yfiles.view.Font,verticalTextAlignment?:yfiles.view.VerticalTextAlignment}); - /** - * Creates a new instance using {@link yfiles.styles.DefaultLabelStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#autoFlip} property on the created object. - *

- * @param {yfiles.view.Fill} options.backgroundFill The brush to use for the background box of the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundFill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.backgroundStroke The pen to use for the background box of the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundStroke} property on the created object. - *

- * @param {boolean} options.clipText A value that determines whether text should be clipped. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#clipText} property on the created object. - *

- * @param {yfiles.view.HorizontalTextAlignment} options.horizontalTextAlignment The text alignment. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#horizontalTextAlignment} property on the created object. - *

- * @param {yfiles.view.Fill} options.textFill The brush to use for the label's text. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#textFill} property on the created object. - *

- * @param {number} options.textSize The size of the text. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#textSize} property on the created object. - *

- * @param {yfiles.view.TextWrapping} options.wrapping The text trimming. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#wrapping} property on the created object. - *

- * @param {yfiles.view.Font} options.font The typeface to use for the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#font} property on the created object. - *

- * @param {yfiles.view.VerticalTextAlignment} options.verticalTextAlignment The vertical text alignment to use if the label is assigned more space than needed. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#verticalTextAlignment} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,backgroundFill?:yfiles.view.Fill,backgroundStroke?:yfiles.view.Stroke,clipText?:boolean,horizontalTextAlignment?:yfiles.view.HorizontalTextAlignment,textFill?:yfiles.view.Fill,textSize?:number,wrapping?:yfiles.view.TextWrapping,font?:yfiles.view.Font,verticalTextAlignment?:yfiles.view.VerticalTextAlignment}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the brush to use for the background box of the label. - *

- * The default value is null. - *

- * @default null - * @type {yfiles.view.Fill} - */ - backgroundFill:yfiles.view.Fill; - /** - * Gets or sets the vertical text alignment to use if the label is assigned more space than needed. - *

- * The default value is {@link yfiles.view.VerticalTextAlignment#TOP}. - *

- * @default yfiles.view.VerticalTextAlignment.TOP - * @type {yfiles.view.VerticalTextAlignment} - */ - verticalTextAlignment:yfiles.view.VerticalTextAlignment; - /** - * Gets or sets the text alignment. - *

- * The default value is {@link yfiles.view.HorizontalTextAlignment#LEFT}. - *

- * @default yfiles.view.HorizontalTextAlignment.LEFT - * @type {yfiles.view.HorizontalTextAlignment} - */ - horizontalTextAlignment:yfiles.view.HorizontalTextAlignment; - /** - * Gets or sets the text trimming. - *

- * The default value is {@link yfiles.view.TextWrapping#NONE}. - *

- * @default yfiles.view.TextWrapping.NONE - * @type {yfiles.view.TextWrapping} - */ - wrapping:yfiles.view.TextWrapping; - /** - * Gets or sets a value that determines whether text should be clipped. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - clipText:boolean; - /** - * Gets or sets the pen to use for the background box of the label. - *

- * The default value is null. - *

- * @default null - * @type {yfiles.view.Stroke} - */ - backgroundStroke:yfiles.view.Stroke; - /** - * - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - /** - * Gets or sets the typeface to use for the label. - *

- * The default value is an instance of {@link yfiles.styles.DefaultLabelStyle#font} for Arial". - *

- * @throws {Stubs.Exceptions.ArgumentError} value cannot be null! - * @type {yfiles.view.Font} - */ - font:yfiles.view.Font; - /** - * Gets or sets a value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented - * downwards, otherwise. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - autoFlip:boolean; - /** - * Gets or sets the brush to use for the label's text. - *

- * The default value is {@link yfiles.view.Fill#BLACK}. - *

- * @throws {Stubs.Exceptions.ArgumentError} value cannot be null! - * @default 'Black' - * @type {yfiles.view.Fill} - */ - textFill:yfiles.view.Fill; - /** - * Gets or sets the size of the text. - *

- * This property delegates to the size of the {@link yfiles.styles.DefaultLabelStyle#font} property. - *

- *

- * The default value is 12.0d. - *

- * @default 12 - * @type {number} - */ - textSize:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.DefaultLabelStyle; - } - /** - * A label style that draws an icon in addition to the text. - *

- * This style draws the icon at the location specified by {@link yfiles.styles.IconLabelStyle#iconPlacement} and delegates the drawing of the label's text to the {@link yfiles.styles.IconLabelStyle#wrapped} style. - *

- * @class - * @implements {yfiles.styles.ILabelStyle} - */ - export interface IconLabelStyle extends yfiles.lang.Object,yfiles.styles.ILabelStyle{} - export class IconLabelStyle { - /** - * Creates a new instance using the provided icon and renderer. - * @param icon The icon to draw. - * @param [renderer=null] The custom renderer for this style instance. - */ - constructor(icon:string,renderer?:yfiles.styles.ILabelStyleRenderer); - /** - * Creates a new instance using the provided icon and renderer. - * @param {Object} options The parameters to pass. - * @param options.icon The icon to draw. - * @param [options.renderer=null] The custom renderer for this style instance. - * @param {boolean} options.autoFlip A value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#autoFlip} property on the created object. - *

- * @param {yfiles.graph.ILabelModelParameter} options.iconPlacement The parameter that specifies the icon placement. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#iconPlacement} property on the created object. - *

- * @param {yfiles.geometry.Size} options.iconSize The size of the icon to paint for the label. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#iconSize} property on the created object. - *

- * @param {yfiles.styles.ILabelStyle} options.wrapped The style that renders the text of the label. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#wrapped} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.wrappedInsets The insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#wrappedInsets} property on the created object. - *

- */ - constructor(options:{icon:string,renderer?:yfiles.styles.ILabelStyleRenderer,autoFlip?:boolean,iconPlacement?:yfiles.graph.ILabelModelParameter,iconSize?:yfiles.geometry.Size,wrapped?:yfiles.styles.ILabelStyle,wrappedInsets?:yfiles.geometry.Insets}); - /** - * Creates a new instance using no icon and {@link yfiles.styles.IconLabelStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#autoFlip} property on the created object. - *

- * @param {string} options.icon The URL of the icon. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#icon} property on the created object. - *

- * @param {yfiles.graph.ILabelModelParameter} options.iconPlacement The parameter that specifies the icon placement. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#iconPlacement} property on the created object. - *

- * @param {yfiles.geometry.Size} options.iconSize The size of the icon to paint for the label. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#iconSize} property on the created object. - *

- * @param {yfiles.styles.ILabelStyle} options.wrapped The style that renders the text of the label. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#wrapped} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.wrappedInsets The insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#wrappedInsets} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,icon?:string,iconPlacement?:yfiles.graph.ILabelModelParameter,iconSize?:yfiles.geometry.Size,wrapped?:yfiles.styles.ILabelStyle,wrappedInsets?:yfiles.geometry.Insets}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the URL of the icon. - *

- * The URL can either be a relative URL, an absolute URL, or a Data URI. Relative URLs are resolved relative to the - * document. Eventually, this string becomes the value of the href attribute of an SVG image element. - *

- * @type {string} - */ - icon:string; - /** - * Gets or sets the size of the icon to paint for the label. - *

- * The default value is {@link yfiles.geometry.Size#EMPTY}. - *

- * @type {yfiles.geometry.Size} - */ - iconSize:yfiles.geometry.Size; - /** - * Gets or sets the parameter that specifies the icon placement. - *

- * All valid node label model parameters can be used. The label's {@link yfiles.graph.ILabel#layout layout} will be interpreted as the a node's layout and the - * icon will be placed relative to that layout as if it was a node's label. - *

- *

- * The default value is {@link yfiles.graph.ExteriorLabelModel#WEST}. - *

- * @throws {Stubs.Exceptions.ArgumentError} value is null. - * @type {yfiles.graph.ILabelModelParameter} - */ - iconPlacement:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the style that renders the text of the label. - *

- * This style will be rendered before the icon and is responsible for rendering the {@link yfiles.graph.ILabel#text}, since {@link yfiles.styles.IconLabelStyleRenderer} - * will only render the {@link yfiles.styles.IconLabelStyle#icon}. - *

- *

- * The default value is {@link yfiles.styles.DefaultLabelStyle}. - *

- * @throws {Stubs.Exceptions.ArgumentError} value is null. - * @type {yfiles.styles.ILabelStyle} - */ - wrapped:yfiles.styles.ILabelStyle; - /** - * Gets or sets the insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. - *

- * The {@link yfiles.styles.IconLabelStyleRenderer#getPreferredSize} will take the preferred size of the {@link yfiles.styles.IconLabelStyle#wrapped}'s {@link yfiles.styles.ILabelStyleRenderer} - * and add these insets to it. During the {@link yfiles.view.IVisualCreator rendering} these insets will be used to offset the rendering of the wrapped - * style. - *

- *

- * The default insets are empty. - *

- * @default '0' - * @type {yfiles.geometry.Insets} - */ - wrappedInsets:yfiles.geometry.Insets; - /** - * - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - /** - * Gets a value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - autoFlip:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.IconLabelStyle; - } - /** - * A simple {@link yfiles.styles.ILabelStyleRenderer} implementation that can handle {@link yfiles.styles.DefaultLabelStyle} instances. - *

- * This implementation will just draw the label's {@link yfiles.graph.ILabel#text} using the properties provided by {@link yfiles.styles.DefaultLabelStyle} into - * the label's {@link yfiles.graph.ILabel#layout layout} area. - *

- * @class - * @implements {yfiles.styles.ILabelStyleRenderer} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface DefaultLabelStyleRenderer extends yfiles.lang.Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class DefaultLabelStyleRenderer { - /** - * Creates a new default instance. - */ - constructor(); - /** - * Add the text content to the provided SVG text element. - * @param textElement An SVG text element to add the provided text to. - * @param font The {@link } that defines the font properties to apply to the added text. - * @param text The text content to add to the provided text element (may contain newline characters). - * @param maxSize The bounds that shouldn't be exceeded when placing the text; null or not provided means unbound. - * @param wrapping The {@link } policy to apply when the text exceeds the provided maxSize. - * @returns - * @protected - */ - addTextElements(textElement:SVGTextElement,font:yfiles.view.Font,text:string,maxSize:yfiles.geometry.Size,wrapping:yfiles.view.TextWrapping):string; - /** - * Prepares this instance for subsequent calls after the style and label have been initialized. - *

- * Upon invocation the {@link yfiles.styles.DefaultLabelStyleRenderer#style} and {@link yfiles.styles.DefaultLabelStyleRenderer#label} properties have been populated by the - * {@link yfiles.styles.DefaultLabelStyleRenderer#getVisualCreator}, {@link yfiles.styles.DefaultLabelStyleRenderer#getBoundsProvider}, - * {@link yfiles.styles.DefaultLabelStyleRenderer#getHitTestable}, or {@link yfiles.styles.DefaultLabelStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * Stores the {@link yfiles.graph.ILabel#layout layout} into {@link yfiles.styles.DefaultLabelStyleRenderer#layout}. Subclasses which to override this method should call the base implementation. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the bounds provider for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#getBounds - */ - getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and label parameters, does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.DefaultLabelStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.DefaultLabelStyleRenderer#lookup} method call they should call - * {@link yfiles.styles.DefaultLabelStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that - * depends on a correctly configured this. - *

- * @param label The label to query the context for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#lookup - */ - getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. - * @param label The label to query hit test with. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#isHit - */ - getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; - /** - * Determines how the text should be aligned within the assigned label bounds. - * @returns This value as obtained from the style. - * @protected - */ - getHorizontalTextAlignment():yfiles.view.HorizontalTextAlignment; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. - * @param label The label to query marquee intersection tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#isInBox - */ - getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; - /** - * - * @param label - * @param style - * @returns - */ - getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Calculates the preferred size given the current state of the renderer. - * @returns The size as suggested by this renderer. - * @protected - */ - getPreferredSizeCore():yfiles.geometry.Size; - /** - * Determines how the text should be aligned vertically within the assigned label bounds. - * @returns This value as obtained from the style. - * @protected - */ - getVerticalTextAlignment():yfiles.view.VerticalTextAlignment; - /** - * Configures the style and label parameters, does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.DefaultLabelStyleRenderer#isVisible}. - *

- * @param label The label to query visibility tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#isVisible - */ - getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the {@link } for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#createVisual - * @see yfiles.styles.DefaultLabelStyleRenderer#updateVisual - */ - getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; - /** - * Determines how the text should be trimmed to fit the assigned label bounds. - * @returns This value as obtained from the style. - * @protected - */ - getWrapping():yfiles.view.TextWrapping; - /** - * Delegates to {@link yfiles.styles.DefaultLabelStyle#autoFlip} - * @returns Whether to flip the drawing if it is upside down. - * @protected - */ - isAutoFlip():boolean; - /** - * Determines whether text should be forced to be clipped inside the rectangle. - * @returns This value as obtained from the style. - * @protected - */ - isClippingText():boolean; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Uses the {@link yfiles.graph.ILabel#layout} to determine whether the clip intersects. - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.DefaultLabelStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.DefaultLabelStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.DefaultLabelStyleRenderer#label} and {@link yfiles.styles.DefaultLabelStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.DefaultLabelStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Calculate the width and height required to render the provided text using the provided {@link yfiles.view.Font}. - * @param text The text that should be measured. - * @param font The {@link } to apply to the text before measuring. - * @returns The text size. - * @protected - */ - measureText(text:string,font:yfiles.view.Font):yfiles.geometry.Size; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the current {@link yfiles.graph.ILabel#layout layout}. - * @protected - * @type {yfiles.geometry.IOrientedRectangle} - */ - layout:yfiles.geometry.IOrientedRectangle; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.DefaultLabelStyle} - */ - style:yfiles.styles.DefaultLabelStyle; - /** - * Gets or sets the currently configured label. - * @protected - * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.DefaultLabelStyleRenderer; - } - /** - * An {@link yfiles.styles.ILabelStyleRenderer} that can handle {@link yfiles.styles.IconLabelStyle} instances. - *

- * This implementation renders the label's inner style and an icon. - *

- * @class - * @implements {yfiles.styles.ILabelStyleRenderer} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface IconLabelStyleRenderer extends yfiles.lang.Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class IconLabelStyleRenderer { - /** - * Creates a new instance of this renderer. - */ - constructor(); - /** - * - * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the bounds provider for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#getBounds - */ - getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and label parameters, does not call {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.IconLabelStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.IconLabelStyleRenderer#lookup} method call they should call {@link yfiles.styles.IconLabelStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param label The label to query the context for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#lookup - */ - getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - * @param label The label to query hit test with. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#isHit - */ - getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#icon} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The icon. - * @protected - */ - getIcon():string; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#iconPlacement} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The placement parameter. - * @protected - */ - getIconPlacement():yfiles.graph.ILabelModelParameter; - /** - * Gets the size of the icon from the {@link yfiles.styles.IconLabelStyle#iconSize} property. - * @returns The size to use for the icon. - * @protected - */ - getIconSize():yfiles.geometry.Size; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - * @param label The label to query marquee intersection tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#isInBox - */ - getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; - /** - * - * @param label - * @param style - * @returns - */ - getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Calculates the preferred size given the current state of the renderer. - * @returns The size as suggested by this renderer. - * @protected - */ - getPreferredSizeCore():yfiles.geometry.Size; - /** - * Configures the style and label parameters, does not call {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.IconLabelStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.IconLabelStyleRenderer#isVisible}. - *

- * @param label The label to query visibility tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#isVisible - */ - getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the {@link } for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#createVisual - * @see yfiles.styles.IconLabelStyleRenderer#updateVisual - */ - getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#wrapped} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The style. - * @protected - */ - getWrappedStyle():yfiles.styles.ILabelStyle; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#wrappedInsets} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The insets. - * @protected - */ - getWrappedStyleInsets():yfiles.geometry.Insets; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#autoFlip} property from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The autoflip property value. - * @protected - */ - isAutoFlip():boolean; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.IconLabelStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.IconLabelStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.IconLabelStyleRenderer#label} and {@link yfiles.styles.IconLabelStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.IconLabelStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Returns whether the icon bounds should be considered for hit testing. - * @returns true - * @protected - */ - shouldHitTestIcon():boolean; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.IconLabelStyle} - */ - style:yfiles.styles.IconLabelStyle; - /** - * Gets or sets the currently configured label. - * @protected - * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.IconLabelStyleRenderer; - } - /** - * A node style that can display node shapes with a boundary that is defined by a {@link yfiles.geometry.GeneralPath} instance. - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface GeneralPathNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class GeneralPathNodeStyle { - /** - * Creates a new instance using the specified path and a custom renderer instance. - * @param path The path that defines the boundary of this style. - * @param [renderer=null] Custom renderer instance for this style - */ - constructor(path:yfiles.geometry.GeneralPath,renderer?:yfiles.styles.GeneralPathNodeStyleRenderer); - /** - * Creates a new instance using the specified path and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.path The path that defines the boundary of this style. - * @param [options.renderer=null] Custom renderer instance for this style - * @param {yfiles.view.Fill} options.fill The {@link yfiles.view.Fill} that is used to draw the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#fill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.view.Stroke} that is used to draw the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#stroke} property on the created object. - *

- */ - constructor(options:{path:yfiles.geometry.GeneralPath,renderer?:yfiles.styles.GeneralPathNodeStyleRenderer,fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke}); - /** - * Creates a new instance using a simple rectangular path and {@link yfiles.styles.GeneralPathNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Fill} options.fill The {@link yfiles.view.Fill} that is used to draw the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#fill} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.path The path that defines the boundary of the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#path} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.view.Stroke} that is used to draw the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#stroke} property on the created object. - *

- */ - constructor(options?:{fill?:yfiles.view.Fill,path?:yfiles.geometry.GeneralPath,stroke?:yfiles.view.Stroke}); - /** - * - * @returns - */ - clone():any; - /** - * Get or sets the path that defines the boundary of the shape. - *

- * The path must be defined in such a way that <0,0> will be at the top left of a node's {@link yfiles.graph.INode#layout} and <1,1> will be at the lower - * right. The path will be scaled accordingly during the painting. - *

- *

- * The default is a simple rectangular path. - *

- * @type {yfiles.geometry.GeneralPath} - */ - path:yfiles.geometry.GeneralPath; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - /** - * Gets or sets the {@link yfiles.view.Fill} that is used to draw the shape. - *

- * The default value is {@link yfiles.view.Fill#WHITE}. - *

- * @default 'System.Drawing.Brushes.White' - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets or sets the {@link yfiles.view.Stroke} that is used to draw the shape. - *

- * The default value is {@link yfiles.view.Stroke#BLACK}. - *

- * @default 'System.Drawing.Pens.Black' - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.GeneralPathNodeStyle; - } - /** - * An {@link yfiles.styles.INodeStyleRenderer} implementation that can handle {@link yfiles.styles.GeneralPathNodeStyle} instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface GeneralPathNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class GeneralPathNodeStyleRenderer { - /** - * Initializes a new instance of the {@link yfiles.styles.GeneralPathNodeStyleRenderer} class. - */ - constructor(); - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} properties have been populated by the - * {@link yfiles.styles.GeneralPathNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.GeneralPathNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.GeneralPathNodeStyleRenderer#getHitTestable}, - * or {@link yfiles.styles.GeneralPathNodeStyleRenderer#getMarqueeTestable} methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#lookup} method call they should - * call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an - * instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} properties, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#isInside - * @see yfiles.styles.GeneralPathNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.GeneralPathNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#createVisual - * @see yfiles.styles.GeneralPathNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.GeneralPathNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.GeneralPathNodeStyleRenderer#getContext} has been queried for a - * lookup implementation. Note that it cannot be assumed that {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} has - * already been invoked. However, normally {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} will be correctly configured if invoked directly after GetContext. - * Subclass implementations should make sure to configure this instance before they return this as a result of a successful - * lookup. This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.GeneralPathNodeStyle} - */ - style:yfiles.styles.GeneralPathNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.GeneralPathNodeStyleRenderer; - } - /** - * An abstract base class for {@link yfiles.styles.IEdgeStyleRenderer} implementations that are based on the calculation of a - * {@link yfiles.geometry.GeneralPath}. - * Type parameter TStyle: The exact type of style to use for this instance. - * @class - * @implements {yfiles.styles.IEdgeStyleRenderer} - * @implements {yfiles.styles.IPathGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - * @implements {yfiles.view.IObstacleProvider} - * @template TStyle - */ - export interface PathBasedEdgeStyleRenderer extends yfiles.lang.Object,yfiles.styles.IEdgeStyleRenderer,yfiles.styles.IPathGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator,yfiles.view.IObstacleProvider{} - export class PathBasedEdgeStyleRenderer { - /** - * - * @param edgeStyleType The exact type of style to use for this instance. - */ - constructor(edgeStyleType:yfiles.lang.Class); - /** - * Prepares this instance for subsequent calls after the style and edge have been initialized. - *

- * Upon invocation the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} and {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} properties have been populated by the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getVisualCreator}, {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getBoundsProvider}, {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable}, - * or {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getMarqueeTestable} methods. - *

- *

- * Subclasses which override this method have to call the base implementation, first. - *

- * @protected - */ - configure():void; - /** - * This method should create the basic uncropped path given the control points. - * @returns A path that has to be cropped, yet. - * @protected - * @abstract - */ - createPath():yfiles.geometry.GeneralPath; - /** - * Static utility method that creates a rectangular self loop path. - * @param sx The x coordinate of the source port. - * @param sy The y coordinate of the source port. - * @param oppositeX The x coordinate of the single control point. - * @param oppositeY The y coordinate of the single control point. - * @param tx The x coordinate of the target port. - * @param ty The y coordinate of the target port. - * @returns A path that describes a rectangular self loop. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createSelfLoopPath - * @protected - * @static - */ - static createRectangleSelfLoop(sx:number,sy:number,oppositeX:number,oppositeY:number,tx:number,ty:number):yfiles.geometry.GeneralPath; - /** - * Static utility method that creates a round self loop path. - * @param sx The x coordinate of the source port. - * @param sy The y coordinate of the source port. - * @param oppositeX The x coordinate of the single control point. - * @param oppositeY The y coordinate of the single control point. - * @param tx The x coordinate of the target port. - * @param ty The y coordinate of the target port. - * @returns A path that describes a round self loop. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createSelfLoopPath - * @protected - * @static - */ - static createRoundSelfLoop(sx:number,sy:number,oppositeX:number,oppositeY:number,tx:number,ty:number):yfiles.geometry.GeneralPath; - /** - * Special implementation that will create a self loop path. - * @param roundSelfLoop - * @returns - * @protected - */ - createSelfLoopPath(roundSelfLoop:boolean):yfiles.geometry.GeneralPath; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Crops the edge's path at the nodes. - *

- * This implementation uses the {@link yfiles.styles.IEdgePathCropper} instances found in the {@link yfiles.graph.ILookup#lookup} of the - * source and target port of the edge to perform the actual cropping. - *

- * @param path The path that should be cropped. - * @returns The cropped path. This is can be either the same instance of the given path or a newly created instance. - * @protected - */ - cropPath(path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - * @param edge The edge to retrieve the bounds provider for. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getBounds - */ - getBoundsProvider(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IBoundsProvider; - /** - * Yields the {@link yfiles.view.IBridgeCreator} to use for {@link yfiles.styles.PathBasedEdgeStyleRenderer.#addBridges adding bridges} to the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#createPath created path}. - *

- * The return value of this method (which may be null) will be passed to the {@link yfiles.view.BridgeManager}'s {@link yfiles.view.BridgeManager#addBridges} - * method. - *

- * @returns This implementation returns null. - * @protected - */ - getBridgeCreator():yfiles.view.IBridgeCreator; - /** - * Configures the style and edge parameters, does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}, instead subclasses should ensure that in - * the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#lookup} method call they should call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} only if needed, i.e. if they decide to return this or an instance - * that depends on a correctly configured this. - *

- * @param edge The edge to query the context for. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#lookup - */ - getContext(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.graph.ILookup; - /** - * Configures the style and edge parameters and returns this. - *

- * This implementation does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}. If subclasses depend on a configured instance in an override of {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isHit}, - * they need to override this method, too and call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} if the base call returns a non-null value. - *

- * @param edge - * @param style - * @returns - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isHit - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure - * @see yfiles.styles.IEdgeStyleRenderer#getHitTestable - */ - getHitTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IHitTestable; - /** - * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - * @param edge The edge to query marquee intersection tests. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isInBox - */ - getMarqueeTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IMarqueeTestable; - /** - * Returns {@link yfiles.styles.PathBasedEdgeStyleRenderer.#createPath} unless {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible} yields false for the provided context and {@link yfiles.view.IRenderContext#clip}. - * @param context The context to yield the obstacles for. - * @returns Either null or the result of {@link #createPath}. - * @see yfiles.view.IObstacleProvider - */ - getObstacles(context:yfiles.view.IRenderContext):yfiles.geometry.GeneralPath; - /** - * - * @returns - */ - getPath():yfiles.geometry.GeneralPath; - /** - * Gets an implementation of the {@link yfiles.styles.IPathGeometry} interface that can handle the provided edge and its associated - * style. - * @param edge The edge to provide an instance for - * @param style The style to use for the painting - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getSegmentCount - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPath - */ - getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.styles.IPathGeometry; - /** - * Returns the number of "segments" this edge's path consists of. - *

- * This method is part of the {@link yfiles.styles.IPathGeometry} interface, that is implemented by this class. This interface will - * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. - *

- * @returns the number of segments or -1 if there is no such thing as a segment for this edge. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry - * @abstract - */ - getSegmentCount():number; - /** - * Gets the value that determines the radius of the smoothing arcs that can be added to the path at the bends. - *

- * This implementation returns 0.0d, which effectively turns off path smoothing. - *

- * @returns The radius of the arcs to use at the bends of the path. - * @protected - */ - getSmoothingLength():number; - /** - * Gets the source arrow from the style. - * @returns The arrow to use. - * @protected - * @abstract - */ - getSourceArrow():yfiles.styles.IArrow; - /** - * Calculate and update the anchor and the source arrow's direction vector. - * @param arrow The arrow to calculate the anchor for. - * @returns The anchor and directional vector of the arrow, if any exist. - * @protected - */ - getSourceArrowAnchor(arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; - /** - * Gets the {@link yfiles.view.Stroke} to use to render the path. - * @returns The {@link } or null. - * @protected - * @abstract - */ - getStroke():yfiles.view.Stroke; - /** - * Calculates the tangent on the edge's path at the given ratio point for the given segment. - *

- * This method is part of the {@link yfiles.styles.IPathGeometry} interface, that is implemented by this class. This interface will - * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. - *

- * @param segmentIndex the segment to use for the calculation - * @param ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the segment - * @returns The tangential line, if any exists. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getSegmentCount - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry - * @abstract - */ - getTangent(segmentIndex:number,ratio:number):yfiles.geometry.Tangent; - /** - * Calculates the tangent on the edge's path at the given ratio point. - *

- * This method is part of the {@link yfiles.styles.IPathGeometry} interface, that is implemented by this class. This interface will - * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. - *

- * @param ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path - * @returns The tangential line, if any exists. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry - * @abstract - */ - getTangent(ratio:number):yfiles.geometry.Tangent; - /** - * Gets the target arrow from the style. - * @returns The arrow to use. - * @protected - * @abstract - */ - getTargetArrow():yfiles.styles.IArrow; - /** - * Calculate and update the anchor and the target arrow's direction vector. - * @param arrow The arrow to calculate the anchor for. - * @returns The anchor and directional vector of the arrow, if any exist. - * @protected - */ - getTargetArrowAnchor(arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; - /** - * Configures the style and edge parameters, does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}. If the subclass implementation depends on - * this instance to be configured, it needs to call Configure in {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible}. - *

- * @param edge The edge to query visibility tests. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible - */ - getVisibilityTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - * @param edge The edge to retrieve the {@link } for. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createVisual - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#updateVisual - */ - getVisualCreator(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisualCreator; - /** - * This method is overridden for performance reasons. - *

- * This implementation uses {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible} as an early exit indicator. If IsVisible returns false for a certain rectangle, the - * instance will not be configured but a non-hit will be assumed. Otherwise this instance will be configured and the - * standard path based hit test routine - *
- * Subclasses should not depend on the fact that {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} has already been called. This may not be the case. If your - * subclass depends on Configure being called, override {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable} and call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} after the base class call. - *

- * @param context - * @param location - * @returns - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and test the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} using the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} for a visible intersection with the clip bounds. - *

- * This simple implementation uses {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getBounds} to determine the visibility. Subclasses may choose to override this behavior - * for improved performance but need to make sure to call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} if they depend on a configured instance. - *

- * @param context the current canvas context - * @param rectangle the clip bounds - * @returns true if the edge may be painted within the clip bounds. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getVisibilityTestable - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * The path instance that this instance is working with. - * @protected - * @type {yfiles.geometry.GeneralPath} - */ - path:yfiles.geometry.GeneralPath; - /** - * Gets or sets the currently configured style. - * @protected - * @type {TStyle} - */ - style:TStyle; - /** - * Gets or sets the currently configured edge. - * @protected - * @type {yfiles.graph.IEdge} - */ - edge:yfiles.graph.IEdge; - /** - * Gets whether the rendered path should use the {@link yfiles.view.BridgeManager} to {@link yfiles.view.BridgeManager#addBridges add bridges to it.} - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getBridgeCreator - * @protected - * @type {boolean} - */ - addBridges:boolean; - /** - * Gets or sets the distance between the node's layout and its self loop control points. - * @type {number} - */ - selfLoopDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PathBasedEdgeStyleRenderer; - } - /** - * An {@link yfiles.styles.IEdgeStyleRenderer} that will render {@link yfiles.styles.PolylineEdgeStyle} instances. - * @class - * @extends {yfiles.styles.PathBasedEdgeStyleRenderer.} - */ - export interface PolylineEdgeStyleRenderer extends yfiles.styles.PathBasedEdgeStyleRenderer{} - export class PolylineEdgeStyleRenderer { - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PolylineEdgeStyleRenderer; - } - /** - * A polygonal {@link yfiles.styles.IEdgeStyle} where straight line segments are used to connect the bends. - * @class - * @implements {yfiles.styles.IEdgeStyle} - */ - export interface PolylineEdgeStyle extends yfiles.lang.Object,yfiles.styles.IEdgeStyle{} - export class PolylineEdgeStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.PolylineEdgeStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} property on the created object. - *

- * @param {number} options.smoothingLength The smoothing length used for creating smooth bends. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#smoothingLength} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#sourceArrow} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#targetArrow} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.PolylineEdgeStyleRenderer,stroke?:yfiles.view.Stroke,smoothingLength?:number,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); - /** - * Creates a new instance using {@link yfiles.styles.PolylineEdgeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} property on the created object. - *

- * @param {number} options.smoothingLength The smoothing length used for creating smooth bends. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#smoothingLength} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#sourceArrow} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#targetArrow} property on the created object. - *

- */ - constructor(options?:{stroke?:yfiles.view.Stroke,smoothingLength?:number,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); - /** - * Performs a {@link any#memberwiseClone} - * @returns - */ - clone():any; - /** - * Gets or sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. - *

- * The default value is {@link yfiles.view.Stroke#BLACK}. - *

- * @default 'System.Drawing.Pens.Black' - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the smoothing length used for creating smooth bends. - *

- * A value of 0.0d will disable smoothing. - *

- *

- * The default value is 0. - *

- * @default 0.0 - * @type {number} - */ - smoothingLength:number; - /** - * Gets or sets the visual arrow at the target end of edges that use this style. - *

- * Arrow instances may be shared between multiple style instances. - *

- *

- * This property may not be null. To have no target arrow set, use {@link yfiles.styles.IArrow#NONE} instead. - *

- *

- * The default value is {@link yfiles.styles.IArrow#NONE}. - *

- * @default 'None' - * @type {yfiles.styles.IArrow} - */ - targetArrow:yfiles.styles.IArrow; - /** - * Gets or sets the visual arrow at the source end of edges that use this style. - *

- * Arrow instances may be shared between multiple style instances. - *

- *

- * This property may not be null. To have no source arrow set, use {@link yfiles.styles.IArrow#NONE} instead. - *

- *

- * The default value is {@link yfiles.styles.IArrow#NONE}. - *

- * @default 'None' - * @type {yfiles.styles.IArrow} - */ - sourceArrow:yfiles.styles.IArrow; - /** - * Gets the renderer implementation that has been supplied to this instance in the constructor. - * @type {yfiles.styles.IEdgeStyleRenderer} - */ - renderer:yfiles.styles.IEdgeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PolylineEdgeStyle; - } - export enum ShapeNodeShape{ - /** - * A rectangular shape - */ - RECTANGLE, - /** - * A rectangular shape with rounded edges - */ - ROUND_RECTANGLE, - /** - * An elliptical shape - */ - ELLIPSE, - /** - * A triangular shape that points to the top - */ - TRIANGLE, - /** - * A triangular shape that points to the bottom - */ - TRIANGLE2, - /** - * A rectangle that is sheared in the horizontal direction to the right - */ - SHEARED_RECTANGLE, - /** - * A rectangle that is sheared in the horizontal direction to the left - */ - SHEARED_RECTANGLE2, - /** - * A trapezoid shape that is smaller at the bottom - */ - TRAPEZ, - /** - * A trapezoid shape that is smaller at the top - */ - TRAPEZ2, - /** - * A 5-star shape - */ - STAR5, - /** - * A 6-star shape - */ - STAR6, - /** - * An 8-star shape - */ - STAR8, - /** - * An arrow like shape that points to the right - */ - FAT_ARROW, - /** - * An arrow like shape that points to the left - */ - FAT_ARROW2, - /** - * A symmetric parallelogram shape that has sloped edges - */ - DIAMOND, - /** - * A regular eight-sided shape, - */ - OCTAGON, - /** - * A regular six-sided shape, - */ - HEXAGON - } - /** - * Default renderer implementation that can be used for {@link yfiles.styles.ShapeNodeStyle} instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface ShapeNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class ShapeNodeStyleRenderer { - constructor(); - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.ShapeNodeStyleRenderer#style} and {@link yfiles.styles.ShapeNodeStyleRenderer#node} properies have been populated by the {@link yfiles.styles.ShapeNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.ShapeNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.ShapeNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ShapeNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns the layout bounds as an upper bound for the painting bound. - *

- * This implementation simply sets the {@link yfiles.styles.ShapeNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or null to indicate an unbound area - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.ShapeNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.ShapeNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Get the brush that is currently used by this renderer. - *

- * This implementation retrieves the brush from the owning style - *

- * @returns The brush that is currently used by this renderer. - * @protected - */ - getFill():yfiles.view.Fill; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Get the shape that is currently used by this renderer. - *

- * This implementation retrieves the shape from the owning style - *

- * @returns The shape that is currently used by this renderer. - * @protected - */ - getShape():yfiles.styles.ShapeNodeShape; - /** - * Configures the {@link yfiles.styles.ShapeNodeStyleRenderer#style} and {@link yfiles.styles.ShapeNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#isInside - * @see yfiles.styles.ShapeNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Get the pen that is currently used by this renderer. - *

- * This implementation retrieves the {@link yfiles.view.Stroke} from the owning style - *

- * @returns The {@link } that is currently used by this renderer. - * @protected - */ - getStroke():yfiles.view.Stroke; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.ShapeNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#createVisual - * @see yfiles.styles.ShapeNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tests the {@link yfiles.styles.ShapeNodeStyleRenderer#node node} using the current {@link yfiles.styles.ShapeNodeStyleRenderer#style} for an intersection with the given box. - *

- * This implementation uses the {@link yfiles.styles.ShapeNodeStyleRenderer#layout} to determine whether the node is in the box. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the node is considered to be captured by the marquee - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.ShapeNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.ShapeNodeStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.ShapeNodeStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.ShapeNodeStyleRenderer#node} and {@link yfiles.styles.ShapeNodeStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.ShapeNodeStyle} - */ - style:yfiles.styles.ShapeNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets or sets the radius that is used to draw rounded edges. - * @type {number} - */ - roundRectArcRadius:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShapeNodeStyleRenderer; - } - /** - * Node style implementation that can show predefined shapes of type {@link yfiles.styles.ShapeNodeShape}. - *

- * This style can be used together with {@link yfiles.styles.ShapeNodeStyleRenderer} instances. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface ShapeNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class ShapeNodeStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer Custom renderer instance for this style. - */ - constructor(renderer:yfiles.styles.ShapeNodeStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer Custom renderer instance for this style. - * @param {yfiles.view.Fill} options.fill The {@link yfiles.styles.ShapeNodeStyle#fill} for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#fill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#stroke} property on the created object. - *

- * @param {yfiles.styles.ShapeNodeShape} options.shape The shape for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#shape} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.ShapeNodeStyleRenderer,fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke,shape?:yfiles.styles.ShapeNodeShape}); - /** - * Creates a new instance using {@link yfiles.styles.ShapeNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Fill} options.fill The {@link yfiles.styles.ShapeNodeStyle#fill} for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#fill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#stroke} property on the created object. - *

- * @param {yfiles.styles.ShapeNodeShape} options.shape The shape for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#shape} property on the created object. - *

- */ - constructor(options?:{fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke,shape?:yfiles.styles.ShapeNodeShape}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. - *

- * The default value is {@link yfiles.view.Stroke#BLACK}. - *

- * @default 'System.Drawing.Pens.Black' - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the {@link yfiles.styles.ShapeNodeStyle#fill} for this style. - *

- * The default value is {@link yfiles.view.Fill#WHITE}. - *

- * @default 'System.Drawing.Brushes.White' - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets or sets the shape for this style. - *

- * The default value is {@link yfiles.styles.ShapeNodeShape#RECTANGLE}. - *

- * @default yfiles.styles.ShapeNodeShape.RECTANGLE - * @type {yfiles.styles.ShapeNodeShape} - */ - shape:yfiles.styles.ShapeNodeShape; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShapeNodeStyle; - } - /** - * Default renderer implementation for {@link yfiles.styles.ArcEdgeStyle} - * @class - * @extends {yfiles.styles.PathBasedEdgeStyleRenderer.} - */ - export interface ArcEdgeStyleRenderer extends yfiles.styles.PathBasedEdgeStyleRenderer{} - export class ArcEdgeStyleRenderer { - constructor(); - /** - * Retrieves the {@link yfiles.styles.ArcEdgeStyle#height} of the style. - * @returns the height. - */ - getHeight():number; - /** - * Gets a value indicating whether this {@link yfiles.styles.ArcEdgeStyleRenderer#getHeight} should be interpreted as an absolute - * or relative value. - * @returns true if the height value should be interpreted as a fixed value, otherwise, false. - * @see yfiles.styles.ArcEdgeStyleRenderer#getHeight - */ - isFixedHeight():boolean; - /** - * Gets whether bridges are added to the edge path. - *

- * Overridden to return false since the flattening interferes with its own obstacles. - *

- * @protected - * @type {boolean} - */ - addBridges:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ArcEdgeStyleRenderer; - } - /** - * Provides an arc representation for an edge. - *

- * The rendering does not take into account bends of an edge, instead the arc's height is determined as a fixed ratio or - * fixed height. - *

- *

- * This style uses an {@link yfiles.styles.ArcEdgeStyleRenderer} for its visualization. - *

- * @class - * @implements {yfiles.styles.IEdgeStyle} - */ - export interface ArcEdgeStyle extends yfiles.lang.Object,yfiles.styles.IEdgeStyle{} - export class ArcEdgeStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.ArcEdgeStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {boolean} options.fixedHeight A value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative value. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#fixedHeight} property on the created object. - *

- * @param {number} options.height The "height" of the arc. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#height} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#stroke} property on the created object. - *

- * @param {boolean} options.provideHeightHandle A value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#provideHeightHandle} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#sourceArrow} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#targetArrow} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.ArcEdgeStyleRenderer,fixedHeight?:boolean,height?:number,stroke?:yfiles.view.Stroke,provideHeightHandle?:boolean,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); - /** - * Creates a new instance using {@link yfiles.styles.ArcEdgeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.fixedHeight A value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative value. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#fixedHeight} property on the created object. - *

- * @param {number} options.height The "height" of the arc. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#height} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#stroke} property on the created object. - *

- * @param {boolean} options.provideHeightHandle A value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#provideHeightHandle} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#sourceArrow} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#targetArrow} property on the created object. - *

- */ - constructor(options?:{fixedHeight?:boolean,height?:number,stroke?:yfiles.view.Stroke,provideHeightHandle?:boolean,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); - /** - * Performs a {@link any#memberwiseClone} - * @returns - */ - clone():any; - /** - * Gets or sets the {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc - *

- * The default value is {@link yfiles.view.Stroke#BLACK}. - *

- * @default 'System.Drawing.Pens.Black' - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the "height" of the arc. - *

- * Depending on the setting of {@link yfiles.styles.ArcEdgeStyle#fixedHeight}, this value is interpreted differently: If {@link yfiles.styles.ArcEdgeStyle#fixedHeight} is disabled, the height of the arc will depend - * on it's width. The width will be multiplied by this value to obtain the height. If the {@link yfiles.styles.ArcEdgeStyle#fixedHeight} feature is enabled, this value - * will be interpreted as the absolute height. - *

- *

- * The default value is 0. - *

- * @default 0 - * @type {number} - */ - height:number; - /** - * Gets or sets a value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative - * value. - *

- * The default value is true. - *

- * @see yfiles.styles.ArcEdgeStyle#height - * @default true - * @type {boolean} - */ - fixedHeight:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if - * queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - provideHeightHandle:boolean; - /** - * Gets or sets the visual arrow at the target end of edges that use this style. - *

- * Arrow instances may be shared between multiple style instances. - *

- *

- * The default value is {@link yfiles.styles.IArrow#NONE}. - *

- * @default 'None' - * @type {yfiles.styles.IArrow} - */ - targetArrow:yfiles.styles.IArrow; - /** - * Gets or sets the visual arrow at the source end of edges that use this style. - *

- * Arrow instances may be shared between multiple style instances. - *

- *

- * The default value is {@link yfiles.styles.IArrow#NONE}. - *

- * @default 'None' - * @type {yfiles.styles.IArrow} - */ - sourceArrow:yfiles.styles.IArrow; - /** - * Gets the renderer implementation that has been supplied to this instance in the constructor. - * @type {yfiles.styles.IEdgeStyleRenderer} - */ - renderer:yfiles.styles.IEdgeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ArcEdgeStyle; - } - /** - * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a rounded rectangle with a bevel border in a 'shiny plate' - * fashion. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface BevelNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class BevelNodeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.BevelNodeStyleRenderer#style} and {@link yfiles.styles.BevelNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.BevelNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.BevelNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.BevelNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.BevelNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns the layout bounds as an upper bound for the painting bound. - *

- * This implementation simply sets the {@link yfiles.styles.BevelNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or null to indicate an unbound area - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.BevelNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.BevelNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.BevelNodeStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.BevelNodeStyleRenderer#style} and {@link yfiles.styles.BevelNodeStyleRenderer#node} properties, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#isInside - * @see yfiles.styles.BevelNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.BevelNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#createVisual - * @see yfiles.styles.BevelNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tests the {@link yfiles.styles.BevelNodeStyleRenderer#node node} using the current {@link yfiles.styles.BevelNodeStyleRenderer#style} for an intersection with the given box. - *

- * This implementation uses the {@link yfiles.styles.BevelNodeStyleRenderer#layout} to determine whether the node is in the box. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the node is considered to be captured by the marquee - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.BevelNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.BevelNodeStyle} - */ - style:yfiles.styles.BevelNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets the color from the style. - * @protected - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - /** - * Gets the inset from the style. - * @protected - * @type {number} - */ - inset:number; - /** - * Gets the radius to use from the style. - * @protected - * @type {number} - */ - radius:number; - /** - * Gets or sets a property that determines whether this instance should provide an {@link yfiles.input.IHandle} for editing the - * radius of the shape. - *

- * The default is false. This implementation will add an appropriate {@link yfiles.input.IHandleProvider} to the {@link yfiles.styles.BevelNodeStyleRenderer#lookup} - * of this instance if this feature is enabled. - *

- * @default false - * @type {boolean} - */ - provideRadiusHandle:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.BevelNodeStyleRenderer; - } - /** - * An implementation of the {@link yfiles.styles.INodeStyle} that can be used to create rectangular nodes with rounded corners, a - * bevel border, and a shining background. - *

- * Optionally, this style renders a drop shadow by itself. - *

- *

- * This style uses the {@link yfiles.styles.BevelNodeStyleRenderer} to visualize a node. - *

- * @see yfiles.styles.BevelNodeStyleRenderer - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface BevelNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class BevelNodeStyle { - /** - * Creates a new instance using the provided renderer to share. - * @param renderer - */ - constructor(renderer:yfiles.styles.BevelNodeStyleRenderer); - /** - * Creates a new instance using the provided renderer to share. - * @param {Object} options The parameters to pass. - * @param options.renderer - * @param {yfiles.view.Color} options.color The base color to use. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#color} property on the created object. - *

- * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#drawShadow} property on the created object. - *

- * @param {number} options.inset The insets to use for the bevel. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#inset} property on the created object. - *

- * @param {number} options.radius The radius of the corner of the rounded rectangle. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#radius} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.BevelNodeStyleRenderer,color?:yfiles.view.Color,drawShadow?:boolean,inset?:number,radius?:number}); - /** - * Creates a new instance using {@link yfiles.styles.BevelNodeStyleRenderer} as renderer to share. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Color} options.color The base color to use. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#color} property on the created object. - *

- * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#drawShadow} property on the created object. - *

- * @param {number} options.inset The insets to use for the bevel. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#inset} property on the created object. - *

- * @param {number} options.radius The radius of the corner of the rounded rectangle. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#radius} property on the created object. - *

- */ - constructor(options?:{color?:yfiles.view.Color,drawShadow?:boolean,inset?:number,radius?:number}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the insets to use for the bevel. - *

- * The default value is 3. - *

- * @type {number} - */ - inset:number; - /** - * Gets or sets the radius of the corner of the rounded rectangle. - *

- * The default value is 10. - *

- * @type {number} - */ - radius:number; - /** - * Gets or sets the base color to use. - *

- * The default value is {@link yfiles.view.Color#BLACK}. - *

- * @default 'Black' - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - /** - * Gets or sets a value indicating whether to draw a drop shadow. - *

- * The default value is false. - *

- * @default false - * @type {boolean} - */ - drawShadow:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.BevelNodeStyle; - } - /** - * A style renderer implementation that can be used together with {@link yfiles.styles.ImageNodeStyle} instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface ImageNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class ImageNodeStyleRenderer { - constructor(); - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.ImageNodeStyleRenderer#style} and {@link yfiles.styles.ImageNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.ImageNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.ImageNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.ImageNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ImageNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns the layout bounds as an upper bound for the painting bound. - *

- * This implementation simply sets the {@link yfiles.styles.ImageNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or null to indicate an unbound area - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.ImageNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.ImageNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.ImageNodeStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Get the style's fallback image. - * @returns - * @protected - */ - getFallbackImage():string; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Get the image that is currently used to render the style. - * @returns - * @protected - */ - getImage():string; - /** - * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the intersection calculation, otherwise reverts to default (rectangular) behavior. - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to create the outline shape path, otherwise reverts to default (rectangular) behavior. - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Gets the value that determines whether the aspect ratio of the image should be preserved. - * @returns false - * @protected - */ - getPreserveAspectRatio():boolean; - /** - * Configures the {@link yfiles.styles.ImageNodeStyleRenderer#style} and {@link yfiles.styles.ImageNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#isInside - * @see yfiles.styles.ImageNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.ImageNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#createVisual - * @see yfiles.styles.ImageNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * Tries to use {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the hit test analysis, otherwise reverts to default (rectangular) behavior. - * @param context the context the hit test is performed in - * @param location the coordinates in world coordinate system - * @returns whether something has been hit - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the marquee intersection analysis, otherwise reverts to default (rectangular) behavior. - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the contains test, otherwise reverts to default (rectangular) behavior. - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.ImageNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.ImageNodeStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.ImageNodeStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.ImageNodeStyleRenderer#node} and {@link yfiles.styles.ImageNodeStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.ImageNodeStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.ImageNodeStyle} - */ - style:yfiles.styles.ImageNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * A {@link string} that will be used to find the fallback image url that will be used to render the node, if the style does not - * explicitly specify a {@link yfiles.styles.ImageNodeStyle#fallbackImage fallback image}. - * @const - * @static - * @type {string} - */ - static TEMPLATE_KEY:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ImageNodeStyleRenderer; - } - /** - * A node style that can use an image for the visual representation of a node. - *

- * This style can be used together with {@link yfiles.styles.ImageNodeStyleRenderer} instances. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface ImageNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class ImageNodeStyle { - /** - * Creates a new instance that uses the specified image and a custom renderer instance. - * @param image The image. - * @param [fallbackImage=null] The fallback image. - * @param [renderer=null] The renderer for this instance - */ - constructor(image:string,fallbackImage?:string,renderer?:yfiles.styles.ImageNodeStyleRenderer); - /** - * Creates a new instance that uses the specified image and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.image The image. - * @param [options.fallbackImage=null] The fallback image. - * @param [options.renderer=null] The renderer for this instance - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of the image that will be displayed. - *

- * This option sets the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} property on the created object. - *

- */ - constructor(options:{image:string,fallbackImage?:string,renderer?:yfiles.styles.ImageNodeStyleRenderer,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance with no image and {@link yfiles.styles.ImageNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {string} [options.fallbackImage=null] Sets the fallbackImage property. - * @param {string} options.image The image that is used for the style instance. - *

- * This option sets the {@link yfiles.styles.ImageNodeStyle#image} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of the image that will be displayed. - *

- * This option sets the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} property on the created object. - *

- */ - constructor(options?:{fallbackImage?:string,image?:string,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * This implementation performs a shallow copy with respect to the {@link yfiles.styles.ImageNodeStyle#image} property. - *

- * If clients need to have a deep copy of this instance, they need to manually clone and reassign the {@link yfiles.styles.ImageNodeStyle#image} to the clone. - *

- * @returns A shallow copy of this instance. - */ - clone():any; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - /** - * Gets or sets the image that is used for the style instance. - *

- * The default value is null. - *

- * @type {string} - */ - image:string; - /** - * - * @default null - * @type {string} - */ - fallbackImage:string; - /** - * Gets or sets the normalized outline of the image that will be displayed. - *

- * This shape will be used to satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} - * and may be left null to indicate default (rectangular) behavior. - *

- *

- * The default value is null. - *

- * @default null - * @type {yfiles.geometry.GeneralPath} - */ - normalizedOutline:yfiles.geometry.GeneralPath; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ImageNodeStyle; - } - /** - * An implementation of {@link yfiles.styles.INodeStyle} that draws a simple floating panel with a slight gradient, a thin border - * and optionally a drop shadow. - *

- * This style can be used to create the visual representation for group nodes, for example. By default, it a drop shadow by - * itself. - *

- *

- * This style uses the {@link yfiles.styles.PanelNodeStyleRenderer} to visualize a node. - *

- * @see yfiles.styles.PanelNodeStyleRenderer - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface PanelNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class PanelNodeStyle { - /** - * Creates a new instance using the provided renderer to share. - * @param renderer - */ - constructor(renderer:yfiles.styles.PanelNodeStyleRenderer); - /** - * Creates a new instance using the provided renderer to share. - * @param {Object} options The parameters to pass. - * @param options.renderer - * @param {yfiles.view.Color} options.color The base color to use. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#color} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#insets} property on the created object. - *

- * @param {yfiles.view.Color} options.labelInsetsColor The base color to use for drawing the label insets background. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#labelInsetsColor} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.PanelNodeStyleRenderer,color?:yfiles.view.Color,insets?:yfiles.geometry.Insets,labelInsetsColor?:yfiles.view.Color}); - /** - * Creates a new instance using {@link yfiles.styles.PanelNodeStyleRenderer} as renderer to share. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Color} options.color The base color to use. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#color} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#insets} property on the created object. - *

- * @param {yfiles.view.Color} options.labelInsetsColor The base color to use for drawing the label insets background. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#labelInsetsColor} property on the created object. - *

- */ - constructor(options?:{color?:yfiles.view.Color,insets?:yfiles.geometry.Insets,labelInsetsColor?:yfiles.view.Color}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the base color to use. - *

- * The default value is {@link yfiles.view.Color#BLACK}. - *

- * @default 'Black' - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - /** - * Gets or sets the base color to use for drawing the label insets background. - *

- * Setting this to null effectively disables label insets background coloring. - *

- *

- * The default value is {@link yfiles.view.Color#LIGHT_GRAY}. - *

- * @default 'LightGray' - * @type {yfiles.view.Color} - */ - labelInsetsColor:yfiles.view.Color; - /** - * Gets or sets the instance to use that provides the insets for this style. - *

- * The {@link yfiles.styles.PanelNodeStyleRenderer} will use these insets and return them via an {@link yfiles.input.INodeInsetsProvider} - * if such an instance is queried through the {@link yfiles.styles.INodeStyleRenderer#getContext context lookup}. - *

- *

- * The default insets are set to (5,5,5,5). - *

- * @see yfiles.input.INodeInsetsProvider - * @default '5, 5, 5, 5' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PanelNodeStyle; - } - /** - * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a simple floating panel with a slight gradient, a thin - * border and a simple drop shadow. - * @see yfiles.styles.PanelNodeStyle - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface PanelNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class PanelNodeStyleRenderer { - /** - * The style that it currently assigned to this renderer instance. - */ - constructor(); - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.PanelNodeStyleRenderer#style} and {@link yfiles.styles.PanelNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.PanelNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.PanelNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.PanelNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.PanelNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Determines whether to draw the drop shadow. - * @returns true, always. - * @protected - */ - drawShadow():boolean; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.PanelNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.PanelNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.PanelNodeStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Finds an intersection for the current {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the {@link yfiles.styles.PanelNodeStyleRenderer#style}. - *

- * This implementation returns the intersection for the {@link yfiles.styles.PanelNodeStyleRenderer#layout}. - *

- * @param inner - * @param outer - * @returns True if an intersection was actually found - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * Returns the outline of the shape using the node's {@link yfiles.styles.PanelNodeStyleRenderer#layout}. - * @returns The outline of the bounds of the node. - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.PanelNodeStyleRenderer#style} and {@link yfiles.styles.PanelNodeStyleRenderer#node} properties, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#isInside - * @see yfiles.styles.PanelNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.PanelNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#createVisual - * @see yfiles.styles.PanelNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * Hit tests the {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the current {@link yfiles.styles.PanelNodeStyleRenderer#style}. - *

- * This implementation uses the {@link yfiles.styles.PanelNodeStyleRenderer#layout} to determine whether the node has been hit. The check is delegated to {@link yfiles.geometry.Rect#containsWithEps} - * using {@link yfiles.view.ICanvasContext#hitTestRadius} as the last argument. - *

- * @param context the context the hit test is performed in - * @param location the coordinates in world coordinate system - * @returns whether something has been hit - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tests the {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the current {@link yfiles.styles.PanelNodeStyleRenderer#style} for an intersection with the given box. - *

- * This implementation uses the {@link yfiles.styles.PanelNodeStyleRenderer#layout} to determine whether the node is in the box. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the node is considered to be captured by the marquee - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Checks whether the given coordinate lies within the shape's geometric bounds. - *

- * This implementation checks for containment in the {@link yfiles.styles.PanelNodeStyleRenderer#layout}. - *

- * @param location - * @returns True if the point lies within the geometry of the rendering. - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.PanelNodeStyle} - */ - style:yfiles.styles.PanelNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets the color from the style. - * @protected - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PanelNodeStyleRenderer; - } - /** - * Decorates other node styles with a smooth drop shadow. - *

- * This implementation uses an SVG filter effect. This may cause performance issues for larger nodes or high zoom factors. - * In this case it might be more appropriate to implement a drop shadow implementation using canvas drawing and displaying - * the canvas content using an image element with canvas.toDataURL. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface ShadowNodeStyleDecorator extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class ShadowNodeStyleDecorator { - /** - * Creates a new instance wrapping the provided style. - *

- * The provided instance is used by reference, so subsequent changes to the style will affect the appearance of this - * style. - *

- * @param wrapped The style to wrap. - */ - constructor(wrapped:yfiles.styles.INodeStyle); - /** - * Creates a new instance wrapping a simple {@link yfiles.styles.ShapeNodeStyle}. - *

- * The provided instance is used by reference, so subsequent changes to the style will affect the appearance of this - * style. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.INodeStyle} options.wrapped The wrapped node style instance by reference. - *

- * This option sets the {@link yfiles.styles.ShadowNodeStyleDecorator#wrapped} property on the created object. - *

- * @see yfiles.styles.ShadowNodeStyleDecorator#wrapped - */ - constructor(options?:{wrapped?:yfiles.styles.INodeStyle}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the wrapped node style instance by reference. - * @type {yfiles.styles.INodeStyle} - */ - wrapped:yfiles.styles.INodeStyle; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShadowNodeStyleDecorator; - } - /** - * Implementation of the {@link yfiles.styles.INodeStyle} which creates rectangular nodes with rounded corners and a highlighted - * ('shiny plate') interior. - *

- * By default, this style renders a drop shadow by itself. - *

- *

- * This style uses the {@link yfiles.styles.ShinyPlateNodeStyleRenderer} to visualize a node. - *

- * @see yfiles.styles.ShinyPlateNodeStyleRenderer - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface ShinyPlateNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class ShinyPlateNodeStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer - */ - constructor(renderer:yfiles.styles.ShinyPlateNodeStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer - * @param {yfiles.view.Fill} options.fill The background brush for this style. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#fill} property on the created object. - *

- * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#drawShadow} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#insets} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} property on the created object. - *

- * @param {number} options.radius The corner radius of the rounded rectangle - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#radius} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.ShinyPlateNodeStyleRenderer,fill?:yfiles.view.Fill,drawShadow?:boolean,insets?:yfiles.geometry.Insets,stroke?:yfiles.view.Stroke,radius?:number}); - /** - * Creates a new instance using {@link yfiles.styles.ShinyPlateNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Fill} options.fill The background brush for this style. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#fill} property on the created object. - *

- * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#drawShadow} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#insets} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} property on the created object. - *

- * @param {number} options.radius The corner radius of the rounded rectangle - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#radius} property on the created object. - *

- */ - constructor(options?:{fill?:yfiles.view.Fill,drawShadow?:boolean,insets?:yfiles.geometry.Insets,stroke?:yfiles.view.Stroke,radius?:number}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the background brush for this style. - *

- * The default value is {@link yfiles.view.Fill#BLACK}. - *

- * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets or sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. - *

- * The default value is null. - *

- * @default null - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the corner radius of the rounded rectangle - *

- * The default value is 5. - *

- * @default 5 - * @type {number} - */ - radius:number; - /** - * Gets or sets a value indicating whether to draw a drop shadow. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - drawShadow:boolean; - /** - * Gets or sets the instance to use that provides the insets for this style. - *

- * The {@link yfiles.styles.ShinyPlateNodeStyleRenderer} will use these insets and return them via an {@link yfiles.input.INodeInsetsProvider} - * if such an instance is queried through the {@link yfiles.styles.INodeStyleRenderer#getContext context lookup}. - *

- *

- * The default insets are set to (5,5,5,5). - *

- * @see yfiles.input.INodeInsetsProvider - * @default '5,5,5,5' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShinyPlateNodeStyle; - } - /** - * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a simple floating shinyPlate with a slight gradient, a - * thin border and a simple drop shadow. - * @see yfiles.styles.ShinyPlateNodeStyle - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface ShinyPlateNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class ShinyPlateNodeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} and {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} properties have been populated by the - * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getVisualCreator}, {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getBoundsProvider}, - * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Determines whether to draw the drop shadow. - * @returns {@link #drawShadow}. - * @protected - */ - drawShadow():boolean; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#lookup} method call they should - * call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an - * instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} and {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isInside - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#createVisual - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tests the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node node} using the current {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} for an intersection with the given box. - *

- * This implementation uses the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#layout} to determine whether the node is in the box. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the node is considered to be captured by the marquee - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.ShinyPlateNodeStyle} - */ - style:yfiles.styles.ShinyPlateNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#fill} from the style. - * @protected - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#stroke} from the style. - * @protected - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets the radius from the style. - * @protected - * @type {number} - */ - radius:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShinyPlateNodeStyleRenderer; - } - /** - * Base class for stripe styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.IStripe}s. - * @see yfiles.styles.TemplateStripeStyle - * @see yfiles.styles.StringTemplateStripeStyle - * @class - * @implements {yfiles.styles.IStripeStyle} - * @implements {yfiles.lang.IPropertyObservable} - * @implements {yfiles.lang.ICloneable} - */ - export interface TemplateStripeStyleBase extends yfiles.lang.Object,yfiles.styles.IStripeStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} - export class TemplateStripeStyleBase { - /** - * Constructs a new instance using the provided renderer. - * @param renderer - * @protected - */ - constructor(renderer:yfiles.styles.TemplateStripeStyleRenderer); - /** - * Constructs a new instance of this style with default values. - * @protected - */ - constructor(); - /** - * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateStripeStyleBase#styleTag} which is cloned, too, if it can be cloned. - * @returns A clone of this instance. - */ - clone():any; - /** - * Factory method that is called by the {@link yfiles.styles.TemplateStripeStyleRenderer} to create the visual that will be used - * for the display of the stripe. - * @param context The context for which the visual should be created. - * @param stripe The stripe that will be rendered. - * @returns The readily styled visual. - */ - createTemplate(context:yfiles.view.IRenderContext,stripe:yfiles.graph.IStripe):yfiles.view.SvgVisual; - /** - * Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects. - *

- * This method can be called to perform the template loading at a certain point in time, for example during application - * startup. By default, a template is loaded lazily when the first visual using this template is built. - *

- * @static - */ - static loadAllTemplates():void; - /** - * Raises the {@link yfiles.styles.TemplateStripeStyleBase#addPropertyChangedListener PropertyChanged} - * event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to add. - * @see yfiles.styles.TemplateStripeStyleBase#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to remove. - * @see yfiles.styles.TemplateStripeStyleBase#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the tag that is associated with this style instance. - *

- * The various style renderer implementations can use this tag to make it accessible in the context of the instantiated - * templates and controls. The framework does not make any assumptions about the value of this property. It is there for - * convenient use in the process of data binding the templates. This property supports {@link yfiles.lang.IPropertyObservable property change notification} and can - * thus be data bound easily. - *

- * @default null - * @type {any} - */ - styleTag:any; - /** - * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the - * implementation which is returned by calls to {@link yfiles.styles.IStripeStyleRenderer#getContext} that are made on the style - * renderer that is associated with this style instance. - *

- * This can be used to conveniently customize the lookup behavior of the style renderers that are associated with this - * instance. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - *

- * @default 'Lookups.EmptyContextLookup' - * @type {yfiles.graph.IContextLookup} - */ - contextLookup:yfiles.graph.IContextLookup; - /** - * Convenience getter that yields the {@link yfiles.styles.TemplateStripeStyleRenderer} that is used by this instance. - * @see yfiles.styles.IStripeStyle#renderer - * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateStripeStyleBase; - } - /** - * An {@link yfiles.styles.IStripeStyle} implementation that can render complex {@link yfiles.view.Visual}s for the visualization of - * {@link yfiles.graph.IStripe}s using a {@link yfiles.styles.TemplateStripeStyleRenderer}. - *

- * The {@link yfiles.styles.TemplateStripeStyle#styleResourceKey} is used to determine the template that will be applied to the {@link yfiles.view.Visual}. - *

- *

Related demos:

- *
    - *
  • Demo: Control Styles Demo, Demo.yFiles.Graph.ControlStyles
  • - *
  • Demo: OrgChart Demo, Demo.yFiles.Graph.OrgChart
  • - *
- * @class - * @extends {yfiles.styles.TemplateStripeStyleBase} - */ - export interface TemplateStripeStyle extends yfiles.styles.TemplateStripeStyleBase{} - export class TemplateStripeStyle { - /** - * Creates a new instance using the given resource key and a custom renderer instance. - * @param styleResourceKey The key of the style resource that will be used for the component. - * @param renderer The custom renderer for this style instance. - */ - constructor(styleResourceKey:string,renderer:yfiles.styles.TemplateStripeStyleRenderer); - /** - * Creates a new instance using the given resource key and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. - * @param styleResourceKey The key of the style resource that will be used for the component. - */ - constructor(styleResourceKey:string); - /** - * Creates a new instance with no style resource key and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. - *

- * This option sets the {@link yfiles.styles.TemplateStripeStyle#styleResourceKey} property on the created object. - *

- */ - constructor(options?:{styleResourceKey?:string}); - /** - * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. - * @default null - * @type {string} - */ - styleResourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateStripeStyle; - } - /** - * A {@link yfiles.styles.IStripeStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.IStripe}s. - *

- * In contrast to {@link yfiles.styles.TemplateStripeStyle}, the SVG template used by this style must be encoded as string and set - * to the {@link yfiles.styles.StringTemplateStripeStyle#svgContent} property. - *

- *

- * It is vital that the {@link yfiles.styles.StringTemplateStripeStyle#svgContent SVG snippet} does not declare the SVG namespace itself. Its content is parsed in a dummy namespace - * in order to avoid immediate validation of the result. The resulting SVG elements are automatically created in the SVG - * namespace before they are added to the DOM. - *

- * @class - * @extends {yfiles.styles.TemplateStripeStyleBase} - */ - export interface StringTemplateStripeStyle extends yfiles.styles.TemplateStripeStyleBase{} - export class StringTemplateStripeStyle { - /** - * Creates a new instance using the given SVG template and a custom renderer instance. - * @param svgContent The SVG snippet that will be used as a template for the component. - * @param renderer The custom renderer for this instance. - */ - constructor(svgContent:string,renderer:yfiles.styles.TemplateStripeStyleRenderer); - /** - * Creates a new instance using the given SVG template and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet that will be used as a template for the component. - * @param options.renderer The custom renderer for this instance. - * @param {Object} options.styleTag The tag that is associated with this style instance. - *

- * This option sets the {@link yfiles.styles.TemplateStripeStyleBase#styleTag} property on the created object. - *

- */ - constructor(options:{svgContent:string,renderer:yfiles.styles.TemplateStripeStyleRenderer,styleTag?:Object}); - /** - * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. - * @param svgContent The SVG snippet that will be used as a template for the component. - */ - constructor(svgContent:string); - /** - * Creates a new instance with no SVG template and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {string} options.svgContent The SVG content that is the template for the stripe visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplateStripeStyle#svgContent} property on the created object. - *

- */ - constructor(options?:{svgContent?:string}); - /** - * Gets or sets the SVG content that is the template for the stripe visualization. - * @default null - * @type {string} - */ - svgContent:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StringTemplateStripeStyle; - } - /** - * An implementation of the {@link yfiles.styles.IStripeStyleRenderer} interface that can render {@link yfiles.styles.TemplateStripeStyle} - * instances. - * @see yfiles.styles.TemplateStripeStyle - * @class - * @implements {yfiles.styles.IStripeStyleRenderer} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface TemplateStripeStyleRenderer extends yfiles.lang.Object,yfiles.styles.IStripeStyleRenderer,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class TemplateStripeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and stripe have been initialized. - *

- * Upon invocation the {@link yfiles.styles.TemplateStripeStyleRenderer#style} and {@link yfiles.styles.TemplateStripeStyleRenderer#stripe} properties have been populated by the {@link yfiles.styles.TemplateStripeStyleRenderer#getVisualCreator} - * or {@link yfiles.styles.TemplateStripeStyleRenderer#getContext} methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * Creates the visual by delegating to CreateControl and then initializing the control with the context. - * @param context The context for the creation. - * @returns The control that is used for rendering the stripe. - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Configures the style and stripe parameters, does not call {@link yfiles.styles.TemplateStripeStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateStripeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.TemplateStripeStyleRenderer#lookup} method call they should - * call {@link yfiles.styles.TemplateStripeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an - * instance that depends on a correctly configured this. - *

- * @param stripe The stripe to query the context for. The value will be stored in the {@link #stripe} property. - * @param style The style to associate with the stripe. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateStripeStyleRenderer#lookup - */ - getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; - /** - * Gets the context by delegating to {@link yfiles.styles.TemplateStripeStyleBase#contextLookup}. - * @param style - * @returns - * @protected - */ - getContextLookup(style:yfiles.styles.TemplateStripeStyleBase):yfiles.graph.IContextLookup; - /** - * Configures the style and stripe parameters, calls {@link yfiles.styles.TemplateStripeStyleRenderer#configure} and returns this. - * @param stripe The stripe to retrieve the {@link } for. The value will be stored in the {@link #stripe} property. - * @param style The style to associate with the stripe. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateStripeStyleRenderer#createVisual - * @see yfiles.styles.TemplateStripeStyleRenderer#updateVisual - */ - getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; - /** - * Implementation of the {@link yfiles.graph.ILookup#lookup} method. - *

- * Delegates to the lookup returned by GetContextLookup(StripeControlStripeStyle), first. Last, it returns this class if it - * implements the queried type. - *

- * @param type The type to query an instance for. - * @returns The implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Updates the component correspondingly. - * @param context The context for the creation. - * @param oldVisual The currently rendered visual. - * @returns The control that is used for rendering the stripe. - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TemplateStripeStyleBase} - */ - style:yfiles.styles.TemplateStripeStyleBase; - /** - * Gets or sets the currently configured stripe. - * @protected - * @type {yfiles.graph.IStripe} - */ - stripe:yfiles.graph.IStripe; - /** - * Gets the {@link yfiles.graph.IStripe#layout} of the stripe this renderer is currently configured for. - *

- * Returns Stripe.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateStripeStyleRenderer; - } - /** - * A {@link yfiles.styles.INodeStyle} for {@link yfiles.graph.ITable tables}. - *

- * This implementations stores the table instance and therefore, its instances cannot be shared among different table - * instances. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface TableNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle,yfiles.lang.IPropertyObservable{} - export class TableNodeStyle { - /** - * Constructor with a custom renderer implementation that uses table as backing table model. - * @param table The table instance that defines the tabular structure. - * @param [renderer=null] Custom renderer instance for this style. - */ - constructor(table:yfiles.graph.ITable,renderer?:yfiles.styles.TableNodeStyleRenderer); - /** - * Constructor with a custom renderer implementation that uses table as backing table model. - * @param {Object} options The parameters to pass. - * @param options.table The table instance that defines the tabular structure. - * @param [options.renderer=null] Custom renderer instance for this style. - * @param {yfiles.styles.INodeStyle} options.backgroundStyle The style that is used to draw the background of the table - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#backgroundStyle} property on the created object. - *

- * @param {yfiles.styles.TableRenderingOrder} options.tableRenderingOrder The order in which rows and columns are rendered. - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#tableRenderingOrder} property on the created object. - *

- */ - constructor(options:{table:yfiles.graph.ITable,renderer?:yfiles.styles.TableNodeStyleRenderer,backgroundStyle?:yfiles.styles.INodeStyle,tableRenderingOrder?:yfiles.styles.TableRenderingOrder}); - /** - * Default constructor that creates an empty table. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.INodeStyle} options.backgroundStyle The style that is used to draw the background of the table - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#backgroundStyle} property on the created object. - *

- * @param {yfiles.graph.ITable} options.table The {@link yfiles.graph.ITable} instance that defines the tabular structure. - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#table} property on the created object. - *

- * @param {yfiles.styles.TableRenderingOrder} options.tableRenderingOrder The order in which rows and columns are rendered. - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#tableRenderingOrder} property on the created object. - *

- */ - constructor(options?:{backgroundStyle?:yfiles.styles.INodeStyle,table?:yfiles.graph.ITable,tableRenderingOrder?:yfiles.styles.TableRenderingOrder}); - /** - * - * @returns - */ - clone():any; - /** - * Create a copy of the background style when this style instance is cloned - * @param style The original background node style - * @returns This implementation always returns the original style instance. - * @protected - */ - copyBackgroundStyle(style:yfiles.styles.INodeStyle):yfiles.styles.INodeStyle; - /** - * Create a copy of the table when this style instance is cloned - * @param table The original table instance - * @returns This implementation always tries to {@link #clone} clone the original table instance, if possible, - * otherwise it returns table unchanged. - * @protected - */ - copyTable(table:yfiles.graph.ITable):yfiles.graph.ITable; - /** - * Raises the {@link yfiles.styles.TableNodeStyle#addPropertyChangedListener PropertyChanged} event. - *

- * Called when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. - *

- * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Gets or sets the order in which rows and columns are rendered. - * @default yfiles.styles.TableRenderingOrder.COLUMNS_FIRST - * @type {yfiles.styles.TableRenderingOrder} - */ - tableRenderingOrder:yfiles.styles.TableRenderingOrder; - /** - * Gets or sets the style that is used to draw the background of the table - * @default 'TableNodeStyle.defaultBackgroundStyle' - * @type {yfiles.styles.INodeStyle} - */ - backgroundStyle:yfiles.styles.INodeStyle; - /** - * Adds the given listener for the PropertyChanged event that occurs when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. - * @param listener The listener to add. - * @see yfiles.styles.TableNodeStyle#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. - * @param listener The listener to remove. - * @see yfiles.styles.TableNodeStyle#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.graph.ITable} instance that defines the tabular structure. - * @type {yfiles.graph.ITable} - */ - table:yfiles.graph.ITable; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TableNodeStyle; - } - /** - * Default renderer implementation that can be used for {@link yfiles.styles.TableNodeStyle} instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface TableNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class TableNodeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.TableNodeStyleRenderer#style} and {@link yfiles.styles.TableNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.TableNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.TableNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.TableNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.TableNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Get the {@link yfiles.styles.INodeStyle background style} that is currently used by this renderer. - *

- * This implementation retrieves the {@link yfiles.styles.TableNodeStyle#backgroundStyle} from the owning style - *

- * @returns The {@link background style} that is currently used by this renderer. - * @protected - */ - getBackgroundStyle():yfiles.styles.INodeStyle; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * - * @param node - * @param style - * @returns - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * - * @param node - * @param style - * @returns - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * - * @param node - * @param style - * @returns - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * - * @param node - * @param style - * @returns - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * - * @param node - * @param style - * @returns - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Gets the table object that should be used for rendering. - *

- * This implementation delegates to the Table provided by the {@link yfiles.styles.TableNodeStyle#table} property. - *

- * @returns The table that should be used for the rendering process. - * @protected - */ - getTable():yfiles.graph.ITable; - /** - * Get the {@link yfiles.styles.TableRenderingOrder} that is currently used by this renderer. - *

- * This implementation retrieves the {@link yfiles.styles.TableRenderingOrder} from the owning style - *

- * @returns The {@link } that is currently used by this renderer. - * @protected - */ - getTableRenderingOrder():yfiles.styles.TableRenderingOrder; - /** - * - * @param node - * @param style - * @returns - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * - * @param node - * @param style - * @returns - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TableNodeStyle} - */ - style:yfiles.styles.TableNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TableNodeStyleRenderer; - } - /** - * The context of a TemplateBinding. This interface exposes properties of a graph element onto which a TemplateBinding can - * be bound. - * @interface - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface ITemplateStyleBindingContext extends yfiles.lang.Object,yfiles.lang.IPropertyObservable{ - /** - * Gets the width of the visual. - * @abstract - * @type {number} - */ - width:number; - /** - * Gets the height of the visual. - * @abstract - * @type {number} - */ - height:number; - /** - * Gets or sets the {@link yfiles.view.CanvasComponent} instance this instance is used in. - * @abstract - * @type {yfiles.view.CanvasComponent} - */ - canvasComponent:yfiles.view.CanvasComponent; - /** - * Gets or sets a value indicating whether the item is currently selected. - *

- * This state is bound to the {@link yfiles.view.IGraphSelection} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this - * value will write through to the {@link yfiles.view.IGraphSelection}. - *

- * @abstract - * @type {boolean} - */ - itemSelected:boolean; - /** - * Gets or sets a value indicating whether the item is the currently focused item in the {@link yfiles.view.GraphComponent}. - *

- * This state is bound to the {@link yfiles.view.GraphComponent#currentItem} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this value will write through to - * the {@link yfiles.view.GraphComponent#currentItem}. - *

- * @abstract - * @type {boolean} - */ - itemFocused:boolean; - /** - * Gets or sets a value indicating whether the item is currently highlighted. - *

- * This state is bound to the {@link yfiles.view.HighlightIndicatorManager.} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this value will write through to - * the {@link yfiles.view.HighlightIndicatorManager.}'s {@link yfiles.view.HighlightIndicatorManager.#selectionModel} - *

- * @abstract - * @type {boolean} - */ - itemHighlighted:boolean; - /** - * Gets or sets the item that is rendered by this instance. - * @abstract - * @type {yfiles.graph.IModelItem} - */ - item:yfiles.graph.IModelItem; - /** - * Gets or sets the style tag that is associated with the style that created this visual. - *

- * This property can be used by implementers as a convenient property to pass data to the visual. - *

- * @abstract - * @type {any} - */ - styleTag:any; - } - var ITemplateStyleBindingContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.ITemplateStyleBindingContext; - }; - /** - * Enhances the context of a TemplateBinding ({@link yfiles.styles.ITemplateStyleBindingContext}) for labels. This interface - * exposes additional properties of a label onto which a TemplateBinding can be bound. - * @interface - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface ILabelTemplateStyleBindingContext extends yfiles.lang.Object,yfiles.lang.IPropertyObservable{ - /** - * Gets or sets the label text property that is populated using the {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#text} property. - * @abstract - * @type {string} - */ - labelText:string; - /** - * Gets a value indicating whether this instance has been flipped so that it points upwards. - * @abstract - * @type {boolean} - */ - isFlipped:boolean; - /** - * Gets a value indicating whether this instance is currently rendered upside down. - * @abstract - * @type {boolean} - */ - isUpsideDown:boolean; - } - var ILabelTemplateStyleBindingContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.ILabelTemplateStyleBindingContext; - }; - /** - * Base class for label styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.ILabel}s. - * @see yfiles.styles.TemplateLabelStyle - * @see yfiles.styles.StringTemplateLabelStyle - * @class - * @implements {yfiles.styles.ILabelStyle} - * @implements {yfiles.lang.IPropertyObservable} - * @implements {yfiles.lang.ICloneable} - */ - export interface TemplateLabelStyleBase extends yfiles.lang.Object,yfiles.styles.ILabelStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} - export class TemplateLabelStyleBase { - /** - * Constructs a new instance using the provided renderer. - * @param renderer - */ - constructor(renderer:yfiles.styles.TemplateLabelStyleRenderer); - /** - * Constructs a new instance of this style with default values. - * @protected - */ - constructor(); - /** - * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateLabelStyleBase#styleTag} which is cloned, too, if it can be cloned. - * @returns A clone of this instance. - */ - clone():any; - /** - * Factory method that is called by the {@link yfiles.styles.TemplateLabelStyleRenderer} to create the visual that will be used for - * the display of the label. - * @param context The context for which the visual should be created. - * @param label The label that will be rendered. - * @returns The readily styled visual. - */ - createTemplate(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel):yfiles.view.SvgVisual; - /** - * Convenience method that determines the preferred size of the label if this style was applied. - * @param context The context for which the size should be calculated. - * @param label The label to determine the preferred size of. - * @returns The preferred size. - */ - getPreferredSize(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel):yfiles.geometry.Size; - /** - * Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects. - *

- * This method can be called to perform the template loading at a certain point in time, for example during application - * startup. By default, a template is loaded lazily when the first visual using this template is built. - *

- * @static - */ - static loadAllTemplates():void; - /** - * Raises the {@link yfiles.styles.TemplateLabelStyleBase#addPropertyChangedListener PropertyChanged} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to add. - * @see yfiles.styles.TemplateLabelStyleBase#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to remove. - * @see yfiles.styles.TemplateLabelStyleBase#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the tag that is associated with this style instance. - *

- * The various style renderer implementations can use this tag to make it accessible in the context of the instantiated - * templates and controls. The framework does not make any assumptions about the value of this property. It is there for - * convenient use in the process of data binding the templates. This property supports {@link yfiles.lang.IPropertyObservable property change notification} and can - * thus be data bound easily. - *

- * @default null - * @type {any} - */ - styleTag:any; - /** - * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the - * implementation which is returned by calls to {@link yfiles.styles.ILabelStyleRenderer#getContext} that are made on the style - * renderer that is associated with this style instance. - *

- * This can be used to conveniently customize the lookup behavior of the style renderers that are associated with this - * instance. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - *

- * @default 'Lookups.EmptyContextLookup' - * @type {yfiles.graph.IContextLookup} - */ - contextLookup:yfiles.graph.IContextLookup; - /** - * Gets or sets the normalized outline of a label that will be displayed using the created visual. - *

- * The shape will automatically arranged and transformed to have the bounds of the label. This shape will be used to - * satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} and may be left null to - * indicate default (rectangular) behavior. - *

- *

- * The default value is null. - *

- * @default null - * @type {yfiles.geometry.GeneralPath} - */ - normalizedOutline:yfiles.geometry.GeneralPath; - /** - * Gets or sets a value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if - * otherwise it would be rendered upside-down. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - autoFlip:boolean; - /** - * Gets or sets the preferred size of the labels that use this style. - * @type {yfiles.geometry.Size} - */ - preferredSize:yfiles.geometry.Size; - /** - * - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateLabelStyleBase; - } - /** - * An {@link yfiles.styles.ILabelStyle} implementation that uses an SVG snippet as template for the visualization of - * {@link yfiles.graph.ILabel}s. - *

- * The {@link yfiles.styles.TemplateLabelStyle#styleResourceKey} is used to determine the template that will be applied to the component. The template must be specified in the DOM - * in a script tag with type='text/yfiles-template'. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the label that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
  • labelText: The label text property that is populated using the {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#text} property
  • - *
  • isFlipped: Whether the element has been flipped
  • - *
  • isUpsideDown: Whether the element is currently rendered upside down
  • - *
- * @class - * @extends {yfiles.styles.TemplateLabelStyleBase} - */ - export interface TemplateLabelStyle extends yfiles.styles.TemplateLabelStyleBase{} - export class TemplateLabelStyle { - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderTemplateId:string,renderer:yfiles.styles.TemplateLabelStyleRenderer); - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param options.renderer The custom renderer for this style instance. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplateLabelStyleRenderer,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); - /** - * Creates a new instance using the given render template id. - * @param renderTemplateId The id of the render template that will be used for the component. - */ - constructor(renderTemplateId:string); - /** - * Creates a new instance using the given render template id. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the render template that will be used for the component. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); - /** - * Creates a new instance with no render template id and {@link yfiles.styles.TemplateLabelStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyle#styleResourceKey} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,styleResourceKey?:string}); - /** - * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. - *

- * The default value is null. - *

- * @default null - * @type {string} - */ - styleResourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateLabelStyle; - } - /** - * An {@link yfiles.styles.ILabelStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.ILabel}s. - *

- * In contrast to {@link yfiles.styles.TemplateLabelStyle}, the SVG template used by this style must be encoded as string and set - * to the {@link yfiles.styles.StringTemplateLabelStyle#svgContent} property. - *

- *

- * It is vital that the {@link yfiles.styles.StringTemplateLabelStyle#svgContent SVG snippet} does not declare the SVG namespace itself. Its content is parsed in a dummy namespace - * in order to avoid immediate validation of the result. The resulting SVG elements are automatically created in the SVG - * namespace before they are added to the DOM. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the label that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
  • labelText: The label text property that is populated using the {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#text} property
  • - *
  • isFlipped: Whether this instance has been flipped so that it points upwards
  • - *
  • isUpsideDown: Whether this instance is currently rendered upside down
  • - *
- * @class - * @extends {yfiles.styles.TemplateLabelStyleBase} - */ - export interface StringTemplateLabelStyle extends yfiles.styles.TemplateLabelStyleBase{} - export class StringTemplateLabelStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.TemplateLabelStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- * @param {string} options.svgContent The SVG content that is the template for the label visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplateLabelStyle#svgContent} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.TemplateLabelStyleRenderer,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,svgContent?:string}); - /** - * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplateLabelStyle#svgContent}. - * @param svgContent The SVG snippet to use as template. - */ - constructor(svgContent:string); - /** - * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplateLabelStyle#svgContent}. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet to use as template. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- */ - constructor(options:{svgContent:string,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); - /** - * Initializes a new instance of this class. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- * @param {string} options.svgContent The SVG content that is the template for the label visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplateLabelStyle#svgContent} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,svgContent?:string}); - /** - * Gets or sets the SVG content that is the template for the label visualization. - * @default null - * @type {string} - */ - svgContent:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StringTemplateLabelStyle; - } - /** - * An implementation of the {@link yfiles.styles.ILabelStyleRenderer} interface that can render {@link yfiles.styles.TemplateLabelStyleBase} - * instances. - * @see yfiles.styles.TemplateLabelStyle - * @see yfiles.styles.StringTemplateLabelStyle - * @class - * @implements {yfiles.styles.ILabelStyleRenderer} - * @implements {yfiles.view.IVisualCreator} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.graph.ILookup} - */ - export interface TemplateLabelStyleRenderer extends yfiles.lang.Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IVisualCreator,yfiles.view.IBoundsProvider,yfiles.input.IHitTestable,yfiles.input.IMarqueeTestable,yfiles.view.IVisibilityTestable,yfiles.graph.ILookup{} - export class TemplateLabelStyleRenderer { - /** - * Stores the {@link yfiles.graph.ILabel#layout layout}. - *

- * Subclasses should override this method, call the super implementation and configure their painting entities. - *

- * @protected - */ - configure():void; - /** - * Creates the visual by delegating to {@link yfiles.styles.TemplateLabelStyleBase#createTemplate} and then initializing the - * control with the context. - * @param context The context for the creation. - * @returns The visual that is used for rendering the label. - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the bounds provider for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#getBounds - */ - getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateLabelStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.TemplateLabelStyleRenderer#lookup} method call they should - * call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} only if needed, i.e. if they decide to return this or an - * instance that depends on a correctly configured this. - *

- * @param label The label to query the context for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#lookup - */ - getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - * @param label The label to query hit test with. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#isHit - */ - getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - * @param label The label to query marquee intersection tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#isInBox - */ - getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; - /** - * Gets the normalized outline by delegating to {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline}. - * @param style - * @returns - * @protected - */ - getNormalizedOutline(style:yfiles.styles.TemplateLabelStyleBase):yfiles.geometry.GeneralPath; - /** - * Calculates the preferred size for the given label and style. - * @param label The label instance. - * @param style The style instance to apply. - * @returns The preferred size for the given label and style. - * @see yfiles.styles.TemplateLabelStyleRenderer#getPreferredSizeCore - */ - getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Gets the size of the preferred for the current configuration using the provided context. - * @param context The context. - * @returns - * @protected - */ - getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; - /** - * Calculates the preferred size for the given label and style. - * @param context - * @param label The label instance. - * @param style The style instance to apply. - * @returns The preferred size for the given label and style. - * @see yfiles.styles.TemplateLabelStyleRenderer#getPreferredSizeCore - */ - getPreferredSizeWithContext(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.TemplateLabelStyleRenderer#isVisible}. - *

- * @param label The label to query visibility tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#isVisible - */ - getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the {@link } for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#createVisual - * @see yfiles.styles.TemplateLabelStyleRenderer#updateVisual - */ - getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; - /** - * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase}'s {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property. - * @param style - * @returns - * @protected - */ - isAutoFlip(style:yfiles.styles.TemplateLabelStyleBase):boolean; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Uses the {@link yfiles.graph.ILabel#layout layout} to determine whether the clip intersects. - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase#contextLookup} of the {@link yfiles.styles.ILabelStyle}. - * @param type The type to query an instance for. - * @returns The implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase}'s {@link yfiles.styles.TemplateLabelStyleBase#contextLookup}. - * @param style The style to look up the context for. - * @param label The current label. - * @param type The type to look up. - * @returns The result from the context or null. - * @protected - */ - lookupContext(style:yfiles.styles.TemplateLabelStyleBase,label:yfiles.graph.ILabel,type:yfiles.lang.Class):any; - /** - * Updates the visual correspondingly. - * @param context The context for the creation. - * @param oldVisual The currently rendered visual. - * @returns The visual that is used for rendering the label. - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets the layout of the current label. - *

- * This value is set during {@link yfiles.styles.TemplateLabelStyleRenderer#configure} to the label's {@link yfiles.graph.ILabel#layout layout} - *

- * @protected - * @type {yfiles.geometry.IOrientedRectangle} - */ - layout:yfiles.geometry.IOrientedRectangle; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TemplateLabelStyleBase} - */ - style:yfiles.styles.TemplateLabelStyleBase; - /** - * Gets or sets the currently configured label. - * @protected - * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateLabelStyleRenderer; - } - /** - * Base class for node styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.INode}s. - * @see yfiles.styles.TemplateNodeStyle - * @see yfiles.styles.StringTemplateNodeStyle - * @class - * @implements {yfiles.styles.INodeStyle} - * @implements {yfiles.lang.IPropertyObservable} - * @implements {yfiles.lang.ICloneable} - */ - export interface TemplateNodeStyleBase extends yfiles.lang.Object,yfiles.styles.INodeStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} - export class TemplateNodeStyleBase { - /** - * Constructs a new instance using the provided renderer. - * @param renderer - * @protected - */ - constructor(renderer:yfiles.styles.TemplateNodeStyleRenderer); - /** - * Constructs a new instance of this style with default values. - * @protected - */ - constructor(); - /** - * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateNodeStyleBase#styleTag} which is cloned, too, if it can be cloned. - * @returns A clone of this instance. - */ - clone():any; - /** - * Factory method that is called by the {@link yfiles.styles.TemplateNodeStyleRenderer} to create the visual that will be used for - * the display of the node. - * @param context The context for which the visual should be created. - * @param node The node that will be rendered. - * @returns The readily styled visual. - */ - createTemplate(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.SvgVisual; - /** - * Convenience method that determines the preferred size of the node if this style was applied. - * @param context The context for which the size should be calculated. Can be obtained through - * {@link #createRenderContext}. - * @param node The node to determine the preferred size of. Can be a live node or an {@link }. - * @returns The preferred size. - * @see yfiles.view.CanvasComponent#createRenderContext - */ - getPreferredSize(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.geometry.Size; - /** - * Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects. - *

- * This method can be called to perform the template loading at a certain point in time, for example during application - * startup. By default, a template is loaded lazily when the first visual using this template is built. - *

- * @static - */ - static loadAllTemplates():void; - /** - * Raises the {@link yfiles.styles.TemplateNodeStyleBase#addPropertyChangedListener PropertyChanged} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to add. - * @see yfiles.styles.TemplateNodeStyleBase#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to remove. - * @see yfiles.styles.TemplateNodeStyleBase#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the tag that is associated with this style instance. - *

- * The various style renderer implementations can use this tag to make it accessible in the context of the instantiated - * templates and controls. The framework does not make any assumptions about the value of this property. It is there for - * convenient use in the process of data binding the templates. This property supports {@link yfiles.lang.IPropertyObservable property change notification} and can - * thus be data bound easily. - *

- * @default null - * @type {any} - */ - styleTag:any; - /** - * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the - * implementation which is returned by calls to {@link yfiles.styles.INodeStyleRenderer#getContext} that are made on the style - * renderer that is associated with this style instance. - *

- * This can be used to conveniently customize the lookup behavior of the style renderers that are associated with this - * instance. E.g. it is possible to provide customized implementations of {@link yfiles.view.ISelectionIndicatorInstaller}, - * {@link yfiles.view.IHighlightIndicatorInstaller}, {@link yfiles.input.IHandleProvider}, {@link yfiles.input.INodeSizeConstraintProvider}, and - * {@link yfiles.input.INodeInsetsProvider}. Simple style implementations can use {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - * but may not use null for this property. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - *

- * @default 'Lookups.EmptyContextLookup' - * @type {yfiles.graph.IContextLookup} - */ - contextLookup:yfiles.graph.IContextLookup; - /** - * Gets or sets the insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this - * instance. - *

- * This is especially useful if this style is used for {@link yfiles.graph.IGraph#createGroupNode group nodes}, as they require insets for the calculation of the - * bounds. The insets can be used to make sure that child nodes do not cover visual elements of the style inside the - * insets. The default value is an {@link yfiles.geometry.Insets} insets with 5 for all insets. - *

- * @see yfiles.input.INodeInsetsProvider - * @see yfiles.styles.INodeStyleRenderer#getContext - * @default '5' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * Gets or sets the minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should - * yield. - *

- * The default value is {@link yfiles.geometry.Size#EMPTY}. - *

- * @see yfiles.input.INodeSizeConstraintProvider - * @default 'Empty' - * @type {yfiles.geometry.Size} - */ - minimumSize:yfiles.geometry.Size; - /** - * Gets or sets the normalized outline of a node that will be displayed using the created visual. - *

- * This shape will be used to satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox}, {@link yfiles.input.IHitTestable#isHit}, - * as well as for {@link yfiles.styles.IShapeGeometry} methods (which affect edge cropping at the node outline). - *

- *

- * This property may be left at or set to null to indicate default (rectangular) behavior. - *

- *

- * The default value is null. - *

- * @default null - * @type {yfiles.geometry.GeneralPath} - */ - normalizedOutline:yfiles.geometry.GeneralPath; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateNodeStyleBase; - } - /** - * A {@link yfiles.styles.INodeStyle} implementation that uses an SVG snippet as template for the visualization of - * {@link yfiles.graph.INode}s. - *

- * The {@link yfiles.styles.TemplateNodeStyle#styleResourceKey} is used to determine the template that will be applied to the {@link yfiles.view.Visual}. The template must be specified in - * the DOM in a script tag with type='text/yfiles-template'. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the node that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
- *

Related demos:

- *
    - *
  • Demo: OrgChart Demo, Demo.yFiles.Graph.OrgChart
  • - *
  • Demo: Collapse Demo, Demo.yFiles.Graph.Collapse
  • - *
- * @class - * @extends {yfiles.styles.TemplateNodeStyleBase} - */ - export interface TemplateNodeStyle extends yfiles.styles.TemplateNodeStyleBase{} - export class TemplateNodeStyle { - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - * @param renderer The custom renderer for this instance. - */ - constructor(renderTemplateId:string,renderer:yfiles.styles.TemplateNodeStyleRenderer); - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param options.renderer The custom renderer for this instance. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplateNodeStyleRenderer,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance using the given render template id and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - */ - constructor(renderTemplateId:string); - /** - * Creates a new instance using the given render template id and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance with no render template id key and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyle#styleResourceKey} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath,styleResourceKey?:string}); - /** - * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. - *

- * The default value is null. - *

- * @default null - * @type {string} - */ - styleResourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateNodeStyle; - } - /** - * A {@link yfiles.styles.INodeStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.INode}s. - *

- * In contrast to {@link yfiles.styles.TemplateNodeStyle}, the SVG template used by this style must be encoded as string and set to - * the {@link yfiles.styles.StringTemplateNodeStyle#svgContent} property. - *

- *

- * It is vital that the {@link yfiles.styles.StringTemplateNodeStyle#svgContent SVG snippet} does not declare the SVG namespace itself. Its content is parsed in a dummy namespace - * in order to avoid immediate validation of the result. The resulting SVG elements are automatically created in the SVG - * namespace before they are added to the DOM. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the node that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
- * @class - * @extends {yfiles.styles.TemplateNodeStyleBase} - */ - export interface StringTemplateNodeStyle extends yfiles.styles.TemplateNodeStyleBase{} - export class StringTemplateNodeStyle { - /** - * Creates a new instance using the given SVG template and a custom renderer instance. - * @param svgContent The SVG snippet that will be used as a template for the component. - * @param renderer The custom renderer for this instance. - */ - constructor(svgContent:string,renderer:yfiles.styles.TemplateNodeStyleRenderer); - /** - * Creates a new instance using the given SVG template and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet that will be used as a template for the component. - * @param options.renderer The custom renderer for this instance. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- */ - constructor(options:{svgContent:string,renderer:yfiles.styles.TemplateNodeStyleRenderer,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param svgContent The SVG snippet that will be used as a template for the component. - */ - constructor(svgContent:string); - /** - * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet that will be used as a template for the component. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- */ - constructor(options:{svgContent:string,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance with no SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- * @param {string} options.svgContent The SVG content that is the template for the node visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplateNodeStyle#svgContent} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath,svgContent?:string}); - /** - * Gets or sets the SVG content that is the template for the node visualization. - * @default null - * @type {string} - */ - svgContent:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StringTemplateNodeStyle; - } - /** - * An implementation of the {@link yfiles.styles.INodeStyleRenderer} interface that can render {@link yfiles.styles.TemplateNodeStyleBase} - * instances. - * @see yfiles.styles.TemplateNodeStyle - * @see yfiles.styles.StringTemplateNodeStyle - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface TemplateNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class TemplateNodeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.TemplateNodeStyleRenderer#style} and {@link yfiles.styles.TemplateNodeStyleRenderer#node} properties have been populated by the - * {@link yfiles.styles.TemplateNodeStyleRenderer#getVisualCreator}, {@link yfiles.styles.TemplateNodeStyleRenderer#getBoundsProvider}, - * {@link yfiles.styles.TemplateNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.TemplateNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * Creates the visual by delegating to {@link yfiles.styles.TemplateNodeStyleBase#createTemplate} and then initializing the control - * with the context. - * @param context The context for the creation. - * @returns The visual that is used for rendering the node. - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns the layout bounds as an upper bound for the painting bound. - *

- * This implementation simply sets the {@link yfiles.styles.TemplateNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or null to indicate an unbound area - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Provides a {@link yfiles.view.IBoundsProvider bounds calculation} implementation for the given style and node. - *

- * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.view.IBoundsProvider} interface than this instance will be returned, - * otherwise the default (rectangular) behavior will be used. - *

- * @param node The node to query the provider for. - * @param style The style whose provider is queried. - * @returns An implementation that can calculate visual bounds. - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.TemplateNodeStyleRenderer#lookup} method call they should call - * {@link yfiles.styles.TemplateNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that - * depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Gets the context by delegating to {@link yfiles.styles.TemplateNodeStyleBase#contextLookup}. - * @param style - * @returns - * @protected - */ - getContextLookup(style:yfiles.styles.TemplateNodeStyleBase):yfiles.graph.IContextLookup; - /** - * Provides a {@link yfiles.input.IHitTestable hit testing} implementation for the given style and node. - *

- * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.input.IHitTestable} interface than this instance will be returned, otherwise - * the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} will be used to perform the hit testing. - *

- * @param node The node to query the tester for. - * @param style The style whose tester is queried. - * @returns An implementation that can perform the hit testing. - * @see yfiles.styles.TemplateNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Gets the insets by delegating to {@link yfiles.styles.TemplateNodeStyleBase#insets}. - * @param style - * @returns - * @protected - */ - getInsets(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.Insets; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the intersection calculation, otherwise reverts to default (rectangular) - * behavior. - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Provides a {@link yfiles.input.IMarqueeTestable marquee testing} implementation for the given style and node. - *

- * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.input.IMarqueeTestable} interface than this instance will be returned, - * otherwise the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} will be used to determine the marquee intersection test with the visual representation of - * the node. - *

- * @param node The node to query the tester for. - * @param style The style whose tester is queried. - * @returns An implementation that can test for marquee intersections. - * @see yfiles.styles.TemplateNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * Gets the minimum size by delegating to {@link yfiles.styles.TemplateNodeStyleBase#minimumSize}. - * @param style - * @returns - * @protected - */ - getMinimumSize(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.Size; - /** - * Gets the normalized outline by delegating to {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline}. - * @param style - * @returns - * @protected - */ - getNormalizedOutline(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.GeneralPath; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to create the outline shape path, otherwise reverts to default (rectangular) behavior. - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Calculates the preferred size for the given node and style in the provided context. - * @param context The context for which the preferred size should be calculated. - * @param node The node instance. - * @param style The style instance to apply. - * @returns The preferred size for the given label and style. - * @see yfiles.styles.TemplateNodeStyleRenderer#getPreferredSizeCore - */ - getPreferredSize(context:yfiles.view.IRenderContext,node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.geometry.Size; - /** - * Calculates the preferred size for the given node and style. - * @param node The node instance. - * @param style The style instance to apply. - * @returns The preferred size for the given label and style. - * @see yfiles.styles.TemplateNodeStyleRenderer#getPreferredSizeCore - */ - getPreferredSize(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.geometry.Size; - /** - * Calculates the preferred size given the current state of the renderer for the given context. - * @param context The render context for which the preferred size should be calculated. - * @returns The size as suggested by this renderer. - * @protected - */ - getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; - /** - * Provides the geometry for the visual representation. - *

- * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.styles.IShapeGeometry} interface than this instance will be returned, - * otherwise the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} will be used to determine the outline of the visual representation of a node. - *

- * @param node The node to query the geometry for. - * @param style The style for which the geometry is queried. - * @returns An implementation that describes the outline geometry of the shape. - * @see yfiles.styles.TemplateNodeStyleRenderer#isInside - * @see yfiles.styles.TemplateNodeStyleRenderer#getOutline - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.TemplateNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateNodeStyleRenderer#createVisual - * @see yfiles.styles.TemplateNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the hit test analysis, otherwise reverts to default (rectangular) behavior. - * @param context the context the hit test is performed in - * @param location the hit point in world coordinates - * @returns whether something has been hit - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the marquee intersection analysis, otherwise reverts to default (rectangular) - * behavior. - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the contains test, otherwise reverts to default (rectangular) behavior. - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.TemplateNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implementation of the {@link yfiles.graph.ILookup#lookup} method. - *

- * Delegates to the lookup returned by {@link yfiles.styles.TemplateNodeStyleRenderer#getContextLookup}, first. Returns special {@link yfiles.input.INodeInsetsProvider} - * or {@link yfiles.input.INodeSizeConstraintProvider} implementations if asked for. Last, it returns this class if it implements - * the queried type. - *

- * @param type The type to query an instance for. - * @returns The implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Updates the component correspondingly. - * @param context The context for the creation. - * @param oldVisual The currently rendered visual. - * @returns The visual that is used for rendering the node. - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TemplateNodeStyleBase} - */ - style:yfiles.styles.TemplateNodeStyleBase; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateNodeStyleRenderer; - } - /** - * Base class for port styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.IPort}s. - * @see yfiles.styles.TemplatePortStyle - * @see yfiles.styles.TemplatePortStyle - * @class - * @implements {yfiles.styles.IPortStyle} - * @implements {yfiles.lang.IPropertyObservable} - * @implements {yfiles.lang.ICloneable} - */ - export interface TemplatePortStyleBase extends yfiles.lang.Object,yfiles.styles.IPortStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} - export class TemplatePortStyleBase { - /** - * Constructs a new instance using the provided renderer. - * @param renderer - * @protected - */ - constructor(renderer:yfiles.styles.TemplatePortStyleRenderer); - /** - * Constructs a new instance of this style with default values. - * @protected - */ - constructor(); - /** - * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplatePortStyleBase#styleTag} which is cloned, too, if it can be cloned. - * @returns A clone of this instance. - */ - clone():any; - /** - * Factory method that is called by the {@link yfiles.styles.TemplatePortStyleRenderer} to create the visual that will be used for - * the display of the port. - * @param context The context for which the visual should be created. - * @param port The port that will be rendered. - * @returns The readily styled visual. - */ - createTemplate(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort):yfiles.view.SvgVisual; - /** - * Convenience method that determines the preferred {@link yfiles.styles.TemplatePortStyleBase#renderSize} of the port if this style was applied. - * @param context The context for which the size should be calculated. - * @param port The port to determine the preferred size of. - * @returns The preferred size. - */ - getPreferredSize(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort):yfiles.geometry.Size; - /** - * Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects. - *

- * This method can be called to perform the template loading at a certain point in time, for example during application - * startup. By default, a template is loaded lazily when the first visual using this template is built. - *

- * @static - */ - static loadAllTemplates():void; - /** - * Raises the {@link yfiles.styles.TemplatePortStyleBase#addPropertyChangedListener PropertyChanged} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to add. - * @see yfiles.styles.TemplatePortStyleBase#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to remove. - * @see yfiles.styles.TemplatePortStyleBase#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the tag that is associated with this style instance. - *

- * The various style renderer implementations can use this tag to make it accessible in the context of the instantiated - * templates and controls. The framework does not make any assumptions about the value of this property. It is there for - * convenient use in the process of data binding the templates. This property supports {@link yfiles.lang.IPropertyObservable property change notification} and can - * thus be data bound easily. - *

- * @default null - * @type {any} - */ - styleTag:any; - /** - * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the - * implementation which is returned by calls to {@link yfiles.styles.IPortStyleRenderer#getContext} that are made on the style - * renderer that is associated with this style instance. - *

- * This can be used to conveniently customize the lookup behavior of the style renderers that are associated with this - * instance. E.g. it is possible to provide customized implementations of {@link yfiles.view.ISelectionIndicatorInstaller}, - * {@link yfiles.view.IHighlightIndicatorInstaller}, {@link yfiles.input.IHandleProvider}, {@link yfiles.input.INodeSizeConstraintProvider}, and - * {@link yfiles.input.INodeInsetsProvider}. Simple style implementations can use {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - * but may not use null for this property. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - *

- * @default 'Lookups.EmptyContextLookup' - * @type {yfiles.graph.IContextLookup} - */ - contextLookup:yfiles.graph.IContextLookup; - /** - * Gets or sets the {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This size will be used to arrange the visual correctly. The default value is (5,5). - *

- * @default '5,5' - * @type {yfiles.geometry.Size} - */ - renderSize:yfiles.geometry.Size; - /** - * Gets or sets the normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * The shape will automatically be arranged and transformed to have the bounds of the port. This shape will be used to - * satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} and may be left null to - * indicate default (rectangular) behavior. - *

- *

- * The default value is null. - *

- * @default null - * @type {yfiles.geometry.GeneralPath} - */ - normalizedOutline:yfiles.geometry.GeneralPath; - /** - * - * @type {yfiles.styles.IPortStyleRenderer} - */ - renderer:yfiles.styles.IPortStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplatePortStyleBase; - } - /** - * An {@link yfiles.styles.IPortStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.IPort}s. - *

- * The {@link yfiles.styles.TemplatePortStyle#styleResourceKey} is used to determine the template that will be applied to the component. The template must be specified in the DOM - * in a script tag with type='text/yfiles-template'. - *

- *

- * Note that the {@link yfiles.styles.TemplatePortStyleBase#renderSize} should be specified to match the size of the visual's template. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the port that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
- * @class - * @extends {yfiles.styles.TemplatePortStyleBase} - */ - export interface TemplatePortStyle extends yfiles.styles.TemplatePortStyleBase{} - export class TemplatePortStyle { - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderTemplateId:string,renderer:yfiles.styles.TemplatePortStyleRenderer); - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param options.renderer The custom renderer for this style instance. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplatePortStyleRenderer,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); - /** - * Creates a new instance using the given resource key and a custom renderer instance.{@link yfiles.styles.TemplatePortStyleRenderer} - * as renderer. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - */ - constructor(renderTemplateId:string); - /** - * Creates a new instance using the given resource key and a custom renderer instance.{@link yfiles.styles.TemplatePortStyleRenderer} - * as renderer. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); - /** - * Creates a new instance with no render template id and {@link yfiles.styles.TemplatePortStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyle#styleResourceKey} property on the created object. - *

- */ - constructor(options?:{normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size,styleResourceKey?:string}); - /** - * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. - *

- * The default value is null. - *

- * @default null - * @type {string} - */ - styleResourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplatePortStyle; - } - /** - * An implementation of the {@link yfiles.styles.IPortStyleRenderer} interface that can render {@link yfiles.styles.TemplatePortStyleBase} - * instances. - * @see yfiles.styles.TemplatePortStyle - * @see yfiles.styles.StringTemplatePortStyle - * @class - * @implements {yfiles.styles.IPortStyleRenderer} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface TemplatePortStyleRenderer extends yfiles.lang.Object,yfiles.styles.IPortStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class TemplatePortStyleRenderer { - constructor(); - /** - * Prepares this instance for subsequent calls after the style and port have been initialized. - *

- * Upon invocation the {@link yfiles.styles.TemplatePortStyleRenderer#style} and {@link yfiles.styles.TemplatePortStyleRenderer#port} properties have been populated by the - * {@link yfiles.styles.TemplatePortStyleRenderer#getVisualCreator}, {@link yfiles.styles.TemplatePortStyleRenderer#getBoundsProvider}, - * {@link yfiles.styles.TemplatePortStyleRenderer#getHitTestable}, or {@link yfiles.styles.TemplatePortStyleRenderer#getMarqueeTestable} - * methods. - *

- * @protected - */ - configure():void; - /** - * Creates the visual by delegating to {@link yfiles.styles.TemplatePortStyleBase#createTemplate} and then initializing the visual - * with the context. - * @param context The context for the creation. - * @returns The visual that is used for rendering the port. - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. - * @param port The port to retrieve the bounds provider for. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#getBounds - */ - getBoundsProvider(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and port parameters, does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.TemplatePortStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.TemplatePortStyleRenderer#lookup} method call they should call - * {@link yfiles.styles.TemplatePortStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that - * depends on a correctly configured this. - *

- * @param port The port to query the context for. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#lookup - */ - getContext(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.graph.ILookup; - /** - * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. - * @param port The port to query hit test with. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#isHit - */ - getHitTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IHitTestable; - /** - * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. - * @param port The port to query marquee intersection tests. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#isInBox - */ - getMarqueeTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IMarqueeTestable; - /** - * Gets the normalized outline by delegating to {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline}. - * @param style - * @returns - * @protected - */ - getNormalizedOutline(style:yfiles.styles.TemplatePortStyleBase):yfiles.geometry.GeneralPath; - /** - * Calculates the preferred size for the given port and style. - * @param context The render context which can be null. - * @param port The port instance. - * @param style The style instance to apply. - * @returns The preferred size for the given port and style. - * @see yfiles.styles.TemplatePortStyleRenderer#getPreferredSizeCore - */ - getPreferredSize(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort,style:yfiles.styles.TemplatePortStyleBase):yfiles.geometry.Size; - /** - * Gets the preferred size for the current configuration. - * @param context - * @returns The preferred size. - * @protected - */ - getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; - /** - * Gets the size of the rendering from the style. - * @returns The {@link #renderSize}. - * @protected - */ - getRenderSize():yfiles.geometry.Size; - /** - * Configures the style and port parameters, does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.TemplatePortStyleRenderer#isVisible}. - *

- * @param port The port to query visibility tests. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#isVisible - */ - getVisibilityTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. - * @param port The port to retrieve the {@link } for. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#createVisual - * @see yfiles.styles.TemplatePortStyleRenderer#updateVisual - */ - getVisualCreator(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and test the {@link yfiles.styles.TemplatePortStyleRenderer#port} using the {@link yfiles.styles.TemplatePortStyleRenderer#style} for a visible intersection with the - * clip bounds. - *

- * This simple implementation uses {@link yfiles.styles.TemplatePortStyleRenderer#getBounds} to determine the visibility. - * Subclasses may choose to override this behavior for improved performance but need to make sure to call {@link yfiles.styles.TemplatePortStyleRenderer#configure} if they depend on a configured - * instance. - *

- * @param context the current canvas context - * @param rectangle the clip bounds - * @returns true if the port may be painted within the clip bounds. - * @see yfiles.styles.TemplatePortStyleRenderer#getVisibilityTestable - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.TemplatePortStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.TemplatePortStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.TemplatePortStyleRenderer#port} and {@link yfiles.styles.TemplatePortStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.TemplatePortStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Delegates to the {@link yfiles.styles.TemplatePortStyleBase}'s {@link yfiles.styles.TemplatePortStyleBase#contextLookup}. - * @param style - * @param port - * @param type - * @returns - * @protected - */ - lookupContext(style:yfiles.styles.TemplatePortStyleBase,port:yfiles.graph.IPort,type:yfiles.lang.Class):any; - /** - * Updates the component correspondingly. - * @param context The context for the creation. - * @param oldVisual The currently rendered visual. - * @returns The visual that is used for rendering the port. - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets the center of the port. - * @protected - * @type {yfiles.geometry.Point} - */ - center:yfiles.geometry.Point; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TemplatePortStyleBase} - */ - style:yfiles.styles.TemplatePortStyleBase; - /** - * Gets or sets the currently configured port. - * @protected - * @type {yfiles.graph.IPort} - */ - port:yfiles.graph.IPort; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplatePortStyleRenderer; - } - /** - * A {@link yfiles.styles.TemplatePortStyleBase} that uses an SVG snippet as template for the visualization of - * {@link yfiles.graph.IPort}s. - *

- * In contrast to {@link yfiles.styles.TemplatePortStyle}, the SVG template used by this style must be encoded as string and set to - * the {@link yfiles.styles.StringTemplatePortStyle#svgContent} property. Note that the RenderSize should be specified to match the size of the visual's template. - *

- *

- * It is vital that the {@link yfiles.styles.StringTemplatePortStyle#svgContent SVG snippet} does not declare the SVG namespace itself. Its content is parsed in a dummy namespace - * in order to avoid immediate validation of the result. The resulting SVG elements are automatically created in the SVG - * namespace before they are added to the DOM. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the port that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
- * @class - * @extends {yfiles.styles.TemplatePortStyleBase} - */ - export interface StringTemplatePortStyle extends yfiles.styles.TemplatePortStyleBase{} - export class StringTemplatePortStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.TemplatePortStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.TemplatePortStyleRenderer,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); - /** - * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplatePortStyle#svgContent}. - * @param svgContent The SVG snippet to use as template. - */ - constructor(svgContent:string); - /** - * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplatePortStyle#svgContent}. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet to use as template. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- */ - constructor(options:{svgContent:string,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); - /** - * Creates a new instance using {@link yfiles.styles.TemplatePortStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- * @param {string} options.svgContent The SVG content that is the template for the port visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplatePortStyle#svgContent} property on the created object. - *

- */ - constructor(options?:{normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size,svgContent?:string}); - /** - * Gets or sets the SVG content that is the template for the port visualization. - * @default null - * @type {string} - */ - svgContent:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StringTemplatePortStyle; - } - /** - * Style implementation for {@link yfiles.graph.IStripe} instances in an {@link yfiles.graph.ITable}. - *

- * It is up to the implementation to interpret the visual appearance of a stripe. The framework uses the associated, - * possibly shared {@link yfiles.styles.IStripeStyle#renderer} to perform the actual rendering of this style for a given stripe. This interface extends the {@link yfiles.lang.ICloneable} - * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style - * implementations may return themselves. - *

- *

Related demos:

- *
    - *
  • Demo: TableNodeStyle, Demo.yFiles.Graph.TableNodeStyle
  • - *
- * @interface - * @implements {yfiles.lang.ICloneable} - */ - export interface IStripeStyle extends yfiles.lang.Object,yfiles.lang.ICloneable{ - /** - * Gets the renderer implementation that can be queried for implementations that provide details about the visual - * appearance and visual behavior for a given stripe and this style instance. - *

- * The idiom for retrieving, e.g. an {@link yfiles.view.IVisualCreator} implementation for a given stripe is: - *

- * @abstract - * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - } - var IStripeStyle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IStripeStyle; - }; - /** - * Interface used by {@link yfiles.styles.IStripeStyle} implementations that can be used to query the actual {@link yfiles.view.IVisualCreator} - * implementation for a stripe and an associated style. - *

- * Implementations of this interface should be designed to be sharable between multiple style instances and should - * therefore not contain style specific state. - *

- * @see yfiles.styles.IStripeStyle - * @see yfiles.graph.IStripe - * @interface - */ - export interface IStripeStyleRenderer extends yfiles.lang.Object{ - /** - * Gets a temporary context instance that can be used to query additional information for the stripe's style. - *

- * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. - *

- * @param stripe The stripe to provide a context instance for. - * @param style The style to use for the context. - * @returns An non-null lookup implementation. - * @see yfiles.graph.ILookup#EMPTY - * @see yfiles.graph.ILookup - * @abstract - */ - getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; - /** - * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided stripe and its - * associated style. - *

- * This method may return a flyweight implementation, but never null. - *

- * @param stripe The nstripeode to provide an instance for - * @param style The style to use for the creation of the visual - * @returns An implementation that may be used to subsequently create or update the visual for the stripe. Clients should not cache - * this instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations. This method may not return null but should yield a {@link #INSTANCE void} implementation - * instead. - * @see yfiles.view.VoidVisualCreator#INSTANCE - * @abstract - */ - getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; - } - var IStripeStyleRenderer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IStripeStyleRenderer; - }; - /** - * A void implementation of a stripe style that does nothing and behaves like an invisible style. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidStripeStyle#INSTANCE} of this class - * instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.graph.IStripe#style} property of an - * {@link yfiles.graph.IStripe}. - *

- * @class - * @implements {yfiles.styles.IStripeStyle} - * @final - */ - export interface VoidStripeStyle extends yfiles.lang.Object,yfiles.styles.IStripeStyle{} - export class VoidStripeStyle { - /** - * Returns this. - * @returns this - */ - clone():any; - /** - * The {@link yfiles.styles.VoidStripeStyle} singleton. - * @const - * @static - * @type {yfiles.styles.VoidStripeStyle} - */ - static INSTANCE:yfiles.styles.VoidStripeStyle; - /** - * Gets the {@link yfiles.styles.VoidStripeStyleRenderer#INSTANCE VoidStripeStyleRenderer instance}. - * @see yfiles.styles.IStripeStyle#renderer - * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidStripeStyle; - } - /** - * A void implementation of a stripe style renderer that does nothing. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidStripeStyleRenderer#INSTANCE} of - * this class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.IStripeStyle#renderer} property of an - * {@link yfiles.styles.IStripeStyle}. - *

- * @class - * @implements {yfiles.styles.IStripeStyleRenderer} - * @final - */ - export interface VoidStripeStyleRenderer extends yfiles.lang.Object,yfiles.styles.IStripeStyleRenderer{} - export class VoidStripeStyleRenderer { - /** - * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. - * @param stripe - * @param style - * @returns - */ - getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; - /** - * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. - * @param stripe - * @param style - * @returns - */ - getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; - /** - * The {@link yfiles.styles.VoidStripeStyleRenderer} singleton. - * @const - * @static - * @type {yfiles.styles.IStripeStyleRenderer} - */ - static INSTANCE:yfiles.styles.IStripeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidStripeStyleRenderer; - } - /** - * A stripe style decorator that uses a node style instance to render the stripe. - *

- * The renderer of the {@link yfiles.styles.NodeStyleStripeStyleAdapter#nodeStyle} used by this class must create {@link yfiles.view.SvgVisual}s. - *

- * @class - * @implements {yfiles.styles.IStripeStyle} - */ - export interface NodeStyleStripeStyleAdapter extends yfiles.lang.Object,yfiles.styles.IStripeStyle{} - export class NodeStyleStripeStyleAdapter { - /** - * Creates a stripe style that uses the provided node style to render the stripe. - *

- * Note that the styles will be stored by reference, thus modifying the style will directly affect the rendering of this - * instance. - *

- * @param nodeStyle The node style to use for rendering the stripe. - */ - constructor(nodeStyle:yfiles.styles.INodeStyle); - /** - * Initializes a new instance of the {@link yfiles.styles.NodeStyleStripeStyleAdapter} class. - *

- * This constructor uses an rectangular {@link yfiles.styles.ShapeNodeStyle} with a transparent brush and a black pen for the {@link yfiles.styles.NodeStyleStripeStyleAdapter#nodeStyle} - * property. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.INodeStyle} options.nodeStyle The {@link yfiles.styles.INodeStyle} that is used for rendering the stripe. - *

- * This option sets the {@link yfiles.styles.NodeStyleStripeStyleAdapter#nodeStyle} property on the created object. - *

- */ - constructor(options?:{nodeStyle?:yfiles.styles.INodeStyle}); - /** - * - * @returns - */ - clone():any; - /** - * - * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - /** - * Gets the {@link yfiles.styles.INodeStyle} that is used for rendering the stripe. - * @type {yfiles.styles.INodeStyle} - */ - nodeStyle:yfiles.styles.INodeStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.NodeStyleStripeStyleAdapter; - } - export enum TableRenderingOrder{ - /** - * Draw columns, then rows - */ - COLUMNS_FIRST, - /** - * Draw rows, then columns - */ - ROWS_FIRST - } - /** - * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.IStripeStyle}. - *

- * The only method that needs to be implemented by subclasses is {@link yfiles.styles.StripeStyleBase#createVisual}, however to - * improve rendering performance it is highly recommended to implement at least - * {@link yfiles.styles.StripeStyleBase#updateVisual}, too. - *

- *

- * This implementation differs from the straightforward {@link yfiles.styles.IStripeStyle} implementation in that there is no - * visible separation between the style and its - * {@link yfiles.styles.IStripeStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to - * the style instance. - *

- * @class - * @implements {yfiles.styles.IStripeStyle} - */ - export interface StripeStyleBase extends yfiles.lang.Object,yfiles.styles.IStripeStyle{} - export class StripeStyleBase { - /** - * Initializes a new instance of the {@link yfiles.styles.StripeStyleBase} class. - * @protected - */ - constructor(); - /** - * Creates a new object that is a copy of the current instance. - *

- * Immutable subclasses should consider returning this. - *

- * @returns A new object that is a copy of this instance using {@link #memberwiseClone}. - */ - clone():any; - /** - * Callback that creates the visual. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been - * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. - *

- * @param context - * @param stripe The stripe to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.StripeStyleBase#updateVisual - * @protected - * @abstract - */ - createVisual(context:yfiles.view.IRenderContext,stripe:yfiles.graph.IStripe):yfiles.view.Visual; - /** - * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.IStripeStyleRenderer#getContext} that has been - * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. - *

- * This implementation yields null for everything but: - *

- *
    - *
  • {@link yfiles.view.IVisualCreator}
  • - *
  • {@link yfiles.graph.ILookup}
  • - *
- *

- * For these interfaces an implementation will be returned that delegates to the methods in this instance. - *

- * @param stripe The stripe to use for the context lookup. - * @param type The type to query. - * @returns An implementation of the type or null. - * @protected - */ - lookup(stripe:yfiles.graph.IStripe,type:yfiles.lang.Class):any; - /** - * Callback that updates the visual previously created by {@link yfiles.styles.StripeStyleBase#createVisual}. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been - * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.StripeStyleBase#createVisual} so subclasses - * should override to improve rendering performance. - *

- * @param context - * @param oldVisual The visual that has been created in the call to {@link #createVisual}. - * @param stripe The stripe to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.StripeStyleBase#createVisual - * @protected - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,stripe:yfiles.graph.IStripe):yfiles.view.Visual; - /** - * Gets the renderer implementation for this instance. - *

- * The private implementation will delegate all API calls back to this instance. - *

- * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StripeStyleBase; - } - }export namespace binding{ - /** - * This class is an adapter that populates a {@link yfiles.binding.GraphBuilderBase#graph} from custom business data. - *

- * This class can be used when the business data specifies a collection of nodes and the edges are implicitly defined as - * collections of predecessors and successors of each node object. - *

- *

- * The nodes in the graph are determined using the {@link yfiles.binding.GraphBuilderBase#nodesSource}, {@link yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding} and {@link yfiles.binding.AdjacentNodesGraphBuilder#successorsBinding} properties. The predecessors and successors bindings define the - * direct neighbors of a node. Edges are automatically added between a node and its predecessors and successors. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is - * set, the {@link yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding} and {@link yfiles.binding.AdjacentNodesGraphBuilder#successorsBinding} should yield these IDs instead of the node business objects. - *

- *

- * The method {@link yfiles.binding.GraphBuilderBase#updateGraph} can be used to update the {@link yfiles.graph.IGraph} when the underlying - * collection of the business objects changed. In this case, the nodes specified by NodesSource are always present. All - * other nodes, that are the ones defined only in the predecessor or successor binding, persist only if they are reachable - * by a sequence of neighborhood bindings that originates at a node specified by NodesSource. Graph components that are no - * longer reachable by a sequence of neighborhood bindings from a node specified by NodesSource are completely removed from - * the graph. - *

- *

- * For assigning nodes to groups the {@link yfiles.binding.GraphBuilderBase#groupBinding} has to be defined. Group nodes can be nested using the {@link yfiles.binding.GraphBuilderBase#parentGroupBinding} property. - *

- *

- * The visual appearance of the graph constructed from the business objects can be configured using the {@link yfiles.graph.IGraph#nodeDefaults}, the {@link yfiles.graph.IGraph#groupNodeDefaults}, and the {@link yfiles.graph.IGraph#edgeDefaults} of - * the {@link yfiles.graph.IGraph}. - *

- * @class - * @extends {yfiles.binding.GraphBuilderBase} - */ - export interface AdjacentNodesGraphBuilder extends yfiles.binding.GraphBuilderBase{} - export class AdjacentNodesGraphBuilder { - /** - * Initializes a new instance of this class using the given graph. - *

- * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is called. - *

- * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Creates a new edge connecting the given nodes. - *

- * This class calls this method to create all new edges, and customers may override it to customize edge creation. - *

- * @param graph The graph. - * @param source The source node of the edge. - * @param target The target node of the edge. - * @returns The created edge. - * @protected - */ - createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode):yfiles.graph.IEdge; - /** - * Updates an existing edge connecting the given nodes when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the - * edge should remain in the graph. - * @param graph The graph. - * @param edge The edge to update. - * @param source The source node of the edge. - * @param target The target node of the edge. - * @protected - */ - updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,source:yfiles.graph.INode,target:yfiles.graph.INode):void; - /** - * Gets or sets the successors binding. - *

- * This binding maps a business object that represents a node to another business object o which specifies the successor - * nodes of this node. Similar to {@link yfiles.binding.GraphBuilderBase#nodesSource}, the object o can either be an array, an {@link yfiles.collections.IEnumerable.}, or a plain JavaScript object and should - * contain business objects that represent nodes. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, this collection should contain the IDs of the objects that - * specifies the nodes instead of the objects themselves. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding - * @type {any} - */ - successorsBinding:any; - /** - * Gets or sets the predecessors binding. - *

- * This binding maps a business object that represents a node to another business object o which specifies the predecessor - * nodes of this node. Similar to {@link yfiles.binding.GraphBuilderBase#nodesSource}, the object o can either be an array, an {@link yfiles.collections.IEnumerable.}, or a plain JavaScript object and should - * contain business objects that represent nodes. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, this collection should contain the IDs of the objects that - * specifies the nodes instead of the objects themselves. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.AdjacentNodesGraphBuilder#successorsBinding - * @type {any} - */ - predecessorsBinding:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.binding.AdjacentNodesGraphBuilder; - } - /** - * This class is an adapter that populates a {@link yfiles.binding.GraphBuilderBase#graph} from custom business data. - *

- * This class can be used when the business data specifies a collection of nodes, a collection of edges, and optionally, a - * collection of groups. The business data can be set using the {@link yfiles.binding.GraphBuilderBase#nodesSource}, {@link yfiles.binding.GraphBuilderBase#groupsSource} and {@link yfiles.binding.GraphBuilder#edgesSource} properties. - *

- *

- * To determine the source and target of an edge, the {@link yfiles.binding.GraphBuilder#sourceNodeBinding} and the {@link yfiles.binding.GraphBuilder#targetNodeBinding} need to be set for business objects that are the source for - * edges. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, the {@link yfiles.binding.GraphBuilder#sourceNodeBinding} and {@link yfiles.binding.GraphBuilder#targetNodeBinding} should yield these IDs instead of the node business objects. - *

- *

- * For assigning nodes to groups the {@link yfiles.binding.GraphBuilderBase#groupBinding} has to be defined. Group nodes can be nested using the {@link yfiles.binding.GraphBuilderBase#parentGroupBinding} property. Labels for the - * edges can be defined by setting a suitable {@link yfiles.binding.GraphBuilder#edgeLabelBinding}. - *

- *

- * The visual appearance of the graph constructed from the business objects can be configured using the {@link yfiles.graph.IGraph#nodeDefaults}, the {@link yfiles.graph.IGraph#groupNodeDefaults}, and the {@link yfiles.graph.IGraph#edgeDefaults} of - * the {@link yfiles.graph.IGraph}. - *

- * @class - * @extends {yfiles.binding.GraphBuilderBase} - */ - export interface GraphBuilder extends yfiles.binding.GraphBuilderBase{} - export class GraphBuilder { - /** - * Initializes a new instance of this class using the given graph. - *

- * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} and {@link yfiles.binding.GraphBuilder#edgesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is - * called. - *

- * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Creates a new edge connecting the given nodes and assigns the businessObjectparameter to the edge's {@link yfiles.graph.ITagOwner#tag Tag} property. - *

- * This class calls this method to create all new edges, and customers may override it to customize edge creation. - *

- * @param graph The graph. - * @param source The source node of the edge. - * @param target The target node of the edge. - * @param labelData The optional label data of the edge if an {@link #edgeLabelBinding} is specified. - * @param businessObject The business data associated with the edge. - * @returns The created edge. - * @protected - */ - createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:any,businessObject:any):yfiles.graph.IEdge; - /** - * Retrieves the associated edge in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilder#edgesSource}. - * @param businessObject A business object from the {@link #edgesSource} to get the edge for. - * @returns The edge associated with the business object or null for unknown objects. - * @see yfiles.binding.GraphBuilderBase#getBusinessObject - * @see yfiles.binding.GraphBuilderBase#getNode - * @see yfiles.binding.GraphBuilderBase#getGroup - */ - getEdge(businessObject:any):yfiles.graph.IEdge; - /** - * Updates an existing edge when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the edge should remain in the - * graph. - * @param graph The graph. - * @param edge The edge to update. - * @param labelData The optional label data of the edge if an {@link #edgeLabelBinding} is specified. - * @param businessObject The business data associated with the edge. - * @protected - */ - updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,labelData:any,businessObject:any):void; - /** - * Gets or sets a value indicating whether or not the source and target bindings must yield business objects that are - * contained in {@link yfiles.binding.GraphBuilderBase#nodesSource}. - *

- * If this property is set to false, an edge is created if and only if its source and target bindings yield a business - * object that is contained in {@link yfiles.binding.GraphBuilderBase#nodesSource}. Otherwise, if this property is true, an edge is created for each item of {@link yfiles.binding.GraphBuilder#edgesSource} and nodes are - * created for the source and target as needed. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.GraphBuilder#edgesSource - * @type {boolean} - */ - lazyNodeDefinition:boolean; - /** - * Get or set the business objects to be represented as edges of the {@link yfiles.binding.GraphBuilderBase#graph}. - *

- * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as - * edges. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the graph edges. - *

- * @type {any} - */ - edgesSource:any; - /** - * Gets or sets the mandatory source node binding. - *

- * This binding maps a business object e that represents an edge to another business object n which represents a node. This - * node will become the source node of the edge. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, the object n should be the ID of the object that specifies - * the node instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.GraphBuilder#targetNodeBinding - * @see yfiles.binding.GraphBuilder#edgesSource - * @type {any} - */ - sourceNodeBinding:any; - /** - * Gets or sets the mandatory target node binding. - *

- * This binding maps a business object e that represents an edge to another business object n which represents a node. This - * node will become the target node of the edge. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, the object n should be the ID of the object that specifies - * the node instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.GraphBuilder#sourceNodeBinding - * @see yfiles.binding.GraphBuilder#edgesSource - * @type {any} - */ - targetNodeBinding:any; - /** - * Gets or sets the edge label binding. - *

- * This binding maps a business object that represents an edge to an object that specifies the label data of that edge. By - * default, the label data object must be convertible into a string. This can be customized by overriding {@link yfiles.binding.GraphBuilder#createEdge} - * and {@link yfiles.binding.GraphBuilder#updateEdge}. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilder#edgesSource - * @type {any} - */ - edgeLabelBinding:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.binding.GraphBuilder; - } - /** - * Base class for adapters that populate a {@link yfiles.binding.GraphBuilderBase#graph} from custom business data. - *

- * Customers should not create own implementations based on this class but use one of the ready-made adapters {@link yfiles.binding.GraphBuilder} - * or {@link yfiles.binding.AdjacentNodesGraphBuilder}. - *

- * @class - */ - export interface GraphBuilderBase extends yfiles.lang.Object{} - export class GraphBuilderBase { - /** - * Initializes a new instance of this class using the given graph. - *

- * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is called. - *

- * @param graph - * @protected - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Populates the graph instance with items generated from the bound business data. - *

- * First, this method clears the graph, and then it adds new groups, nodes, and edges as specified by the business data and - * bindings. - *

- * @returns The created graph. - * @see yfiles.binding.GraphBuilderBase#updateGraph - */ - buildGraph():yfiles.graph.IGraph; - /** - * Creates a new group node and assigns the businessObjectparameter to the group node's {@link yfiles.graph.ITagOwner#tag Tag} property. - * @param graph The graph. - * @param businessObject The business data associated with the group node. - * @returns The created node. - * @protected - */ - createGroupNode(graph:yfiles.graph.IGraph,businessObject:any):yfiles.graph.INode; - /** - * Creates a new node with the specified parent and assigns the businessObjectparameter to the node's {@link yfiles.graph.ITagOwner#tag Tag} property. - *

- * This class calls this method to create all new nodes, and customers may override it to customize node creation. - *

- * @param graph The graph. - * @param parent The node's parent node. - * @param location The location of the node. - * @param labelData The optional label data of the node if an {@link #nodeLabelBinding} is specified. - * @param businessObject The business data associated with the node. - * @returns The created node. - * @protected - */ - createNode(graph:yfiles.graph.IGraph,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:any,businessObject:any):yfiles.graph.INode; - /** - * Retrieves the associated business object for a given {@link yfiles.graph.IModelItem graph item} from the {@link yfiles.binding.GraphBuilderBase#graph}. - * @param item The item of the graph to get the business object for. - * @returns The business object associated with the graph item. - * @see yfiles.binding.GraphBuilderBase#getNode - * @see yfiles.binding.GraphBuilderBase#getGroup - */ - getBusinessObject(item:yfiles.graph.IModelItem):any; - /** - * Retrieves the associated group node in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilderBase#groupsSource}. - * @param businessObject A business object from the {@link #groupsSource} to get the group for. - * @returns The group associated with the business object or null for unknown objects. - * @see yfiles.binding.GraphBuilderBase#getBusinessObject - * @see yfiles.binding.GraphBuilderBase#getNode - */ - getGroup(businessObject:any):yfiles.graph.INode; - /** - * Retrieves the associated node in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilderBase#nodesSource}. - * @param businessObject A business object from the {@link #nodesSource} to get the node for. - * @returns The node associated with the business object or null for unknown objects. - * @see yfiles.binding.GraphBuilderBase#getBusinessObject - * @see yfiles.binding.GraphBuilderBase#getGroup - */ - getNode(businessObject:any):yfiles.graph.INode; - /** - * Updates the graph instance to fit the bound business data. - *

- * This method can be used to update the graph to fit changed business data. In contrast to - * {@link yfiles.binding.GraphBuilderBase#buildGraph}, it does not initially clear the graph. Instead, it keeps graph elements that - * for business objects are still present in the data, creates new elements for new data, and removes obsolete elements. - *

- */ - updateGraph():void; - /** - * Updates an existing group node when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the group should remain in - * the graph. - *

- * This class calls this method to create all new groups, and customers may override it to customize group creation. - *

- * @param graph The graph. - * @param groupNode The group node to update. - * @param businessObject The business data associated with the group node. - * @protected - */ - updateGroupNode(graph:yfiles.graph.IGraph,groupNode:yfiles.graph.INode,businessObject:any):void; - /** - * Updates an existing node when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the node should remain in the - * graph. - * @param graph The graph. - * @param node The node to update. - * @param parent The node's parent node. - * @param location The location of the node. - * @param labelData The optional label data of the node if an {@link #nodeLabelBinding} is specified. - * @param businessObject The business data associated with the node. - * @protected - */ - updateNode(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:any,businessObject:any):void; - /** - * Returns the {@link yfiles.graph.IGraph graph} used by this class. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets or sets the business objects to be represented as nodes of the {@link yfiles.binding.GraphBuilderBase#graph}. - *

- * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as - * nodes. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the graph nodes. - *

- * @type {any} - */ - nodesSource:any; - /** - * Gets or sets the business objects to be represented as group nodes of the {@link yfiles.binding.GraphBuilderBase#graph}. - *

- * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as group - * nodes. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the graph nodes. - *

- * @type {any} - */ - groupsSource:any; - /** - * Gets or sets the node ID binding. - *

- * This binding maps a business object that represents a node to its ID. If this binding is set, node IDs can be used in a - * business object that represents an edge to identify the source node and target node of the corresponding edge. The - * binding should not be changed once the graph is built. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - nodeIdBinding:any; - /** - * Gets or sets the node label binding. - *

- * This binding maps a business object that represents a node to an object that specifies the label data of that node. - *

- *

- * By default, the label data object must be convertible into a string. This can be customized by overriding {@link yfiles.binding.GraphBuilderBase#createNode} - * and {@link yfiles.binding.GraphBuilderBase#updateNode}. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - nodeLabelBinding:any; - /** - * Gets or sets the group node ID binding. - *

- * This binding maps a business object that represents a group to its ID. If this binding is set, group IDs can be used in - * a business object that represents a node to identify the parent group of the corresponding node. The binding should not - * be changed once the graph is built. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. Functions will be called with both this and the first and only argument as the value to convert. - *

- * @see yfiles.binding.GraphBuilderBase#groupsSource - * @type {any} - */ - groupIdBinding:any; - /** - * Gets or sets the group binding. - *

- * This binding maps a business object o1 that represents a group to another object o2 that specifies the parent group of - * o1. If o2 is contained in {@link yfiles.binding.GraphBuilderBase#groupsSource}, then the node for o1 becomes a child node of the group for o2. - *

- *

- * If a {@link yfiles.binding.GraphBuilderBase#groupIdBinding} is set, to object o2 should be the ID of the object that specifies the group instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - groupBinding:any; - /** - * Gets or sets the parent group binding. - *

- * This binding maps a business object o1 that represents a group to another object o2 that specifies the parent group of - * o1. If o2 is contained in {@link yfiles.binding.GraphBuilderBase#groupsSource}, then the group for o1 becomes a child node of the group for o2. - *

- *

- * If a {@link yfiles.binding.GraphBuilderBase#groupIdBinding} is set, to object o2 should be the ID of the object that specifies the group instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @type {any} - */ - parentGroupBinding:any; - /** - * Gets or sets the binding for determining a node's position on the x-axis. - *

- * This binding maps a business object that represents a node to a number that specifies the x-coordinate of that node. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - locationXBinding:any; - /** - * Gets or sets the binding for determining a node's position on the y-axis. - *

- * This binding maps a business object that represents a node to a number that specifies the y-coordinate of that node. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - locationYBinding:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.binding.GraphBuilderBase; - } - /** - * This class is an adapter which populates a {@link yfiles.binding.TreeBuilder#graph} from hierarchical business data. - *

- * The nodes in the tree are determined using the {@link yfiles.binding.TreeBuilder#nodesSource} and {@link yfiles.binding.TreeBuilder#childBinding} properties. Optionally, a collection of group nodes can be - * specified with {@link yfiles.binding.TreeBuilder#groupsSource}. - *

- *

- * Graph items will be visualized using the styles defined in the {@link yfiles.graph.IGraph#nodeDefaults}, {@link yfiles.graph.IGraph#edgeDefaults} and {@link yfiles.graph.IGraph#groupNodeDefaults} property of the {@link yfiles.binding.TreeBuilder#graph}. - *

- *

- * The created {@link yfiles.binding.TreeBuilder#graph} is a directed forest, a set of directed trees. Each directed tree has exactly one root node with no - * incoming edges. For every other node v in a directed tree there is exactly one directed path from the root node of the - * directed tree to node v. - *

- *

- * To assign nodes to groups the {@link yfiles.binding.GraphBuilderBase#groupBinding} has to be defined. Group nodes can be nested using the {@link yfiles.binding.GraphBuilderBase#parentGroupBinding} property. Labels for the edges - * can be defined by setting a suitable {@link yfiles.binding.TreeBuilder#edgeLabelBinding}, which is resolved on the target (child) node. - *

- *

- * This class can be used to {@link yfiles.binding.TreeBuilder#updateGraph update} the {@link yfiles.binding.TreeBuilder#graph} when the underlying collection of the business objects ({@link yfiles.binding.TreeBuilder#nodesSource} and {@link yfiles.binding.TreeBuilder#childBinding}) changes. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @see yfiles.binding.TreeBuilder#childBinding - * @class - */ - export interface TreeBuilder extends yfiles.lang.Object{} - export class TreeBuilder { - /** - * Creates a new empty instance using the given graph. - *

- * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.TreeBuilder#nodesSource} when {@link yfiles.binding.TreeBuilder#buildGraph} is called. The {@link yfiles.binding.TreeBuilder#childBinding} - * needs to be set in order to actually create a tree. - *

- * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Populates the graph instance with items generated from the bound business data. - *

- * First, this method clears the graph, and then it adds new groups, nodes, and edges as specified by the business data and - * bindings. - *

- * @returns The created graph. - * @see yfiles.binding.TreeBuilder#updateGraph - */ - buildGraph():yfiles.graph.IGraph; - /** - * Creates an edge between the source and target node. - * @param graph The graph. - * @param source The source node of the edge. - * @param target The target node of the edge. - * @param labelData The optional label data of the edge if an {@link #edgeLabelBinding} is specified. - * @returns The created edge. - * @protected - */ - createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:any):yfiles.graph.IEdge; - /** - * Creates a new group node and assigns the businessObjectparameter to the group node's {@link yfiles.graph.ITagOwner#tag Tag} property. - * @param graph The graph. - * @param businessObject The business data associated with the group node. - * @returns The created node. - * @protected - */ - createGroupNode(graph:yfiles.graph.IGraph,businessObject:any):yfiles.graph.INode; - /** - * Creates a node with the specified parent and assigns the businessObject parameter to the node's {@link yfiles.graph.ITagOwner#tag Tag} property. - * @param graph The graph. - * @param parent The node's parent node. - * @param location The location of the node. - * @param labelData The optional label data of the node if an {@link #nodeLabelBinding} is specified. - * @param businessObject The business data associated with the node. - * @returns The created node. - * @protected - */ - createNode(graph:yfiles.graph.IGraph,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:any,businessObject:any):yfiles.graph.INode; - /** - * Retrieves the associated business object for a given {@link yfiles.graph.INode node} from the {@link yfiles.binding.TreeBuilder#graph}. - * @param item The node of the graph to get the business object for. - * @returns The business object associated with the graph element. - * @see yfiles.binding.TreeBuilder#getNode - */ - getBusinessObject(item:yfiles.graph.IModelItem):any; - /** - * Retrieves the associated node in the {@link yfiles.binding.TreeBuilder#graph} for a business object from the {@link yfiles.binding.TreeBuilder#nodesSource}. - * @param businessObject A business object from the {@link #nodesSource} to get the node for. - * @returns The node associated with the business object or null for unknown objects. - * @see yfiles.binding.TreeBuilder#getBusinessObject - */ - getNode(businessObject:any):yfiles.graph.INode; - /** - * Updates an edge with the given data. - * @param graph The graph. - * @param edge The edge to update. - * @param source The edge's source node. - * @param target The edge's target node. - * @param labelData The business data associated with the edge. - * @protected - */ - updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:any):void; - /** - * Updates the graph instance to fit the bound business data. - *

- * This method can be used to update the graph to fit changed business data. In contrast to - * {@link yfiles.binding.TreeBuilder#buildGraph}, it does not initially clear the graph. Instead, it keeps graph elements that for - * business objects are still present in the data, creates new elements for new data, and removes obsolete elements. - *

- */ - updateGraph():void; - /** - * Updates an existing group node when {@link yfiles.binding.TreeBuilder#updateGraph} is called and the group should remain in the - * graph. - *

- * This class calls this method to create all new groups, and customers may override it to customize group creation. - *

- * @param graph The graph. - * @param groupNode The group node to update. - * @param businessObject The business data associated with the group node. - * @protected - */ - updateGroupNode(graph:yfiles.graph.IGraph,groupNode:yfiles.graph.INode,businessObject:any):void; - /** - * Updates a node with the given data. - * @param graph The graph. - * @param node The node to update. - * @param parent The node's parent node. - * @param location The location of the node. - * @param labelData The optional label data of the edge if an {@link #nodeLabelBinding} is specified. - * @param businessObject The business data associated with the node. - * @protected - */ - updateNode(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:any,businessObject:any):void; - /** - * Returns the {@link yfiles.graph.IGraph graph} used by this instance. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets or sets the business objects to be represented as nodes. - *

- * This can either be an array of objects, a plain JavaScript object, or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as - * nodes - *

- *

- * Note that it is not necessary to include all nodes in this property, if they can be reached via the - * {@link yfiles.binding.TreeBuilder#childBinding}. In this case it suffices to include all root nodes. - *

- *

- * If the nodes source contains more than just the root nodes, some node sources are visited more than once during the - * construction of the - * {@link yfiles.binding.TreeBuilder#graph}. In order to avoid duplicate nodes, the tree source keeps track of node sources for which nodes have already been - * constructed. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the tree nodes. - *

- * @type {any} - */ - nodesSource:any; - /** - * Gets or sets the business objects to be represented as group nodes of the {@link yfiles.binding.TreeBuilder#graph}. - *

- * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as group - * nodes. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the graph nodes. - *

- * @type {any} - */ - groupsSource:any; - /** - * Gets or sets the binding for the children of a node. - *

- * This binding maps a business object that represents a node to another business object o which specifies the children of - * this node. Similar to {@link yfiles.binding.GraphBuilderBase#nodesSource}, the object o can either be an array, an {@link yfiles.collections.IEnumerable.}, or a plain JavaScript object and should contain - * business objects that represent nodes. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, these collection should contain the IDs of the objects that - * specifies the nodes instead of the objects themselves. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - childBinding:any; - /** - * Gets or sets the node ID binding. - *

- * This binding maps a business object that represents a node to its ID. If this binding is set, node IDs can be used in a - * business object that represents an edge to identify the source node and target node of the corresponding edge. The - * binding should not be changed once the graph is built. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - idBinding:any; - /** - * Gets or sets the edge label binding. - *

- * This binding maps a business object that represents a node to an object that specifies the label data of the incoming - * edge of that node. By default, the label data object must be convertible into a string. This can be customized by - * overriding {@link yfiles.binding.TreeBuilder#createEdge} and {@link yfiles.binding.TreeBuilder#updateEdge}. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @type {any} - */ - edgeLabelBinding:any; - /** - * Gets or sets the node label binding. - *

- * This binding maps a business object that represents a node to an object that specifies the label data of that node. - *

- *

- * By default, the label data object must be convertible into a string. This can be customized by overriding {@link yfiles.binding.TreeBuilder#createNode} - * and {@link yfiles.binding.TreeBuilder#updateNode}. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - nodeLabelBinding:any; - /** - * Gets or sets the binding for determining a node's position on the x-axis. - *

- * This binding maps a business object that represents a node to a number that specifies the x-coordinate of that node. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - locationXBinding:any; - /** - * Gets or sets the binding for determining a node's position on the y-axis. - *

- * This binding maps a business object that represents a node to a number that specifies the y-coordinate of that node. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - locationYBinding:any; - /** - * Gets or sets the group node ID binding. - *

- * This binding maps a business object that represents a group to its ID. If this binding is set, group IDs can be used in - * a business object that represents a node to identify the parent group of the corresponding node. The binding should not - * be changed once the graph is built. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#groupsSource - * @type {any} - */ - groupIdBinding:any; - /** - * Gets or sets the group binding. - *

- * This binding maps a business object o1 that represents a group to another object o2 that specifies the parent group of - * o1. If o2 is contained in {@link yfiles.binding.TreeBuilder#groupsSource}, then the node for o1 becomes a child node of the group for o2. - *

- *

- * If a {@link yfiles.binding.TreeBuilder#groupIdBinding} is set, to object o2 should be the ID of the object that specifies the group instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - groupBinding:any; - /** - * Gets or sets the parent group binding. - *

- * This binding maps a business object o1 that represents a group to another object o2 that specifies the parent group of - * o1. If o2 is contained in {@link yfiles.binding.TreeBuilder#groupsSource}, then the group for o1 becomes a child node of the group for o2. - *

- *

- * If a {@link yfiles.binding.TreeBuilder#groupIdBinding} is set, to object o2 should be the ID of the object that specifies the group instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @type {any} - */ - parentGroupBinding:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.binding.TreeBuilder; - } - }export namespace algorithms{ - /** - * This class provides a means for early termination of graph algorithms. - *

- * Instances of this class may be attached to and retrieved from a graph and may receive requests for stopping and - * canceling an algorithm that is currently executed on the given graph. - *

- *

- * Client Code Usage - *

- *

- * An instance of this class can be attached to a graph using method {@link yfiles.algorithms.AbortHandler#createForGraph}. The - * handler's {@link yfiles.algorithms.AbortHandler#stopDuration} and {@link yfiles.algorithms.AbortHandler#cancelDuration} methods can be used to automatically stop or cancel an algorithm after a specified period of time has - * elapsed. Algorithms can check for these requests and handle them appropriately. - *

- *
    - *
  • - * Stop – The algorithm should terminate gracefully, delivering a consistent result. Although the termination will be early, it - * will usually not be immediate. - *
  • - *
  • Cancel – The algorithm should terminate immediately and all work done so far will be discarded.
  • - *
- *

- * If a graph with an attached handler is processed by multiple algorithms (or multiple times by the same algorithm), the - * attached handler has to be {@link yfiles.algorithms.AbortHandler#reset} between algorithm runs. Otherwise, previous requests for - * early termination may lead to an undesired early termination of the next algorithm run. - *

- *

- * Usage in Algorithms - *

- *

- * Algorithms have to retrieve an instance of this class from the graph that is processed using method - * {@link yfiles.algorithms.AbortHandler#getFromGraph}. Then, the algorithm needs to query the retrieved instance of this class for - * stop or cancel requests using method {@link yfiles.algorithms.AbortHandler#check}. - *

- *

- * Alternatively, convenience method {@link yfiles.algorithms.AbortHandler#check} for one-time checks is available. For performance - * critical code that checks repeatedly, it is recommended to follow the first approach, though. - *

- *

- * When handling a stop request, algorithms should ensure that the resulting graph is still in a consistent state. - *

- * @class - */ - export interface AbortHandler extends yfiles.lang.Object{} - export class AbortHandler { - /** - * Creates a new {@link yfiles.algorithms.AbortHandler} instance. - * @see yfiles.algorithms.AbortHandler#stopDuration - * @see yfiles.algorithms.AbortHandler#cancelDuration - * @see yfiles.algorithms.AbortHandler#reset - */ - constructor(); - /** - * Determines whether or not an algorithm should terminate immediately. - *

- * This method returns true if the algorithm should terminate gracefully and ensures that the processed graph remains in a - * consistent state. - *

- * @returns true, if the algorithm should terminate immediately, false otherwise - * @throws {yfiles.algorithms.AlgorithmAbortedError} if the algorithm should terminate immediately - * @see yfiles.algorithms.AbortHandler#stop - */ - check():boolean; - /** - * Determines whether or not an algorithm should terminate immediately. - *

- * This method returns true if the algorithm should terminate gracefully and ensures that the processed graph remains in a - * consistent state. - *

- *

- * This convenience method is meant for one-time checks only. For performance critical code that needs to check repeatedly, - * it is recommended to retrieve the given graph's attached handler once and only call the handler's {@link yfiles.algorithms.AbortHandler#check} - * method repeatedly. - *

- * @param graph - * @returns true, if the algorithm should stop immediately while still providing some valid result, false otherwise - * @throws {yfiles.algorithms.AlgorithmAbortedError} if the algorithm should terminate immediately - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null - * @see yfiles.algorithms.AbortHandler#check - * @see yfiles.algorithms.AbortHandler#stop - * @static - */ - static check(graph:yfiles.algorithms.Graph):boolean; - /** - * Attaches the {@link yfiles.algorithms.AbortHandler} instance of the given source graph to the target graph as well. - * @param source the graph whose handler is attached to the target graph - * @param target the graph to which the handler of the source graph is attached - * @throws {Stubs.Exceptions.ArgumentError} if the given source is null - * @static - */ - static copyHandler(source:yfiles.algorithms.Graph,target:yfiles.algorithms.Graph):void; - /** - * Creates an {@link yfiles.algorithms.AbortHandler handler} instance and attaches it to the given graph. - *

- * If the given graph has already an attached handler instance, this is the instance that will be returned and this method - * will not create a new {@link yfiles.algorithms.AbortHandler}. - *

- *

- * This method should be called by client code prior to starting a graph algorithm that may be terminated early. - *

- * @param graph the graph to which the handler will be attached - * @returns the {@link } instance for the given graph - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null. - * @see yfiles.algorithms.AbortHandler#hasHandler - * @static - */ - static createForGraph(graph:yfiles.algorithms.Graph):yfiles.algorithms.AbortHandler; - /** - * Returns an {@link yfiles.algorithms.AbortHandler} instance for the given graph. - *

- * If {@link yfiles.algorithms.AbortHandler#createForGraph} has been used for attaching a new handler to the given graph, this is - * the instance that will be returned. Otherwise, a non-functional instance is returned whose methods do nothing. Use {@link yfiles.algorithms.AbortHandler#hasHandler} - * to check whether or not a handler has been already attached to the given graph. - *

- * @param graph the given graph - * @returns an {@link } for the given graph or a non-functional instance if no handler has been previously - * created - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null - * @see yfiles.algorithms.AbortHandler#createForGraph - * @see yfiles.algorithms.AbortHandler#hasHandler - * @static - */ - static getFromGraph(graph:yfiles.algorithms.Graph):yfiles.algorithms.AbortHandler; - /** - * Determines whether or not an {@link yfiles.algorithms.AbortHandler} instance is attached to the given graph. - * @param graph the given graph - * @returns true if a handler is attached to the given graph, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null - * @static - */ - static hasHandler(graph:yfiles.algorithms.Graph):boolean; - /** - * Removes any attached {@link yfiles.algorithms.AbortHandler} instance from the given graph. - * @param graph the given graph - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null. - * @static - */ - static removeFromGraph(graph:yfiles.algorithms.Graph):void; - /** - * Resets the state of the {@link yfiles.algorithms.AbortHandler handler}. - *

- * Resetting the {@link yfiles.algorithms.AbortHandler handler} discards any previous stop or cancel requests. Moreover, the handler's internal timestamp that is - * used for determining whether or not an algorithm should be stopped or cancelled automatically is reset as well. - *

- *

- * This method should be called whenever a graph with an attached handler is processed an additional time to prevent - * previous requests for early termination to result in an undesired early termination of the next algorithm run. - *

- * @see yfiles.algorithms.AbortHandler#cancelDuration - * @see yfiles.algorithms.AbortHandler#stopDuration - */ - reset():void; - /** - * Schedules a stop request. - *

- * Algorithms that detect stop requests should terminate gracefully and ensure that the processed graph remains in a - * consistent state. - *

- *

- * If a Cancel request has already been scheduled for this handler, the stop request is ignored. If a Cancel request is - * scheduled later on, the stop request is overridden. - *

- * @see yfiles.algorithms.AbortHandler#check - * @see yfiles.algorithms.AbortHandler#cancelDuration - */ - stop():void; - /** - * Determines the remaining time (in milliseconds) until an algorithm that {@link yfiles.algorithms.AbortHandler#check checks} this handler is cancelled automatically. - * @returns the remaining time until the algorithm is cancelled automatically. - * @see yfiles.algorithms.AbortHandler#cancelDuration - * @see yfiles.algorithms.AbortHandler#reset - * @see yfiles.algorithms.AbortHandler#cancelDuration - */ - timeToCancel():yfiles.lang.TimeSpan; - /** - * Determines the remaining time until an algorithm that {@link yfiles.algorithms.AbortHandler#check checks} this handler is stopped automatically. - *

- * If the {@link yfiles.algorithms.AbortHandler#stopDuration stop duration} is less than or equal to zero, -1 will be returned which means that the algorithm may run - * unrestricted. - *

- * @returns the remaining time until the algorithm is stopped automatically or -1 if the algorithm may run unrestricted - * @see yfiles.algorithms.AbortHandler#stopDuration - * @see yfiles.algorithms.AbortHandler#reset - * @see yfiles.algorithms.AbortHandler#stop - */ - timeToStop():yfiles.lang.TimeSpan; - /** - * Data provider key for attaching an AbortHandler instance to a graph - *

- * Only instances of {@link yfiles.algorithms.AbortHandler} should be assigned to this {@link yfiles.algorithms.IDataProvider}, otherwise a - * {@link yfiles.lang.Exception} will occur. Layout algorithms will use the attached handler to check for requests to cancel or - * stop the layout process. - *

- * @const - * @static - * @type {yfiles.algorithms.GraphDpKey.} - */ - static ABORT_HANDLER_DP_KEY:yfiles.algorithms.GraphDpKey; - /** - * Returns whether or not a stop request was scheduled explicitly with the {@link yfiles.algorithms.AbortHandler#stop} method. - * @type {boolean} - */ - stopRequested:boolean; - /** - * Gets or sets the duration an algorithm may run before being stopped automatically. - *

- * An algorithm is terminated gracefully, if the time in between {@link yfiles.algorithms.AbortHandler creating} or {@link yfiles.algorithms.AbortHandler#reset resetting} this handler and calling {@link yfiles.algorithms.AbortHandler#check} - * exceeds the stop duration. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the duration is negative - * @see yfiles.algorithms.AbortHandler#timeToStop - * @see yfiles.algorithms.AbortHandler#reset - * @see yfiles.algorithms.AbortHandler#stop - * @type {yfiles.lang.TimeSpan} - */ - stopDuration:yfiles.lang.TimeSpan; - /** - * Gets or sets the duration an algorithm may run before being cancelled automatically. - *

- * An algorithm is terminated immediately, if the time in between {@link yfiles.algorithms.AbortHandler creating} or {@link yfiles.algorithms.AbortHandler#reset resetting} this handler and calling {@link yfiles.algorithms.AbortHandler#check} - * exceeds the cancel duration. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the duration is negative - * @see yfiles.algorithms.AbortHandler#reset - * @see yfiles.algorithms.AbortHandler#cancelDuration - * @type {yfiles.lang.TimeSpan} - */ - cancelDuration:yfiles.lang.TimeSpan; - /** - * Gets whether or not methods {@link yfiles.algorithms.AbortHandler#check} or {@link yfiles.algorithms.AbortHandler#check} were called - * after a stop or cancel event. - *

- * More precisely, it returns true if one of the check methods either threw an {@link yfiles.lang.Exception} or returned true to - * indicate that the calling algorithm should terminate gracefully. Otherwise, this method returns false. - *

- * @see yfiles.algorithms.AbortHandler#check - * @see yfiles.algorithms.AbortHandler#check - * @type {boolean} - */ - checkFailed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.AbortHandler; - } - /** - * This class provides services that center around breadth first search (BFS). - *

- * Breadth first search starts at a given set of nodes and explores the neighboring nodes first, before visiting the next - * level neighbors. - *

- *

- * A breadth first search run can be either directed or undirected. All methods require a list of nodes that are considered - * as the core nodes from which the breadth first search starts. These nodes can be identified either with a {@link yfiles.algorithms.NodeList} - * or with a {@link yfiles.algorithms.IDataProvider} that returns true for core nodes and false for all other nodes. The output is - * given as an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[-35,-35,1,[[-25.34,-10.65,10.67,18.7,"0"]]],[-35,85,[[-25.34,109.35,10.67,18.7,"1"]]],[85,-35,[[94.66,-10.65,10.67,18.7,"1"]]],[85,85,[[94.66,109.35,10.67,18.7,"2"]]],[205,-35,[[214.66,-10.65,10.67,18.7,"3"]]],[205,85,[[214.66,109.35,10.67,18.7,"4"]]]],"e":[[4,3],[2,0],[0,1],[1,3],[2,3],[4,5]],"vp":[-35.0,-35.0,270.0,150.0]}} Example for a BFS run. The marked node is the core node from which BFS starts while node labels indicate the resulting - * layers. - *

- * @class - * @static - */ - export interface Bfs extends yfiles.lang.Object{} - export class Bfs { - /** - * Returns the layers of nodes constructed by a directed/undirected breadth first search where the maximum number of layers - * is restricted. - *

- * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes - * from which a breadth first search to the other nodes starts. The algorithm fills the provided {@link yfiles.algorithms.INodeMap} - * with an integer indicating the layer of each node. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param coreNodes the list of core nodes - * @param direction one of the predefined direction specifiers - * @param layerIDMap the {@link } that will be filled during the BFS execution and holds the zero-based index of the BFS - * layer to which each node belongs or -1 if the node is not reachable - * @param [maxLayers=0] the number of layers that will be returned or 0 if all layers are required - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @throws {Stubs.Exceptions.ArgumentError} if the given direction is not supported - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,direction:yfiles.algorithms.BfsDirection,layerIDMap:yfiles.algorithms.INodeMap,maxLayers?:number):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes constructed by a directed/undirected breadth first search where the maximum number of layers - * is restricted. - *

- * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes - * from which either a directed or undirected breadth first search to the other nodes starts. The algorithm fills the - * provided {@link yfiles.algorithms.INodeMap} with an integer indicating the layer of each node. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param coreNodes the list of core nodes from which the BFS starts - * @param directed true if the graph should be considered directed, false otherwise - * @param layerIDMap the {@link } that will be filled during the BFS execution and holds the zero-based index of the BFS - * layer to which each node belongs or -1 if the node is not reachable - * @param [maxLayers=0] the number of layers that will be returned or 0 if all layers are required - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,directed:boolean,layerIDMap:yfiles.algorithms.INodeMap,maxLayers?:number):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes constructed by a breadth first search. - *

- * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes - * from which an undirected breadth first search to the other nodes starts. The algorithm fills the provided {@link yfiles.algorithms.INodeMap} - * with an integer indicating the layer of each node. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param coreNodes the list of core nodes from which the BFS starts - * @param layerIDMap the {@link } that will be filled during the BFS execution and holds the zero-based index of the BFS - * layer to which each node belongs or -1 if the node is not reachable - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes constructed by a breadth first search. - *

- * The first of these layers contains all nodes for which the given {@link yfiles.algorithms.IDataProvider} returns true. These - * nodes are the core nodes from which an undirected breadth first search to the other nodes starts. The algorithm fills - * the provided {@link yfiles.algorithms.INodeMap} with an integer indicating the layer of each node. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param isCoreNode the {@link } that contains the nodes from which the BFS starts; core nodes are marked with a true - * value - * @param layerIDMap the {@link } that will be filled during the BFS execution and holds the zero-based index of the BFS - * layer to which each node belongs or -1 if the node is not reachable - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,isCoreNode:yfiles.algorithms.IDataProvider,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes calculated by a breadth first search. - *

- * The first of these layers contains all nodes within the given - * {@link yfiles.algorithms.NodeList}. These nodes are the core nodes from which an undirected breadth first search to the other - * nodes starts. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param coreNodes the list of core nodes from which the BFS starts - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes constructed by a breadth first search. - *

- * The first of these layers contains all nodes for which the given {@link yfiles.algorithms.IDataProvider} returns - * true. These nodes are the core nodes from which an undirected breadth first search to the other nodes starts. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param isCoreNode the {@link } that contains the nodes from which the BFS starts; core nodes are marked with a true - * value - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,isCoreNode:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Bfs; - } - /** - * This class provides methods to determine whether a graph is bipartite and to obtain the corresponding partitions. - *

- * A bipartite graph is a graph whose nodes can be partitioned into two sets such that each edges connects two nodes of different - * sets. In other words, there are no edges connecting nodes that belong to the same partition. - *

- *

- * The two sets/partitions are represented by two {@link any} constants i.e., {@link yfiles.algorithms.Bipartitions#RED} or - * {@link yfiles.algorithms.Bipartitions#BLUE}. - *

- *

- * {@graph {"ann":{"s":[40,40],"d":0, "b":0},"styles":{"6":{"c":1, "b":0}},"n":[[365,205,6],[365,305,6],[365,405,6],[505,205],[505,305],[505,405]],"e":[[0,4],[0,3],[0,5],[1,4],[2,3],[2,5],[1,5]],"vp":[365.0,200.0,170.0,250.0]}} Example of a bipartite graph. Circular and rectangular nodes represent the two partitions. - *

- * @class - * @static - */ - export interface Bipartitions extends yfiles.lang.Object{} - export class Bipartitions { - /** - * Calculates a bipartition of the given graph, if one exists. - *

- * If the graph is bipartite, then for all nodes of the given graph either {@link yfiles.algorithms.Bipartitions#RED} or {@link yfiles.algorithms.Bipartitions#BLUE} - * objects will be set in the given {@link yfiles.algorithms.INodeMap}, depending on the partition to which each node belongs. - *

- * @param graph the given graph - * @param markMap the {@link } that will be filled during the BFS execution and returns the partition (either {@link #RED} - * or {@link #BLUE}) to which each node belongs - * @returns true if the graph is bipartite, false otherwise - * @static - */ - static getBipartition(graph:yfiles.algorithms.Graph,markMap:yfiles.algorithms.INodeMap):boolean; - /** - * Determines whether or not the given graph is bipartite. - * @param graph the given graph - * @returns true if the graph is bipartite, false otherwise - * @static - */ - static isBipartite(graph:yfiles.algorithms.Graph):boolean; - /** - * A constant for marking a node that belongs to the red partition. - * @const - * @static - * @type {any} - */ - static RED:any; - /** - * A constant for marking a node that belongs to the blue partition. - * @const - * @static - * @type {any} - */ - static BLUE:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Bipartitions; - } - /** - * This class provides methods to determine various centrality indices of nodes or edges of a graph. - *

- * Centrality indices serve to quantify an intuitive feeling that in most networks some nodes or edges are "more central" - * than others. The provided methods assign a double value to each node or edge of a graph that represents its centrality. - * The higher an assigned value, the more central the element is considered by the algorithm. - *

- *

- * Also, this class provides convenience methods that normalize the returned centrality values such that they lie within - * the interval [0,1]. - *

- *

- * Definitions - *

- *
    - *
  • Betweenness centrality is a measure for how often a node/edge lies on a shortest path between each pair of nodes in the graph.
  • - *
  • Closeness centrality is the reciprocal of the sum of shortest path distances of a node to all other nodes in the graph.
  • - *
  • Graph centrality is the reciprocal of the maximum of all shortest path distances from a node to all other nodes in the graph.
  • - *
  • - * Degree centrality is the number of the incoming, outgoing or overall edges incident to a node (measures incoming, outgoing and overall - * degree). - *
  • - *
  • Weight centrality measures the weight associated with incoming, outgoing, or all edges of a node.
  • - *
- * @class - * @static - */ - export interface Centrality extends yfiles.lang.Object{} - export class Centrality { - /** - * Computes the closeness centrality for the nodes of a graph. - *

- * Closeness centrality is defined as the reciprocal of the sum of shortest path distances of a node to all other nodes in the graph. - * Therefore, a node with high closeness centrality has short distances to all other nodes of a graph. If the sum of the - * shortest path distances is 0, the closeness of a node is set to {@link number#POSITIVE_INFINITY}. - *

- * @param graph the input graph - * @param closeness the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost - * @static - */ - static closenessCentrality(graph:yfiles.algorithms.Graph,closeness:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Computes the degree centrality for the nodes of a given graph. - *

- * Degree centrality is the number of the incoming, outgoing or overall edges incident to a node (measures incoming, outgoing and overall - * degree). - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param considerInEdges true if the incoming edges should be considered, false otherwise - * @param considerOutEdges true if the outgoing edges should be considered, false otherwise - * @static - */ - static degreeCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,considerInEdges:boolean,considerOutEdges:boolean):void; - /** - * Computes betweenness centrality for each edge of a given graph. - *

- * Betweenness centrality is a measure for how often an edge lies on a shortest path between each pair of nodes in the graph. Removing a central - * edge will cause many shortest paths to change. - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * edge - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost; - * for invalid input values the algorithm uses cost 1.0 - * @static - */ - static edgeBetweenness(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.IEdgeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Computes the graph centrality for the nodes of a graph. - *

- * Graph centrality is defined as the reciprocal of the maximum of all shortest path distances from a node to all other nodes in the graph. - * Nodes with high graph centrality have short distances to all other nodes in the graph. - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost - * @static - */ - static graphCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Computes betweenness centrality for each node of a given graph. - *

- * Betweenness centrality is a measure for how often a node lies on a shortest path between each pair of nodes in the graph. Removing a central - * edge will cause many shortest paths to change. - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost; - * for invalid input values the algorithm uses cost 1.0 - * @static - */ - static nodeBetweenness(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Computes betweenness centrality for each node and edge of a given graph. - *

- * Betweenness centrality is a measure for how often a node/edge lies on a shortest path between each pair of nodes in the graph. Removing a - * central node/edge will cause many shortest paths to change. - *

- * @param graph the input graph - * @param nodeCentrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param edgeCentrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * edge - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost; - * for invalid input values the algorithm uses cost 1.0 - * @static - */ - static nodeEdgeBetweenness(graph:yfiles.algorithms.Graph,nodeCentrality:yfiles.algorithms.INodeMap,edgeCentrality:yfiles.algorithms.IEdgeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Normalizes the double values of a given {@link yfiles.algorithms.IEdgeMap} by dividing each of them by the maximum of all values - * (maximum norm). - * @param graph the input graph - * @param map the {@link } that will be filled during the execution and returns a double value from [0,1] interval - * @static - */ - static normalizeEdgeMap(graph:yfiles.algorithms.Graph,map:yfiles.algorithms.IEdgeMap):void; - /** - * Normalizes the double values of a given {@link yfiles.algorithms.INodeMap} by dividing each of them by the maximum of all values - * (maximum norm). - * @param graph the input graph - * @param map the {@link } that will be filled during the execution and returns a double value from [0,1] interval - * @static - */ - static normalizeNodeMap(graph:yfiles.algorithms.Graph,map:yfiles.algorithms.INodeMap):void; - /** - * Computes the weight centrality for the nodes of a graph. - *

- * Weight centrality measures the weight associated with incoming, outgoing, or all edges of a node. - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param considerInEdges true if the incoming edges should be considered, false otherwise - * @param considerOutEdges true if the outgoing edges should be considered, false otherwise - * @param edgeWeights the {@link } that returns a positive double value (weight) or null if the edges are considered to - * have uniform weight of 1.0 - * @static - */ - static weightCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,considerInEdges:boolean,considerOutEdges:boolean,edgeWeights:yfiles.algorithms.IDataProvider):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Centrality; - } - /** - * This class is responsible for finding cycles within a graph that have certain properties. - *

- * Definitions - *

- *
    - *
  • - * An edge path with vertices v0, v1, v2, ... , vk (with k > 0 and (vi-1,vi), 0 < i <= k is edge of the given graph) is - * called simple if no vertex appears more than once. - *
  • - *
  • An edge path forms a cycle if v0 = vk.
  • - *
  • A cycle is called simple if no vertex appears more than once.
  • - *
  • A graph that contains no cycles is called acyclic.
  • - *
- *

- * {@graph {"ann":{"s":[30,30],"d":1, "c":1},"n":[[45,5],[105,65],[-15,65],[45,125],[185,65],[-95,65]],"e":[[0,1],[0,2],[1,3],[2,3],[1,4],[2,5]],"vp":[-95.0,5.0,310.0,150.0]}} Example of an acyclic directed graph (edge directions are considered) {@graph {"ann":{"s":[30,30],"d":1, "c":1},"n":[[305,185],[385,125],[345,285],[505,125],[545,225],[465,305]],"e":[[0,1],[1,3],[4,5,1],[5,2,1],[2,0,1],[0,4,1]],"vp":[305.0,125.0,270.0,210.0]}} Example of a graph containing a cycle. Marked - * edges form a directed cycle. - *

- * @class - * @static - */ - export interface Cycles extends yfiles.lang.Object{} - export class Cycles { - /** - * Returns an {@link yfiles.algorithms.EdgeList} that contains all the edges that are part of at least one directed or undirected - * simple cycle. - * @param graph the input graph - * @param directed true if the graph should be considered directed, false otherwise - * @returns an {@link } that contains all the edges that are part of at least one directed or undirected simple - * cycle - * @static - */ - static findAllCycleEdges(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList; - /** - * Returns an {@link yfiles.algorithms.EdgeList} that contains the edges of a cycle found in the given graph. - *

- * The edges are returned in the order they appear in the detected cycle. - *

- *

- * If the returned cycle is empty, no cycle has been found in the given graph. - *

- * @param graph the given graph - * @param directed true if the graph should be considered directed, false otherwise - * @returns an {@link } containing the edges of a cycle or an empty {@link } if the graph is - * acyclic - * @static - */ - static findCycle(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList; - /** - * Marks the edges of a given graph whose removal or reversal would make the graph acyclic while trying to minimize the - * cost associated with the marked edges. - *

- * This minimization is performed heuristically, since it is a well known hard problem to come up with an optimal - * solution. - *

- *

- * The costs are assigned using a {@link yfiles.algorithms.IDataProvider} that holds a non-negative double value for each edge. - *

- * @param graph the given graph - * @param cycleEdges the {@link } that will be filled during the execution and returns whether an edge is a detected cycle - * edge - * @param [costDP=null] the {@link } that holds the non-negative {@link } reversal cost for each edge - * @static - */ - static findCycleEdges(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap,costDP?:yfiles.algorithms.IDataProvider):void; - /** - * Marks the edges of a given graph whose removal or reversal would make the graph acyclic based on a depth first search. - *

- * The number of marked cycle edges is expected to be slightly greater than when using - * {@link yfiles.algorithms.Cycles#findCycleEdges}. The advantage of this method is that the result set is more stable when edges - * are added or removed over time. - *

- * @param graph the given graph - * @param cycleEdges the {@link } that will be filled during the execution and returns a boolean value indicating whether - * or not an edge is a detected cycle edge - * @static - */ - static findCycleEdgesDFS(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Cycles; - } - /** - * Represents a dart of a face of a {@link yfiles.algorithms.PlanarEmbedding}. - *

- * For each edge there exist two darts, one that represents the edge in its original direction (i.e., from source to - * target) and one that represents its reverse. Each dart is associated with a {@link yfiles.algorithms.Dart#face face}. - *

- * @class - * @final - */ - export interface Dart extends yfiles.lang.Object{} - export class Dart { - /** - * Gets the edge associated with this dart. - * @type {yfiles.algorithms.Edge} - */ - associatedEdge:yfiles.algorithms.Edge; - /** - * Gets whether this dart represents the original edge or its reverse. - * @type {boolean} - */ - reversed:boolean; - /** - * Gets the opposite dart. - *

- * The opposite dart is associated with the same edge as this dart but with a different {@link yfiles.algorithms.Dart#reversed direction}. - *

- * @type {yfiles.algorithms.Dart} - */ - oppositeDart:yfiles.algorithms.Dart; - /** - * Gets the face list associated with this dart. - * @type {yfiles.collections.IList.} - */ - face:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Dart; - } - /** - * Framework class for implementing depth first search (DFS) based algorithms. - *

- * A depth first search starts from a specified node and traverses the neighbors within a branch as deeply as possible - * (i.e., without visiting any vertex twice) before backtracking. - *

- *

- * A depth first search traversal induces a DFS forest that may consist of more than one DFS tree. Based on these trees, - * the edges are divided into four categories (see example): - *

- *
    - *
  • Tree Edges: The edges of the DFS forest.
  • - *
  • Back edges: Non-tree edges that connect nodes with their ancestors in the DFS tree. Self-loops are also considered as back edges.
  • - *
  • Forward edges: Edges that connect nodes of the DFS tree to one of their descendants.
  • - *
  • Cross edges: All other edges.
  • - *
- *

- * During a DFS run each node of the graph can be in one of the following states: - *

- *
    - *
  • Undiscovered: A node that has not been visited yet.
  • - *
  • - * Discovered but not finished: A node that has been already visited, but has not been completed yet, i.e. it is still part of an active path of the - * DFS tree. - *
  • - *
  • - * Finished: A node that has been completed, i.e. it has been visited before and is not part of an active path of the DFS tree - * anymore. - *
  • - *
- *

- * Graph algorithms, which are based on a depth first search, can extend this class and override appropriate callback - * methods provided by this class. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1, "c":1},"styles" : {"6" : {"s" : "#000000", "d" : 1, "l" : [3] }, "7" : {"s" : "#000000", "d" : 1, "l" : [1,4] }, "8" : {"s" : "#000000", "d" : 1, "l" : [7] }},"n":[[145,-15,[[154.66,9.35,10.67,18.7,"1"]]],[65,65,[[74.66,89.35,10.67,18.7,"2"]]],[185,65,[[194.66,89.35,10.67,18.7,"8"]]],[45,225,[[54.66,249.35,10.67,18.7,"5"]]],[125,145,[[134.66,169.35,10.67,18.7,"7"]]],[65,145,[[74.66,169.35,10.67,18.7,"6"]]],[-35,225,[[-25.34,249.35,10.67,18.7,"4"]]],[5,145,[[14.66,169.35,10.67,18.7,"3"]]],[185,145,[[194.66,169.35,10.67,18.7,"9"]]]],"e":[[0,1],[1,7],[0,2],[7,3],[1,4],[1,5],[7,6],[2,1,6,[],[[118.33,72.85,35.34,18.7,"Cross"]]],[6,1,8,[-60,100,-60,100],[[-95.2,149.04,30.68,18.7,2.4492935982947064E-16,-1.0,"Back"]]],[0,3,7,[360,140],[[270.38,202.85,48.01,18.7,2.4492935982947064E-16,-1.0,"Forward"]]],[2,8]],"vp":[-96.0,-15.0,456.0,270.0]}} Example of a DFS traversal. Node labels indicate the order in which nodes are visited. Solid edges are the edges of the - * DFS tree while dashed edges represent back, forward and cross edges. - *

- * @class - */ - export interface Dfs extends yfiles.lang.Object{} - export class Dfs { - /** - * Creates a new {@link yfiles.algorithms.Dfs} instance with default settings. - */ - constructor(); - /** - * Cancels the depth first search. - *

- * It may be overridden to support custom implementations. - *

- */ - cancel():void; - /** - * Callback method that will be invoked whenever DFS continues its search at a new root node. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param v the new root node - * @protected - */ - lookFurther(v:yfiles.algorithms.Node):void; - /** - * Callback method that will be invoked after the DFS has returned from the given node. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param edge the given edge - * @param node the node that has been reached via the given edge - * @protected - */ - postTraverse(edge:yfiles.algorithms.Edge,node:yfiles.algorithms.Node):void; - /** - * Callback method that will be invoked whenever a node visit has been completed. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param node the given node - * @param dfsNumber the DFS number of the given node - * @param compNumber the completion number of the given node - * @protected - */ - postVisit(node:yfiles.algorithms.Node,dfsNumber:number,compNumber:number):void; - /** - * Callback method that will be invoked if the given edge will be considered the first (and only) time during the DFS. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param edge the given edge - * @param node the node to be visited next only if treeEdge == true - * @param treeEdge true if the node will be visited, false otherwise - * @protected - */ - preTraverse(edge:yfiles.algorithms.Edge,node:yfiles.algorithms.Node,treeEdge:boolean):void; - /** - * Callback method that will be invoked whenever a formerly unvisited node gets visited for the first time. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param node the given node - * @param dfsNumber the DFS number of the given node - * @protected - */ - preVisit(node:yfiles.algorithms.Node,dfsNumber:number):void; - /** - * Starts a depth first search from a given {@link yfiles.algorithms.Node} of the input graph. - * @param graph the input graph - * @param start the given start node - */ - start(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node):void; - /** - * Starts a depth first search on the given graph. - *

- * The first node of the graph will be visited first. - *

- * @param graph the input graph - */ - start(graph:yfiles.algorithms.Graph):void; - /** - * A {@link yfiles.algorithms.INodeMap} that holds for each {@link yfiles.algorithms.Node} an {@link any} indicating the current state of the given - * node as it is visited by this algorithm. - *

- * Each node will be assigned one of the {@link yfiles.algorithms.Dfs#WHITE WHITE}, {@link yfiles.algorithms.Dfs#GRAY GRAY} or {@link yfiles.algorithms.Dfs#BLACK BLACK} objects that describe the state of the nodes. - *

- * @protected - * @type {yfiles.algorithms.INodeMap} - */ - stateMap:yfiles.algorithms.INodeMap; - /** - * A constant indicating a node has not been visited yet. - * @protected - * @const - * @static - * @type {any} - */ - static WHITE:any; - /** - * A constant indicating a node has already been visited, but has not been completed yet. - *

- * Such a node is still part of an active path of the DFS tree. - *

- * @protected - * @const - * @static - * @type {any} - */ - static GRAY:any; - /** - * A constant indicating a node has been completed. - *

- * Such a node has been visited before and is no longer part of an active path of the DFS tree. - *

- * @protected - * @const - * @static - * @type {any} - */ - static BLACK:any; - /** - * Sets whether or not to interpret the edges of the graph as directed. - * @type {boolean} - */ - directedMode:boolean; - /** - * Sets whether or not to continue the depth first search after all nodes reachable from the first node have been visited. - * @type {boolean} - */ - lookFurtherMode:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Dfs; - } - /** - * This is the base class of all look-up keys that are used to register {@link yfiles.algorithms.IDataProvider} with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @template TValue - */ - export interface DpKeyBase extends yfiles.lang.Object{} - export class DpKeyBase { - /** - * Initializes a new instance of the {@link yfiles.algorithms.DpKeyBase.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - /** - * Returns whether this key is equal to the specified other. - * @param other The other key to compare with this instance. - * @returns true if the specified key is equal to this instance; otherwise, false. - * @protected - */ - equalsCore(other:yfiles.algorithms.DpKeyBase):boolean; - /** - * Gets the type that declares this key. - * @type {yfiles.lang.Class} - */ - declaringType:yfiles.lang.Class; - /** - * Gets the name of this key. - * @type {string} - */ - name:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.DpKeyBase; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.Edge}s with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface EdgeDpKey extends yfiles.algorithms.DpKeyBase{} - export class EdgeDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.EdgeDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.EdgeDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for the {@link yfiles.algorithms.Graph} itself - * with a graph. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface GraphDpKey extends yfiles.algorithms.DpKeyBase{} - export class GraphDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.GraphDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.GraphObject}s - * with a {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface GraphObjectDpKey extends yfiles.algorithms.DpKeyBase{} - export class GraphObjectDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.GraphObjectDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphObjectDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for IEdgeLabelLayouts with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface IEdgeLabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} - export class IEdgeLabelLayoutDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.IEdgeLabelLayoutDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.IEdgeLabelLayoutDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for INodeLabelLayouts with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface INodeLabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} - export class INodeLabelLayoutDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.INodeLabelLayoutDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.INodeLabelLayoutDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for ILabelLayouts with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface ILabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} - export class ILabelLayoutDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.ILabelLayoutDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.ILabelLayoutDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.Node}s with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface NodeDpKey extends yfiles.algorithms.DpKeyBase{} - export class NodeDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.NodeDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.NodeDpKey; - } - /** - * Represents an edge, i.e., a directed connection between two nodes (represented by instances of class - * {@link yfiles.algorithms.Node}) in the directed graph data type {@link yfiles.algorithms.Graph}. - *

- *
The directed stems from the fact that an edge has a distinct source node and a distinct target node. Using pair notation, an - * edge would be written as (<source node>, <target node>). - *

- *

- * Most notably, an edge provides access to its source node ({@link yfiles.algorithms.Edge#source}) and its target node ({@link yfiles.algorithms.Edge#target}). Note that an edge can have the same - * node as its source and target. Such an edge is then called "self-loop" and method {@link yfiles.algorithms.Edge#selfLoop} yields true. - *

- *

- * Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that - * there is no way to create or delete a node or an edge without using an actual Graph instance. - *

- * @class - * @extends {yfiles.algorithms.GraphObject} - */ - export interface Edge extends yfiles.algorithms.GraphObject{} - export class Edge { - /** - * Creates a new edge that belongs to the given graph. - *

- * The new edge e has source node v and target node w. - *
- * - *
- * Edge e is inserted in such a way that an iteration over the edges at node v returns e - *

- *
    - *
  • after e1, if d1 == AFTER
  • - *
  • before e1, if d1 == BEFORE,
  • - *
- *

- * and an iteration over the edges at w returns e - *

- *
    - *
  • after e2, if d2 == AFTER
  • - *
  • before e2, if d2 == BEFORE.
  • - *
- * @param v The source node of the edge. - * @param e1 An edge with source node v. - * @param w The target node of the edge. - * @param e2 An edge with target node w. - * @param d1 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param d2 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param g - */ - constructor(g:yfiles.algorithms.Graph,v:yfiles.algorithms.Node,e1:yfiles.algorithms.Edge,w:yfiles.algorithms.Node,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion); - /** - * Creates a copy of this edge that will be inserted into the given graph connecting the given source and target nodes. - * @param g The graph the created edge will belong to. - * @param v The source node of the created edge. - * @param w The target node of the created edge. - * @returns The newly created Edge object. - */ - createCopy(g:yfiles.algorithms.Graph,v:yfiles.algorithms.Node,w:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Callback method that is invoked from a graph just before this edge will be reinserted into that graph. - */ - onReinsert():void; - /** - * Returns the node at the opposite edge end with respect to the given node. - *

- * Note that self-loops have the same node at both edge ends. - *

- * @param v - * @returns - */ - opposite(v:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Gets the graph this edge belongs to. - *

- * If the edge does not belong to a graph, because it was removed or hidden from it, this method returns null. - *

- * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - /** - * Gets the index of this edge within its graph G. - *

- * Edge indices represent the ordering of standard edge iteration on G. The value of an index is >= 0 and - * < G.edgeCount(). - *

- *

- * Note that indices are subject to change whenever the sequence of edges in a graph is modified by either removing, - * hiding, reinserting, or unhiding an edge, or by explicitly changing its position in the sequence. - *

- * @see yfiles.algorithms.Graph#removeEdge - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#reInsertEdge - * @see yfiles.algorithms.Graph#unhide - * @see yfiles.algorithms.Graph#moveToFirst - * @see yfiles.algorithms.Graph#moveToLast - * @type {number} - */ - index:number; - /** - * Gets the source node connected to this edge. - * @see yfiles.algorithms.Edge#target - * @type {yfiles.algorithms.Node} - */ - source:yfiles.algorithms.Node; - /** - * Gets the target node connected to this edge. - * @see yfiles.algorithms.Edge#source - * @type {yfiles.algorithms.Node} - */ - target:yfiles.algorithms.Node; - /** - * Gets true if and only if this edge is a self-loop. - *

- * An edge is called a self-loop, if it is adjacent to only one node, i.e., source node and target node are the same. - *

- * @type {boolean} - */ - selfLoop:boolean; - /** - * Gets the successor of this edge in the list of outgoing edges at its source node. - *

- * If this edge is the last outgoing edge at its source node, then null is returned. - *

- * @see yfiles.algorithms.Edge#prevOutEdge - * @see yfiles.algorithms.Edge#nextInEdge - * @type {yfiles.algorithms.Edge} - */ - nextOutEdge:yfiles.algorithms.Edge; - /** - * Gets the successor of this edge in the list of incoming edges at its target node. - *

- * If this edge is the last incoming edge at its target node, then null is returned. - *

- * @see yfiles.algorithms.Edge#prevInEdge - * @see yfiles.algorithms.Edge#nextOutEdge - * @type {yfiles.algorithms.Edge} - */ - nextInEdge:yfiles.algorithms.Edge; - /** - * Gets the predecessor of this edge in the list of outgoing edges at its source node. - *

- * If this edge is the first outgoing edge at its source node, then null is returned. - *

- * @see yfiles.algorithms.Edge#nextOutEdge - * @see yfiles.algorithms.Edge#prevInEdge - * @type {yfiles.algorithms.Edge} - */ - prevOutEdge:yfiles.algorithms.Edge; - /** - * Gets the predecessor of this edge in the list of incoming edges at its target node. - *

- * If this edge is the first incoming edge at its target node, then null is returned. - *

- * @see yfiles.algorithms.Edge#nextInEdge - * @see yfiles.algorithms.Edge#prevOutEdge - * @type {yfiles.algorithms.Edge} - */ - prevInEdge:yfiles.algorithms.Edge; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Edge; - } - /** - * Specialized list implementation for instances of type {@link yfiles.algorithms.Edge}. - * @class - * @extends {yfiles.algorithms.YList} - * @implements {yfiles.collections.IEnumerable.} - */ - export interface EdgeList extends yfiles.algorithms.YList{} - export class EdgeList { - /** - * Creates a list that is initialized with an EdgeList. - * @param edgeList - */ - constructor(edgeList:yfiles.algorithms.EdgeList); - /** - * Creates a list that is initialized with a single edge provided. - * @param e - */ - constructor(e:yfiles.algorithms.Edge); - /** - * Creates a list that is initialized with those edges from the given EdgeCursor object for which the given data provider - * returns true upon calling its {@link yfiles.algorithms.IDataProvider#getBoolean getBool} method. - * @param ec An edge cursor providing edges that should be added to this list. - * @param predicate A data provider that acts as a inclusion predicate for each edge accessible by the given edge cursor. - */ - constructor(ec:yfiles.algorithms.IEdgeCursor,predicate:yfiles.algorithms.IDataProvider); - /** - * Creates a list that is initialized with the edges provided by the given array of edges. - * @param a - */ - constructor(a:yfiles.algorithms.Edge[]); - /** - * Creates a list that is initialized with the edges provided by the given EdgeCursor object. - * @param c - */ - constructor(c:yfiles.algorithms.IEdgeCursor); - /** - * Creates an empty edge list. - */ - constructor(); - /** - * Returns an edge cursor for this edge list. - * @returns An edge cursor granting access to the edges within this list. - */ - edges():yfiles.algorithms.IEdgeCursor; - /** - * Returns the first edge in this list, or null when the list is empty. - * @returns The first edge in the list. - */ - firstEdge():yfiles.algorithms.Edge; - /** - * Returns an enumerator for this collection. - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Returns the last edge in this list, or null when the list is empty. - * @returns The last edge in the list. - */ - lastEdge():yfiles.algorithms.Edge; - /** - * Removes the first edge from this list and returns it. - * @returns The first edge from the list. - */ - popEdge():yfiles.algorithms.Edge; - /** - * Returns an edge array containing all elements of this list in the canonical order. - * @returns - */ - toEdgeArray():yfiles.algorithms.Edge[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.EdgeList; - } - export enum BfsDirection{ - /** - * An edge direction specifier for incoming edges. - * @see yfiles.algorithms.Bfs#getLayers - */ - PREDECESSOR, - /** - * An edge direction specifier for outgoing edges. - * @see yfiles.algorithms.Bfs#getLayers - */ - SUCCESSOR, - /** - * An edge direction specifier for both incoming and outgoing edges. - * @see yfiles.algorithms.Bfs#getLayers - */ - BOTH - } - export enum GraphElementInsertion{ - /** - * Object insertion specifier. An object gets inserted before another one. - */ - BEFORE, - /** - * Object insertion specifier. An object gets inserted after another one. - */ - AFTER - } - export enum GraphEventType{ - /** - * Type constant that identifies an event that gets fired immediately after a node has been created. The data of the event - * is the newly created node. - */ - NODE_CREATION, - /** - * Type constant that identifies an event that gets fired immediately after an edge has been created. The data of the event - * is the newly created edge. - */ - EDGE_CREATION, - /** - * Type constant that identifies an event that gets fired immediately before a node will be removed from the graph. The - * data of the event is the node to be removed. - */ - PRE_NODE_REMOVAL, - /** - * Type constant that identifies an event that gets fired immediately after a node has been removed from the graph. The - * data of the event is the removed node. - */ - POST_NODE_REMOVAL, - /** - * Type constant that identifies an event that gets fired immediately before an edge will be removed from the graph. The - * data of the event is the edge to be removed. - */ - PRE_EDGE_REMOVAL, - /** - * Type constant that identifies an event that gets fired immediately after an edge has been removed from the graph. The - * data of the event is the removed edge. - */ - POST_EDGE_REMOVAL, - /** - * Type constant that identifies an event that gets fired immediately after a node has been reinserted into the graph. The - * data of the event is the reinserted node. - */ - NODE_REINSERTION, - /** - * Type constant that identifies an event that gets fired immediately after an edge has been reinserted into the graph. The - * data of the event is the reinserted edge. - */ - EDGE_REINSERTION, - /** - * Type constant that identifies an event that gets fired immediately before the end points of an edge will be changed. The - * data of the event is the edge to be redefined. - */ - PRE_EDGE_CHANGE, - /** - * Type constant that identifies an event that gets fired immediately after the end points of an edge have been changed. - * The data of the event is the redefined edge. - */ - POST_EDGE_CHANGE, - /** - * Type constant that identifies an event that gets fired after a subgraph of a graph G has been moved to the emitting - * graph. The data of the event is a {@link yfiles.algorithms.NodeList} containing the nodes that induce the moved subgraph. - *

- * This event gets fired just after the {@link yfiles.algorithms.GraphEventType#SUBGRAPH_REMOVAL} event got fired on the subgraph's - * original graph G. Note that at the time the event gets fired, the nodes from the node list are already part of the - * emitting graph. - *

- */ - SUBGRAPH_INSERTION, - /** - * Type constant that identifies an event that gets fired after a subgraph of the emitting graph has been moved to a graph - * G. The data of the event is a {@link yfiles.algorithms.NodeList} containing the nodes that induce the moved subgraph. - *

- * This event gets fired just before the {@link yfiles.algorithms.GraphEventType#SUBGRAPH_INSERTION} event will be fired on the - * subgraph's new graph G. Note that at the time the event gets fired, the nodes from the node list are already part of - * graph G. - *

- */ - SUBGRAPH_REMOVAL, - /** - * Type constant that signals the start of a some logically coherent event sequence. If specified, the data of this event - * is its ID. - */ - PRE_EVENT, - /** - * Type constant that signals the end of a some logically coherent event sequence. If specified, the data of this event is - * its ID. - */ - POST_EVENT - } - export enum DistanceMetric{ - /** - * A specifier for euclidean distance metric. - * @see yfiles.algorithms.Groups#kMeansClustering - */ - EUCLIDEAN, - /** - * A specifier for euclidean squared distance metric. - * @see yfiles.algorithms.Groups#kMeansClustering - */ - EUCLIDEAN_SQUARED, - /** - * A specifier for Manhattan distance metric. - * @see yfiles.algorithms.Groups#kMeansClustering - */ - MANHATTAN, - /** - * A specifier for Chebychev distance metric. - * @see yfiles.algorithms.Groups#kMeansClustering - */ - CHEBYCHEV - } - export enum Linkage{ - /** - * A specifier for single-linkage clustering. - *

- * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most - * "similar" clusters are merged together until all nodes belong to the same cluster. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - */ - SINGLE, - /** - * A specifier for complete-linkage clustering. - *

- * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most - * "dissimilar" clusters are merged and the distance equals to the distance of those two nodes that are farthest away from - * each other. The algorithm continues until all nodes belong to the same cluster. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - */ - COMPLETE, - /** - * A specifier for average-linkage clustering. - *

- * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most - * "similar" clusters are combined and the distance between them is defined as the average all distances between the nodes - * that belong to the two clusters that are combined. The algorithm continues until all nodes belong to the same cluster. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - */ - AVERAGE - } - /** - * This class represents a line in the 2D-dimensional affine space. - *

- * The line is defined by the equation ax + by + c = 0 - *

- * @class - */ - export interface AffineLine extends yfiles.lang.Object{} - export class AffineLine { - /** - * Creates an affine line which is defined by two points. - * @param p1 - * @param p2 - */ - constructor(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint); - /** - * Creates an affine line which is defined by a point and a vector. - * @param p1 - * @param v - */ - constructor(p1:yfiles.algorithms.YPoint,v:yfiles.algorithms.YVector); - /** - * Returns the crossing of two lines. - *

- * If the lines are parallel, null is returned. - *

- * @param l1 - * @param l2 - * @returns - * @static - */ - static getCrossing(l1:yfiles.algorithms.AffineLine,l2:yfiles.algorithms.AffineLine):yfiles.algorithms.YPoint; - /** - * Projects an point on the line in direction of the X-axis. - * @param p - * @returns - */ - getXProjection(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Projects an point on the line in direction of the Y-axis. - * @param p - * @returns - */ - getYProjection(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Gets a from ax+by+c = 0 - * @type {number} - */ - a:number; - /** - * Gets b from ax+by+c = 0 - * @type {number} - */ - b:number; - /** - * Gets c from ax+by+c = 0 - * @type {number} - */ - c:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.AffineLine; - } - /** - * The handle of a segment of a borderline. - * @class - */ - export interface BorderLineSegment extends yfiles.lang.Object{} - export class BorderLineSegment { - /** - * Returns the segment's value at the given position. - *

- * Note: In case the position lies outside the segments range, the calculated value might be invalid. As the segment is not - * aware of any offsets the position also must not include any offsets. - *

- * @param position the position the value is retrieved for. - * @returns the segment's value at the given position. - */ - getValueAt(position:number):number; - /** - * Returns the next segment or null if there is no such segment. - * @returns - */ - next():yfiles.algorithms.BorderLineSegment; - /** - * Returns the previous segment or null if there is no such segment. - * @returns - */ - prev():yfiles.algorithms.BorderLineSegment; - /** - * Gets the end of this segment. - * @type {number} - */ - end:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.BorderLineSegment; - } - /** - * This class can be used to easily model an orthogonal border line or sky-line. - *

- * It provides methods for measuring the distance between different BorderLine instances, merging multiple instances, - * modifying and efficiently moving them around. - *

- * @class - */ - export interface BorderLine extends yfiles.lang.Object{} - export class BorderLine { - /** - * Creates a new BorderLine from a single segment. - * @param min the beginning of this borderline - * @param max the ending of this borderline - * @param valueAtMin the value of the segment at the beginning of this borderline - * @param valueAtMax the value of the segment at the ending of this borderline - */ - constructor(min:number,max:number,valueAtMin:number,valueAtMax:number); - /** - * Creates a new BorderLine from a single segment. - * @param min the beginning of this borderline - * @param max the ending of this borderline - * @param value the value of the segment - */ - constructor(min:number,max:number,value:number); - /** - * Creates a new BorderLine with the given value from -Double.MAX_VALUE to Double.MAX_VALUE. - * @param value the value of the segment - */ - constructor(value:number); - /** - * Adds the given offset to the segments' positions. - *

- * This method has complexity O(1). - *

- * @param delta the delta to add to the positions - */ - addOffset(delta:number):void; - /** - * Adds the given offset to the current values of the whole borderline. - *

- * This method has complexity O(1). - *

- * @param delta the delta to add to the values - */ - addValueOffset(delta:number):void; - /** - * Convenience method that copies the actual data from the given argument to this instance. - * @param other the argument to retrieve the values from - */ - adoptValues(other:yfiles.algorithms.BorderLine):void; - /** - * Creates a copy of this borderline. - *

- * Optionally negates the values or offsets. - *

- * @param negateValues whether the values are negated - * @param negateOffsets whether the offsets are negated - * @returns the copy of the borderline - */ - createCopy(negateValues:boolean,negateOffsets:boolean):yfiles.algorithms.BorderLine; - /** - * Merges this borderline with the given borderline using the "maximum" policy. - *

- * That means the resulting borderline will have greater value of both borderline on each position. If you imagine each - * borderline as a the upper border of a plane, the resulting borderline will be the upper border of the merged planes. - *

- * @param other the other borderline - * @returns a new borderline that is the result of the merge - */ - createMax(other:yfiles.algorithms.BorderLine):yfiles.algorithms.BorderLine; - /** - * Merges this borderline with the given borderline using the "minimum" policy. - *

- * That means the resulting borderline will have smaller value of both borderline on each position. If you imagine each - * borderline as a the lower border of a plane, the resulting borderline will be the lower border of the merged planes. - *

- * @param other the other borderline - * @returns a new borderline that is the result of the merge - */ - createMin(other:yfiles.algorithms.BorderLine):yfiles.algorithms.BorderLine; - /** - * Returns the first segment or null if there is no such segment. - * @returns - */ - firstSegment():yfiles.algorithms.BorderLineSegment; - /** - * Calculates the minimal distance between this borderline and the other one. - *

- * The other one is treated as if the values were all greater. - *

- * @param greater - * @returns - */ - getDistanceTo(greater:yfiles.algorithms.BorderLine):number; - /** - * Returns the maximum position of the given segment. - * @param s the segment - * @returns - */ - getMax(s:yfiles.algorithms.BorderLineSegment):number; - /** - * Calculates the maximum value in the interval from->to. - * @param from - * @param to - * @returns - */ - getMaxValue(from:number,to:number):number; - /** - * Returns the minimum position of the given segment. - * @param s the segment - * @returns - */ - getMin(s:yfiles.algorithms.BorderLineSegment):number; - /** - * Calculates the minimum value in the interval from->to. - * @param from - * @param to - * @returns - */ - getMinValue(from:number,to:number):number; - /** - * Returns the segment at the given position. - * @param pos the position - * @returns - */ - getSegmentAt(pos:number):yfiles.algorithms.BorderLineSegment; - /** - * Returns the slope of the given segment. - * @param s the segment - * @returns - */ - getSlope(s:yfiles.algorithms.BorderLineSegment):number; - /** - * Returns the value of the minimum of the given segment. - *

- * If the segment's slope is 0, it's the value of the whole segment. In case the slope differs from 0, it's the value of - * the start of the slope. - *

- * @param s the segment - * @returns - */ - getValue(s:yfiles.algorithms.BorderLineSegment):number; - /** - * Returns the value that is set on this borderline at the specified position. - *

- * The position must lie within the range of the segment. - *

- * @param segment The segment whose value shall be returned. - * @param pos the position where the value will be retrieved. - * @returns the value - * @throws {Stubs.Exceptions.ArgumentError} if pos is outside the segment's range. - */ - getValueAt(segment:yfiles.algorithms.BorderLineSegment,pos:number):number; - /** - * Returns the value that is set on this borderline at the specified position. - *

- * The position must lie within the range of the segment that is stored in cell. - *

- * @param cell The list cell containing the segment whose value shall be returned. - * @param pos the position - * @returns the value - * @throws {Stubs.Exceptions.ArgumentError} if pos is outside the segment's range that is stored in cell. - */ - getValueAt(cell:yfiles.algorithms.ListCell,pos:number):number; - /** - * Returns the value that is set on this borderline at the specified position. - * @param pos the position - * @returns the value - * @throws {Stubs.Exceptions.IndexOutOfRangeError} if the position is outside of the borderline. - */ - getValueAt(pos:number):number; - /** - * Grows this BorderLine horizontally, so that the {@link yfiles.algorithms.BorderLine#getValueAt values} of the BorderLine stay the same however their {@link yfiles.algorithms.BorderLine#getMin start} and {@link yfiles.algorithms.BorderLine#getMax end} - * points are moved in the direction of toMin and toMax. - *

- * This is useful for scenarios where a BorderLine is needed that consists of an enlarged border. - *

- *

- * Note that this method normalizes the segments, i.e., it transforms each segment with slope != 0 to a segment with slope - * == 0. - *

- * @param toMin the delta by which the border should be extended towards -Infinity - * @param toMax the delta by which the border should be extended towards +Infinity - * @param positive whether the BorderLine should be interpreted to point in positive direction. This influences the direction into which a - * segment's border is extended. - */ - grow(toMin:number,toMax:number,positive:boolean):void; - /** - * Returns the last segment or null if there is no such segment. - * @returns - */ - lastSegment():yfiles.algorithms.BorderLineSegment; - /** - * Merges this borderline with the given borderline using the "maximum" policy. - * @param other the other borderline - */ - mergeWithMax(other:yfiles.algorithms.BorderLine):void; - /** - * Merges this borderline with the given borderline using the "minimum" policy. - * @param other the other borderline - */ - mergeWithMin(other:yfiles.algorithms.BorderLine):void; - /** - * Returns the next segment or null if there is no such segment. - * @param s - * @returns - */ - next(s:yfiles.algorithms.BorderLineSegment):yfiles.algorithms.BorderLineSegment; - /** - * Returns the previous segment or null if there is no such segment. - * @param s - * @returns - */ - prev(s:yfiles.algorithms.BorderLineSegment):yfiles.algorithms.BorderLineSegment; - /** - * Assures that all values in the given interval are greater or equal than the given value. - * @param min the lower end of the interval - * @param max the upper end of the interval - * @param value the smallest possible value for the interval - */ - setMaxValue(min:number,max:number,value:number):void; - /** - * Assures that all values in the given interval are less or equal than the given value. - * @param min the lower end of the interval - * @param max the upper end of the interval - * @param value the greatest possible value for the interval - */ - setMinValue(min:number,max:number,value:number):void; - /** - * Sets a specific interval to a slope starting at a given value. - * @param min the left side of the interval. - * @param max the right side of the interval. - * @param value the value at min where the slope starts. - * @param slope the slope of the segment in the given interval. - * @throws {Stubs.Exceptions.ArgumentError} if min is greater than max. - */ - setSloped(min:number,max:number,value:number,slope:number):void; - /** - * Sets a specific interval described by min and max to a given value. - * @param min the left side of the interval. - * @param max the right side of the interval. - * @param value the value for the whole interval. - */ - setValue(min:number,max:number,value:number):void; - /** - * Gets the smallest position of this borderline - * @type {number} - */ - min:number; - /** - * Gets the greatest position of this borderline - * @type {number} - */ - max:number; - /** - * Gets the minimum value that is set on this borderline - * @type {number} - */ - minValue:number; - /** - * Gets the maximum value that is set on this borderline - * @type {number} - */ - maxValue:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.BorderLine; - } - /** - * This class provides useful geometric primitives and advanced geometric algorithms. - * @class - * @static - */ - export interface Geom extends yfiles.lang.Object{} - export class Geom { - /** - * Calculates the convex hull for a set of points. - * @param points a list of {@link } objects - * @returns a list of {@link } objects that constitute the convex hull of the given points. The list contains points - * in counter clockwise order around the hull. The first point is the one with the smallest x coordinate. If two such - * points exist then of these points the one with the smallest y coordinate is chosen as the first one. - * @static - */ - static calcConvexHull(points:yfiles.algorithms.YList):yfiles.algorithms.YList; - /** - * Calculates the intersection point of two affine lines. - *

- * Each line is given by two points. - *

- * @param p1 one point on the first line. - * @param p2 another point on the first line. - * @param p3 one point on the second line. - * @param p4 another point on the second line. - * @returns the intersection point of the specified lines or null if there is no intersection. - * @static - */ - static calcIntersection(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint,p3:yfiles.algorithms.YPoint,p4:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Calculates the intersection point of two affine lines. - *

- * Each line is given by a point and a direction vector. - *

- * @param p1 origin point of the first line. - * @param d1 direction vector of the first line. - * @param p2 origin point of the second line. - * @param d2 direction vector of the second line. - * @returns the intersection point of the specified lines or null if there is no intersection. - * @static - */ - static calcIntersection(p1:yfiles.algorithms.YPoint,d1:yfiles.algorithms.YVector,p2:yfiles.algorithms.YPoint,d2:yfiles.algorithms.YVector):yfiles.algorithms.YPoint; - /** - * Calculates the intersection point of two affine lines. - *

- * Each line is given by the coordinates of two points. - *

- * @param x1 x-coordinate of one point on the first line. - * @param y1 y-coordinate of one point on the first line. - * @param x2 x-coordinate of another point on the first line. - * @param y2 y-coordinate of another point on the first line. - * @param x3 x-coordinate of one point on the second line. - * @param y3 y-coordinate of one point on the second line. - * @param x4 x-coordinate of another point on the second line. - * @param y4 y-coordinate of another point on the second line. - * @returns the intersection point of the specified lines or null if there is no intersection. - * @static - */ - static calcIntersection(x1:number,y1:number,x2:number,y2:number,x3:number,y3:number,x4:number,y4:number):yfiles.algorithms.YPoint; - /** - * Intersects the pair of specified source Rectangle2D objects and puts the result into the specified destination Rectangle2D - * object. - *

- * If one or both of the source rectangles have negative width or height, the resulting rectangle will be located at (0,0) - * with a width and height of -1. One of the source rectangles can also be the destination to avoid creating a third - * Rectangle2D object, but in this case the original points of this source rectangle will be overwritten by this method. - *

- * @param r1 the first of a pair of Rectangle2D objects to be intersected with each other - * @param r2 the second of a pair of Rectangle2D objects to be intersected with each other - * @param dest the Rectangle2D that holds the results of the intersection of r1 and r2 - * @returns - * @static - */ - static calcIntersection(r1:yfiles.algorithms.Rectangle2D,r2:yfiles.algorithms.Rectangle2D,dest:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Unions the pair of source Rectangle2D objects and puts the result into the specified destination Rectangle2D object. - *

- * If one of the source rectangles has negative width or height, it is excluded from the union. If both source rectangles - * have negative width or height, the destination rectangle will become a copy of r1. One of the source rectangles can also - * be the destination to avoid creating a third Rectangle2D object, but in this case the original points of this source - * rectangle will be overwritten by this method. If the destination is null, a new Rectangle2D is created. - *

- * @param r1 the first of a pair of Rectangle2D objects to be combined with each other - * @param r2 the second of a pair of Rectangle2D objects to be combined with each other - * @param dest the Rectangle2D that holds the results of the union of r1 and r2 - * @returns - * @static - */ - static calcUnion(r1:yfiles.algorithms.Rectangle2D,r2:yfiles.algorithms.Rectangle2D,dest:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Returns true iff the given points are collinear, i.e. - *

- * all three points lie on a common line. - *

- *

- * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) == 0} - *

- * @param p - * @param q - * @param r - * @returns - * @static - */ - static collinear(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean; - /** - * Determines the distance of the point p to the line segment [l1, l2]. - * @param pointX the x coordinate of p - * @param pointY the y coordinate of p - * @param lineX1 the x coordinate of l1 - * @param lineY1 the y coordinate of l1 - * @param lineX2 the x coordinate of l2 - * @param lineY2 the y coordinate of l2 - * @returns - * @static - */ - static distanceToLineSegment(pointX:number,pointY:number,lineX1:number,lineY1:number,lineX2:number,lineY2:number):number; - /** - * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) > 0} - * @param p - * @param q - * @param r - * @returns - * @static - */ - static leftTurn(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean; - /** - * Returns whether the two lines defined by the given coordinates intersect or not. - * @param x1 - * @param y1 - * @param x2 - * @param y2 - * @param x3 - * @param y3 - * @param x4 - * @param y4 - * @returns - * @static - */ - static linesIntersect(x1:number,y1:number,x2:number,y2:number,x3:number,y3:number,x4:number,y4:number):boolean; - /** - * Same as {@link yfiles.algorithms.Geom#orientation} with double values as arguments. - * @param px - * @param py - * @param qx - * @param qy - * @param rx - * @param ry - * @returns - * @static - */ - static orientation(px:number,py:number,qx:number,qy:number,rx:number,ry:number):number; - /** - * Returns the orientation of point r relative to the directed line from point p to point q. - *

- * The given tuple of points is said to have positive orientation if p and q are distinct and r lies to the left of the - * oriented line passing through p and q and oriented from p to q. - *

- *

- * The tuple is said to have negative orientation if p and q are distinct and r lies to the right of the line, and the - * tuple is said to have orientation zero if the three points are collinear. - *

- * @param p - * @param q - * @param r - * @returns +1 in the case of positive orientation, -1 in the case of negative orientation and 0 in the case of zero orientation. - * @static - */ - static orientation(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):number; - /** - * Determines the projection of the point p onto the line segment [l1, l2]. - *

- * The resulting point is - *

- *
    - *
  • the orthogonal projection of p onto the line through l1 and l2, iff the projection lies on the line segment [l1, l2]
  • - *
  • the end point of the line segment [l1, l2] that is closest to p, otherwise
  • - *
- * @param pointX the x coordinate of p - * @param pointY the y coordinate of p - * @param lineX1 the x coordinate of l1 - * @param lineY1 the y coordinate of l1 - * @param lineX2 the x coordinate of l2 - * @param lineY2 the y coordinate of l2 - * @returns - * @static - */ - static projection(pointX:number,pointY:number,lineX1:number,lineY1:number,lineX2:number,lineY2:number):yfiles.algorithms.YPoint; - /** - * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) < 0} - * @param p - * @param q - * @param r - * @returns - * @static - */ - static rightTurn(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean; - /** - * Returns +1 if point d lies left of the directed circle through points a, b, and c, 0 if a,b,c and d are cocircular, and - * -1 otherwise. - * @param a - * @param b - * @param c - * @param d - * @returns - * @static - */ - static sideOfCircle(a:yfiles.algorithms.YPoint,b:yfiles.algorithms.YPoint,c:yfiles.algorithms.YPoint,d:yfiles.algorithms.YPoint):number; - /** - * Converts the given degree value from radian to angular - * @param angrad - * @returns - * @static - */ - static toDegrees(angrad:number):number; - /** - * Converts the given degree value from angular to radian. - * @param angdeg - * @returns - * @static - */ - static toRadians(angdeg:number):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Geom; - } - /** - * This is an interface for a sequence of instances of LineSegment. - * @interface - * @implements {yfiles.algorithms.ICursor} - */ - export interface ILineSegmentCursor extends yfiles.lang.Object,yfiles.algorithms.ICursor{ - /** - * Gets the instance of LineSegment the cursor is currently pointing on. - * @abstract - * @type {yfiles.algorithms.LineSegment} - */ - lineSegment:yfiles.algorithms.LineSegment; - } - var ILineSegmentCursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.ILineSegmentCursor; - }; - /** - * This interface describes a 2-dimensional object which has a finite bounding box. - * @interface - */ - export interface IPlaneObject extends yfiles.lang.Object{ - /** - * Gets the smallest Rectangle which contains the object. - * @abstract - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - } - var IPlaneObject:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IPlaneObject; - }; - /** - * This is an interface for a sequence of instances of YPoint. - * @interface - * @implements {yfiles.algorithms.ICursor} - */ - export interface IPointCursor extends yfiles.lang.Object,yfiles.algorithms.ICursor{ - /** - * Gets the instance of YPoint the cursor is currently pointing on. - * @abstract - * @type {yfiles.algorithms.YPoint} - */ - point:yfiles.algorithms.YPoint; - } - var IPointCursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IPointCursor; - }; - /** - * Double-precision immutable insets representation. - * @class - * @implements {yfiles.lang.ICloneable} - */ - export interface Insets extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Insets { - /** - * Creates a new instance with the given values - * @param top The new top inset value - * @param left The new left inset value - * @param bottom The new bottom inset value - * @param right The new right inset value - */ - constructor(top:number,left:number,bottom:number,right:number); - /** - * - * @returns - */ - clone():any; - /** - * Creates a {@link yfiles.geometry.Insets} from a given {@link yfiles.algorithms.Insets}. - * @returns The {@link }. - */ - toInsets():yfiles.geometry.Insets; - /** - * The inset from the top. - * @const - * @type {number} - */ - top:number; - /** - * The inset from the left. - * @const - * @type {number} - */ - left:number; - /** - * The inset from the bottom. - * @const - * @type {number} - */ - bottom:number; - /** - * The inset from the right. - * @const - * @type {number} - */ - right:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Insets; - } - /** - * An instance of this interface handles intersections found by the IntersectionAlgorithm, - * @interface - */ - export interface IIntersectionHandler extends yfiles.lang.Object{ - /** - * This method is called at every intersection. - * @param a - * @param b - * @abstract - */ - checkIntersection(a:any,b:any):void; - } - var IIntersectionHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IIntersectionHandler; - }; - /** - * This class calculates the intersection of rectangles in the plane with the help of a sweep-line algorithm. - *

- *
The complexity is O(n log n + s) where n is the number of rectangles and s the number of intersections. - *

- * @class - * @static - */ - export interface IntersectionAlgorithm extends yfiles.lang.Object{} - export class IntersectionAlgorithm { - /** - * Calculates the intersections of rectangles in the plane. - *

- * Every found intersection is reported to an - * IntersectionHandler. Rectangles with negative size are completely ignored by this implementation (i.e. never generate - * intersections) - *

- * @param objects a list of PlaneObject objects. - * @param iHandler intersections are reported to this class. - * @static - */ - static intersect(objects:yfiles.algorithms.YList,iHandler:yfiles.algorithms.IIntersectionHandler):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.IntersectionAlgorithm; - } - /** - * This class represents a line segment in the plane. - *

- * A line segment is defined by its two end points. - *

- * @class - * @implements {yfiles.algorithms.IPlaneObject} - */ - export interface LineSegment extends yfiles.lang.Object,yfiles.algorithms.IPlaneObject{} - export class LineSegment { - /** - * Returns a new LineSegment. - * @param p1 the first end point of the line segment. - * @param p2 the second end point of the line segment. - */ - constructor(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint); - /** - * Checks whether a line segment intersects a paraxial box. - *

- * Implemented using the Cohen-Sutherland algorithm. - *

- * @param boxX1 x-coordinate of the upper left corner of the box - * @param boxY1 y-coordinate of the upper left corner of the box - * @param boxX2 x-coordinate of the lower right corner of the box - * @param boxY2 y-coordinate of the lower right corner of the box - * @param sX1 x-coordinate of the first end point of the line segment - * @param sY1 y-coordinate of the first end point of the line segment - * @param sX2 x-coordinate of the second end point of the line segment - * @param sY2 y-coordinate of the second end point of the line segment - * @returns true if the line segment intersects the box, false otherwise. - * @static - */ - static boxIntersectsSegment(boxX1:number,boxY1:number,boxX2:number,boxY2:number,sX1:number,sY1:number,sX2:number,sY2:number):boolean; - /** - * Checks whether a line segment intersects a box. - *

- * Implemented using the Cohen-Sutherland algorithm. - *

- * @param box A rectangle - * @param x1 x-coordinate of the first end point of the line segment - * @param y1 y-coordinate of the first end point of the line segment - * @param x2 x-coordinate of the second end point of the line segment - * @param y2 y-coordinate of the second end point of the line segment - * @returns true if the line segment intersects the box, false otherwise. - * @static - */ - static boxIntersectsSegment(box:yfiles.algorithms.YRectangle,x1:number,y1:number,x2:number,y2:number):boolean; - /** - * Checks whether a line segment intersects a box. - * @param box A rectangle. - * @param s first end point of the line segment. - * @param t second end point of the line segment. - * @returns true if the line segments intersects the box, false otherwise. - * @static - */ - static boxIntersectsSegment(box:yfiles.algorithms.YRectangle,s:yfiles.algorithms.YPoint,t:yfiles.algorithms.YPoint):boolean; - /** - * Checks whether a given point lies on this line segment. - * @param point an arbitrary point. - * @returns true if the line segments intersects the box, false otherwise. - */ - contains(point:yfiles.algorithms.YPoint):boolean; - /** - * Returns intersection point between the two line segments, if there is one or null if the two line segments do not - * intersect. - * @param s1 first line segment - * @param s2 second line segment - * @returns - * @static - */ - static getIntersection(s1:yfiles.algorithms.LineSegment,s2:yfiles.algorithms.LineSegment):yfiles.algorithms.YPoint; - /** - * Checks whether the line segment intersects a point. - * @param p a point - * @returns true if the line segments intersects the given point, false otherwise. - */ - intersects(p:yfiles.algorithms.YPoint):boolean; - /** - * Checks whether the line segment intersects a box. - * @param box A rectangle. - * @returns true if the line segments intersects the box, false otherwise. - */ - intersects(box:yfiles.algorithms.YRectangle):boolean; - /** - * Determines if the given points define a horizontal line segment. - *

- * This methods allows for y-coordinate differences of up to 1e-8. - *

- * @param p1 - * @param p2 - * @returns true if the given points define a horizontal line segment; false otherwise. - * @static - */ - static isHorizontalSegment(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):boolean; - /** - * Returns if the projection on the X axis of the line segment covers a certain point on the X Axis. - * @param x - * @returns - */ - isInXIntervall(x:number):boolean; - /** - * Returns if the projection on the Y axis of the line segment covers a certain point on the Y Axis. - * @param y - * @returns - */ - isInYIntervall(y:number):boolean; - /** - * Determines if the given points define a vertical line segment. - *

- * This methods allows for x-coordinate differences of up to 1e-8. - *

- * @param p1 - * @param p2 - * @returns true if the given points define a vertical line segment; false otherwise. - * @static - */ - static isVerticalSegment(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):boolean; - /** - * Returns the length of the line segment, this is the value of the Euclidean norm. - * @returns an value > 0. - */ - length():number; - /** - * Returns the affine line defined by the end points of the line segment. - * @returns - */ - toAffineLine():yfiles.algorithms.AffineLine; - /** - * Returns the vector pointing from the first end point to the second end point of the line segment. - * @returns - */ - toYVector():yfiles.algorithms.YVector; - /** - * Gets if this segment is considered vertical, i.e. - *

- * the x values of the end point differ less then 0.00000001 - *

- * @type {boolean} - */ - isVertical:boolean; - /** - * Gets if the interval is horizontal. - * @type {boolean} - */ - isHorizontal:boolean; - /** - * Gets the first end point of the line segment. - * @type {yfiles.algorithms.YPoint} - */ - firstEndPoint:yfiles.algorithms.YPoint; - /** - * Gets the second end point of the line segment. - * @type {yfiles.algorithms.YPoint} - */ - secondEndPoint:yfiles.algorithms.YPoint; - /** - * Gets the y value of the line on x coordinate 0. - * @type {number} - */ - xOffset:number; - /** - * Gets the slope of the line segment. - * @type {number} - */ - slope:number; - /** - * Gets the smallest Rectangle which contains the object. - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - /** - * Gets the distance from start to end point in x-coordinates. - * @type {number} - */ - deltaX:number; - /** - * Gets the distance from start to end point in y-coordinates. - * @type {number} - */ - deltaY:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.LineSegment; - } - /** - * Represents a two-dimensional point located at (x, y). - * @class - * @implements {yfiles.lang.ICloneable} - */ - export interface Point2D extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Point2D { - /** - * Creates a new instance at the given location. - * @param x The x coordinate of the new point - * @param y The x coordinate of the new point - */ - constructor(x:number,y:number); - /** - * Creates a new instance that is located at (0, 0) - */ - constructor(); - /** - * Creates a new instance of this class that has the same values as this objects. - * @returns a new instance of this class that has the same values as this objects. - */ - clone():any; - /** - * Calculates the distance between this points and another one, given as its coordinates. - * @param px The x coordinate of the second point. - * @param py The y coordinate of the second point. - * @returns the distance between this points and another one, given as its coordinates. - */ - distance(px:number,py:number):number; - /** - * Calculates the distance between this points and another one. - * @param p The second point. - * @returns the distance between this points and another one. - */ - distance(p:yfiles.algorithms.Point2D):number; - /** - * Calculates the distance between two points, given as their coordinates. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - * @returns the distance between two points, given as their coordinates. - * @static - */ - static distance(x1:number,y1:number,x2:number,y2:number):number; - /** - * Calculates the squared distance between this points and another one, given as its coordinates. - * @param px The x coordinate of the second point. - * @param py The y coordinate of the second point. - * @returns the squared distance between this points and another one, given as its coordinates. - */ - distanceSq(px:number,py:number):number; - /** - * Calculates the squared distance between this points and another one. - * @param p The second point. - * @returns the squared distance between this points and another one. - */ - distanceSq(p:yfiles.algorithms.Point2D):number; - /** - * Calculates the squared distance between two points, given as their coordinates. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - * @returns the squared distance between two points, given as their coordinates. - * @static - */ - static distanceSq(x1:number,y1:number,x2:number,y2:number):number; - /** - * Sets the location of this point to the given coordinates. - * @param x the new x coordinate - * @param y the new y coordinate - */ - setLocation(x:number,y:number):void; - /** - * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.Point2D}. - * @returns The {@link }. - */ - toPoint():yfiles.geometry.Point; - /** - * Sets the location of this point to the same values as for the given point. - * @type {yfiles.algorithms.Point2D} - */ - location:yfiles.algorithms.Point2D; - /** - * Gets the x coordinate of this point. - * @type {number} - */ - x:number; - /** - * Gets the y coordinate of this point. - * @type {number} - */ - y:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Point2D; - } - /** - * Represents a two-dimensional rectangle of size (width x height), located at the point (x, y). - * @class - * @implements {yfiles.lang.ICloneable} - */ - export interface Rectangle2D extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Rectangle2D { - /** - * Creates a new rectangle of the specified size at the specified location. - * @param x the x-coordinate of the upper left corner of the created rectangle. - * @param y the y-coordinate of the upper left corner of the created rectangle. - * @param width the width of the created rectangle. - * @param height the height of the created rectangle. - */ - constructor(x:number,y:number,width:number,height:number); - /** - * Creates a new rectangle of size (0 x 0) at the location (0, 0). - */ - constructor(); - /** - * Adds a point, specified by its coordinates, to this rectangle. - *

- * The rectangle will be grown if necessary. Note that for points that would lie on the right or bottom border of the - * rectangle, {@link yfiles.algorithms.Rectangle2D#contains} will still return false for the added point. - *

- * @param px the x coordinate of the point to add - * @param py the y coordinate of the point to add - */ - add(px:number,py:number):void; - /** - * Adds a rectangle to this rectangle. - *

- * The rectangle will be grown to the union of both rectangles - *

- * @param r the rectangle to add - */ - add(r:yfiles.algorithms.Rectangle2D):void; - /** - * Creates a new instance of this class that has the same values as this objects. - * @returns a new instance of this class that has the same values as this objects. - */ - clone():any; - /** - * Checks whether this rectangle completely contains the second specified rectangle. - * @param x the x coordinate of the second rectangle. - * @param y the y coordinate of the second rectangle. - * @param width the width coordinate of the second rectangle. - * @param height the height coordinate of the second rectangle. - * @returns true if this rectangle contains the second one - */ - contains(x:number,y:number,width:number,height:number):boolean; - /** - * Checks if the point specified by the given coordinates is contained in this rectangle. - * @param x the x-coordinate of the point. - * @param y the y-coordinate of the point. - * @returns true if the specified point is contained in this rectangle; false otherwise. - */ - contains(x:number,y:number):boolean; - /** - * Checks whether this rectangle completely contains the second specified rectangle. - * @param rect the rectangle to check for containment - * @returns true if this rectangle contains the second one - */ - contains(rect:yfiles.algorithms.Rectangle2D):boolean; - /** - * Calculates the intersection of this rectangle with the given rectangle and returns the result as new rectangle. - * @param r a rectangle to intersect with this rectangle. - * @returns a new rectangle that represents the calculated intersection. - */ - createIntersection(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Calculates the union of this rectangle with the given rectangle and returns the result as new rectangle. - * @param r a rectangle to union with this rectangle. - * @returns a new rectangle that represents the calculated union. - */ - createUnion(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Calculates the intersection of the first and second specified rectangle and sets the resulting location and size to the - * third rectangle. - * @param src1 the first rectangle to intersect. - * @param src2 the second rectangle to intersect. - * @param dst the rectangle to which the result is set. - * @static - */ - static intersect(src1:yfiles.algorithms.Rectangle2D,src2:yfiles.algorithms.Rectangle2D,dst:yfiles.algorithms.Rectangle2D):void; - /** - * Checks whether this rectangle and the second specified rectangle intersect. - * @param x the x coordinate of the second rectangle. - * @param y the y coordinate of the second rectangle. - * @param width the width coordinate of the second rectangle. - * @param height the height coordinate of the second rectangle. - * @returns true if both rectangles intersect - */ - intersects(x:number,y:number,width:number,height:number):boolean; - /** - * Checks whether this rectangle and the second specified rectangle intersect. - * @param rect the rectangle to check for intersection - * @returns true if both rectangles intersect - */ - intersects(rect:yfiles.algorithms.Rectangle2D):boolean; - /** - * Checks if the line segment specified by the given coordinates intersects this rectangle. - * @param x1 the x-coordinate of the first end point of the line. - * @param y1 the y-coordinate of the first end point of the line. - * @param x2 the x-coordinate of the other end point of the line. - * @param y2 the y-coordinate of the other end point of the line. - * @returns true if the specified line intersects this rectangle; false otherwise. - */ - intersectsLine(x1:number,y1:number,x2:number,y2:number):boolean; - /** - * Sets the outer bounds of this rectangle based on the specified location and size. - * @param x the new x-coordinate of the upper left corner. - * @param y the new y-coordinate of the upper left corner. - * @param width the new width. - * @param height the new height. - */ - setFrame(x:number,y:number,width:number,height:number):void; - /** - * Sets the outer bounds of this rectangle based on the specified new center and corner. - * @param centerX the x-coordinate of the new center of this rectangle. - * @param centerY the y-coordinate of the new center of this rectangle. - * @param cornerX the x-coordinate of any new corner of this rectangle. - * @param cornerY the y-coordinate of any new corner of this rectangle. - */ - setFrameFromCenter(centerX:number,centerY:number,cornerX:number,cornerY:number):void; - /** - * Sets the outer bounds of this rectangle based on the specified new center and corner. - * @param center the new center of this rectangle. - * @param corner any new corner of this rectangle. - */ - setFrameFromCenter(center:yfiles.algorithms.Point2D,corner:yfiles.algorithms.Point2D):void; - /** - * Sets the outer bounds of this rectangle based on the end points of one of its diagonals. - * @param x1 the x-coordinate of the first end point of a diagonal. - * @param y1 the y-coordinate of the first end point of a diagonal. - * @param x2 the x-coordinate of the other end point of a diagonal. - * @param y2 the y-coordinate of the other end point of a diagonal. - */ - setFrameFromDiagonal(x1:number,y1:number,x2:number,y2:number):void; - /** - * Sets the outer bounds of this rectangle based on the end points of one of its diagonals. - * @param p1 the first end point of a diagonal. - * @param p2 the other end point of a diagonal. - */ - setFrameFromDiagonal(p1:yfiles.algorithms.Point2D,p2:yfiles.algorithms.Point2D):void; - /** - * Sets the location and size of this rectangle to the specified values. - * @param x the new x-coordinate of the upper left corner. - * @param y the new y-coordinate of the upper left corner. - * @param width the new width. - * @param height the new height. - */ - setRect(x:number,y:number,width:number,height:number):void; - /** - * Creates a {@link yfiles.geometry.Rect} from a given {@link yfiles.algorithms.Rectangle2D}. - * @returns The {@link }. - */ - toRect():yfiles.geometry.Rect; - /** - * Calculates the union of the first and second specified rectangle and sets the resulting location and size to the third - * rectangle. - * @param src1 the first rectangle to union. - * @param src2 the second rectangle to union. - * @param dst the rectangle to which the result is set. - * @static - */ - static union(src1:yfiles.algorithms.Rectangle2D,src2:yfiles.algorithms.Rectangle2D,dst:yfiles.algorithms.Rectangle2D):void; - /** - * Gets or sets the outer bounds of this rectangle in double coordinates. - * @type {yfiles.algorithms.Rectangle2D} - */ - frame:yfiles.algorithms.Rectangle2D; - /** - * Sets the location and size of this rectangle to be similar to the specified rectangle. - * @type {yfiles.algorithms.Rectangle2D} - */ - rect:yfiles.algorithms.Rectangle2D; - /** - * Gets the x coordinate of the upper left corner. - * @type {number} - */ - x:number; - /** - * Gets the y coordinate of the upper left corner. - * @type {number} - */ - y:number; - /** - * Gets the width of this rectangle. - * @type {number} - */ - width:number; - /** - * Gets the height of this rectangle. - * @type {number} - */ - height:number; - /** - * Gets whether this instance is empty, i.e. - *

- * covers no area. - *

- * @type {boolean} - */ - empty:boolean; - /** - * Gets the smallest x coordinate of this rectangle. - * @type {number} - */ - minX:number; - /** - * Gets the smallest y coordinate of this rectangle. - * @type {number} - */ - minY:number; - /** - * Gets the largest x coordinate of this rectangle. - * @type {number} - */ - maxX:number; - /** - * Gets the largest y coordinate of this rectangle. - * @type {number} - */ - maxY:number; - /** - * Gets the x coordinate of the center point of this rectangle. - * @type {number} - */ - centerX:number; - /** - * Gets the y coordinate of the center point of this rectangle. - * @type {number} - */ - centerY:number; - /** - * Gets the bounds of this instance in double precision. - * @type {yfiles.algorithms.Rectangle2D} - */ - bounds2D:yfiles.algorithms.Rectangle2D; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Rectangle2D; - } - /** - * This class provides algorithms for the triangulation of point sets in the plane. - * @class - * @static - */ - export interface Triangulator extends yfiles.lang.Object{} - export class Triangulator { - /** - * Computes a Delauney triangulation of the given points. - *

- * A Delauney triangulation is a triangulation such that none of the given points is inside the circumcircle of any of the - * calculated triangles. - *

- *

- * The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the - * outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to - * construct all faces of the plane graph and to determine its outer face. - *

- * @param result a graph whose nodes represent the points that need to be triangulated. - * @param pointData must provide the location (YPoint) for each node in the given graph. - * @param revMap a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information - * will be available. - * @returns an edge on the outer face of the result graph. - * @static - */ - static calcDelauneyTriangulation(result:yfiles.algorithms.Graph,pointData:yfiles.algorithms.IDataProvider,revMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge; - /** - * Computes a triangulation of the given points. - *

- * The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the - * outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to - * construct all faces of the plane graph and to determine its outer face. - *

- * @param points the point set to be triangulated. The points must be provided as a YList of YPoints. - * @param result the resulting triangulation - * @param resultMap the node map that forms the link between a point and a node. - * @param reverseEdgeMap a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information - * will be available. - * @returns an edge on the outer face of the result graph. - * @static - */ - static triangulatePoints(points:yfiles.algorithms.YList,result:yfiles.algorithms.Graph,resultMap:yfiles.algorithms.INodeMap,reverseEdgeMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge; - /** - * Computes a triangulation of the given points. - *

- * The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the - * outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to - * construct all faces of the plane graph and to determine its outer face. - *

- * @param result a graph whose nodes represent the points that need to be triangulated. - * @param pointData must provide the location (YPoint) for each node in the given graph. - * @param reverseEdgeMap a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information - * will be available. - * @returns an edge on the outer face of the result graph. - * @static - */ - static triangulatePoints(result:yfiles.algorithms.Graph,pointData:yfiles.algorithms.IDataProvider,reverseEdgeMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Triangulator; - } - /** - * This class represents the size of an object. - *

- * An instance of this class implements the immutable design pattern. - *

- * @class - * @implements {yfiles.lang.IComparable} - */ - export interface YDimension extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class YDimension { - /** - * Creates a new YDimension2D object for given size. - * @param width - * @param height - */ - constructor(width:number,height:number); - /** - * - * @param o - * @returns - */ - compareTo(o:any):number; - /** - * Creates a {@link yfiles.geometry.Size} from a given {@link yfiles.algorithms.YDimension}. - * @returns The {@link }. - */ - toSize():yfiles.geometry.Size; - /** - * Gets the width of the dimension object. - * @type {number} - */ - width:number; - /** - * Gets the height of the dimension object. - * @type {number} - */ - height:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YDimension; - } - /** - * An oriented rectangle in 2D coordinate space with double precision coordinates. - *

- * The rectangle's height extends from its {@link yfiles.algorithms.YOrientedRectangle#anchor anchor point} in the direction of its up - * vector ({@link yfiles.algorithms.YOrientedRectangle#upX ux}, {@link yfiles.algorithms.YOrientedRectangle#upY uy}). Its width extends from its {@link yfiles.algorithms.YOrientedRectangle#anchor anchor point} in - * direction (-uy, ux) (i.e. perpendicular to the up vector). This means that an oriented rectangle with anchor point (0, 0) width - * 100, height 10, and up vector (0, -1) is a paraxial rectangle with upper left corner (0, -10) and lower right corner - * (100, 0). - *

- * @class - * @implements {yfiles.algorithms.IPlaneObject} - */ - export interface YOrientedRectangle extends yfiles.lang.Object,yfiles.algorithms.IPlaneObject{} - export class YOrientedRectangle { - /** - * Creates a new instance using the provided rectangle's values to initialize anchor, size, and up vector. - * @param rect the provided rectangle. - */ - constructor(rect:yfiles.algorithms.YOrientedRectangle); - /** - * Creates a new instance using the provided rectangle's values to initialize anchor and size. - *

- * The oriented rectangle's up vector will be (0, -1). - *

- * @param rect the provided rectangle. - */ - constructor(rect:yfiles.algorithms.YRectangle); - /** - * Creates a new instance using the provided values to initialize anchor, size, and up vector. - * @param anchorX The x coordinate of the anchor of the oriented rectangle. - * @param anchorY The y coordinate of the anchor of the oriented rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - * @param upX The x component of the up vector. - * @param upY The y component of the up vector. - */ - constructor(anchorX:number,anchorY:number,width:number,height:number,upX:number,upY:number); - /** - * Creates a new instance using the provided values to initialize anchor and size. - *

- * The oriented rectangle's up vector will be (0, -1). - *

- * @param anchorX The x coordinate of the anchor of the oriented rectangle. - * @param anchorY The y coordinate of the anchor of the oriented rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - */ - constructor(anchorX:number,anchorY:number,width:number,height:number); - /** - * Creates a new instance using the provided values to initialize anchor, size, and up vector. - * @param position The provider for the dynamic anchor of this instance. - * @param size The provider for the dynamic size of this instance. - * @param upVector The up vector. - */ - constructor(position:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,upVector:yfiles.algorithms.YVector); - /** - * Creates a new instance using the provided values to initialize the anchor and size. - *

- * The oriented rectangle's up vector will be (0, -1). - *

- * @param anchor The provider for the dynamic anchor of this instance. - * @param size The provider for the dynamic size of this instance. - */ - constructor(anchor:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension); - /** - * Copies the actual values from the given OrientedRectangle to this instance. - * @param other the OrientedRectangle to retrieve the values from - */ - adoptValues(other:yfiles.algorithms.YOrientedRectangle):void; - /** - * Determines the four corner points of an oriented rectangle. - * @param rect The rectangle to determine the bounds. - * @returns the array of corner points. - * @static - */ - static calcPoints(rect:yfiles.algorithms.YOrientedRectangle):yfiles.algorithms.YPoint[]; - /** - * Determines the coordinates of the four corners of an oriented rectangle. - * @param rect The rectangle to determine the bounds. - * @returns the array of coordinates of the corner points in which each even index has the x-coordinate and each odd index the - * y-coordinate - * @static - */ - static calcPointsInDouble(rect:yfiles.algorithms.YOrientedRectangle):number[]; - /** - * Determines whether or not the specified point lies inside this oriented rectangle. - * @param x the x-coordinate of the point to check. - * @param y the y-coordinate of the point to check. - * @param [closed=false] if true, all points on the border of the rectangle are considered to be contained. - * @returns true iff the specified point lies inside; false otherwise. - */ - contains(x:number,y:number,closed?:boolean):boolean; - /** - * Determines whether the given rectangle r1 contains rectangle r2, using an epsilon value. - * @param r1 The first rectangle. - * @param r2 The second rectangle. - * @param eps A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns true iff the r1 contains r2. - * @static - */ - static contains(r1:yfiles.algorithms.YOrientedRectangle,r2:yfiles.algorithms.YOrientedRectangle,eps:number):boolean; - /** - * Determines whether the given oriented rectangle contains the provided point, using an epsilon value. - * @param rect The rectangle. - * @param p The point to test. - * @param eps fuzziness range. A positive value allows for fuzzy hit testing. If a point lies outside the given rectangle, but its - * distance is less than or equal to that value, it will be considered a hit. - * @returns true if the point lies inside the rectangle; false otherwise. - * @static - */ - static contains(rect:yfiles.algorithms.YOrientedRectangle,p:yfiles.algorithms.YPoint,eps:number):boolean; - /** - * Determines whether the given oriented rectangle contains the provided point, using an epsilon value. - * @param rect The rectangle. - * @param x x-coordinate of the point to test. - * @param y y-coordinate of the point to test. - * @param eps fuzziness range. A positive value allows for fuzzy hit testing. If a point lies outside the given rectangle, but its - * distance is less than or equal to that value, it will be considered a hit. - * @returns true if the point lies inside the rectangle; false otherwise. - * @static - */ - static contains(rect:yfiles.algorithms.YOrientedRectangle,x:number,y:number,eps:number):boolean; - /** - * Creates a new OrientedRectangle instance whose anchor point is moved by the specified distance values, but has the same - * width, height, and up vector as this rectangle. - * @param dx the distance to move the anchor point in x-direction. A positive value means "move" to the right, a negative value means - * "move" to the left. - * @param dy the distance to move the anchor point in y-direction. A positive value means "move" downwards, a negative value means - * "move" upwards. - * @returns a new OrientedRectangle instance whose anchor point is moved by the specified distance values. - */ - getMovedInstance(dx:number,dy:number):yfiles.algorithms.YOrientedRectangle; - /** - * Creates a new OrientedRectangle instance that has the specified width and height, but has the same anchor point and up - * vector as this rectangle. - * @param width the width of the new rectangle. - * @param height the height of the new rectangle. - * @returns a new OrientedRectangle instance that has the specified width and height. - */ - getResizedInstance(width:number,height:number):yfiles.algorithms.YOrientedRectangle; - /** - * Determines an intersection point of the specified oriented rectangle and the specified line segment. - *

- * Note: there might be more than one intersection point. However this method only returns one intersection point or null - * if there is no intersection. - *

- * @param rect - * @param line - * @param eps - * @returns an intersection point of the specified oriented rectangle and the specified line segment or null if the rectangle and - * the segment do not intersect. - * @static - */ - static intersectionPoint(rect:yfiles.algorithms.YOrientedRectangle,line:yfiles.algorithms.LineSegment,eps:number):yfiles.algorithms.YPoint; - /** - * Determines whether or not the specified oriented rectangle and the specified line segment intersect. - * @param rect - * @param line - * @param eps - * @returns true if the rectangle and the segment intersect and false otherwise. - * @static - */ - static intersects(rect:yfiles.algorithms.YOrientedRectangle,line:yfiles.algorithms.LineSegment,eps:number):boolean; - /** - * Determines whether a rectangle intersects an oriented rectangle, given an epsilon. - * @param orientedRectangle The oriented rectangle to test. - * @param rectangle The rectangle to test. - * @param eps A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns Whether they have a non-empty intersection. - * @static - */ - static intersects(orientedRectangle:yfiles.algorithms.YOrientedRectangle,rectangle:yfiles.algorithms.YRectangle,eps:number):boolean; - /** - * Moves this rectangle by applying the offset to the anchor. - * @param dx The x offset to move the rectangle's position by. - * @param dy The y offset to move the rectangle's position by. - */ - moveBy(dx:number,dy:number):void; - /** - * Sets the anchor of this rectangle. - * @param x the new x-coordinate of the anchor point. - * @param y the new y-coordinate of the anchor point. - */ - setAnchor(x:number,y:number):void; - /** - * Sets the anchor of the OrientedRectangle so that the center of the rectangle coincides with the given coordinate pair. - * @param cx The x coordinate of the center. - * @param cy The y coordinate of the center. - */ - setCenter(cx:number,cy:number):void; - /** - * Sets the size of this rectangle. - * @param width the new width. - * @param height the new height. - */ - setSize(width:number,height:number):void; - /** - * Sets the components of the up vector to the new values. - * @param upX The x component of the normalized up vector. - * @param upY The y component of the normalized up vector. - */ - setUpVector(upX:number,upY:number):void; - /** - * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} from a given {@link yfiles.algorithms.YOrientedRectangle}. - * @returns The {@link }. - */ - toImmutableOrientedRectangle():yfiles.geometry.IOrientedRectangle; - /** - * Gets whether this instance has negative width or height. - * @type {boolean} - */ - empty:boolean; - /** - * Gets or sets the anchor of this oriented rectangle. - * @type {yfiles.algorithms.YPoint} - */ - anchor:yfiles.algorithms.YPoint; - /** - * Gets the x-coordinate of this rectangle's anchor point. - * @type {number} - */ - anchorX:number; - /** - * Gets the y-coordinate of this rectangle's anchor point. - * @type {number} - */ - anchorY:number; - /** - * Gets or sets the size of this rectangle. - * @type {yfiles.algorithms.YDimension} - */ - size:yfiles.algorithms.YDimension; - /** - * Gets the width of this rectangle. - * @type {number} - */ - width:number; - /** - * Gets the height of this rectangle. - * @type {number} - */ - height:number; - /** - * Gets the x-component of this rectangle's up vector. - * @type {number} - */ - upX:number; - /** - * Gets the y-component of this rectangle's up vector. - * @type {number} - */ - upY:number; - /** - * Gets or sets the angle (measured in radians) of this rectangle. - *

- * The angle of an oriented rectangle is the angle between the vector (0, -1) and the rectangle's up vector in counter - * clockwise order. An angle of 0 means the up vector points up in direction (0, -1). - *

- * @type {number} - */ - angle:number; - /** - * Gets or sets the current center of the oriented rectangle. - * @type {yfiles.algorithms.YPoint} - */ - center:yfiles.algorithms.YPoint; - /** - * Calculates the paraxial bounding box of this oriented rectangle. - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YOrientedRectangle; - } - /** - * This class represents a point in the plane with double coordinates. - *

- * This class implements the immutable design pattern. - *

- * @class - * @implements {yfiles.lang.IComparable} - * @final - */ - export interface YPoint extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class YPoint { - /** - * Creates a new YPoint object for a given position. - * @param x the x coordinate of the point. - * @param y the y coordinate of the point. - */ - constructor(x:number,y:number); - /** - * Creates a new YPoint at location (0,0) - */ - constructor(); - /** - * Adds two points and returns the result. - * @param p1 an arbitrary instance of YPoint. - * @param p2 an arbitrary instance of YPoint. - * @returns - * @static - */ - static add(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Comparable implementation. - *

- * YPoints are ordered by ascending x-coordinates. If the x-coordinates of two points equal, then these points are ordered - * by ascending y-coordinates. - *

- * @param o - * @returns - */ - compareTo(o:any):number; - /** - * Returns the euclidean distance between two points. - * @param x1 x-coordinate of first point - * @param y1 y-coordinate of first point - * @param x2 x-coordinate of second point - * @param y2 y-coordinate of second point - * @returns the euclidean distance between first and second point - * @static - */ - static distance(x1:number,y1:number,x2:number,y2:number):number; - /** - * Returns the euclidean distance between two points. - * @param p1 an arbitrary point - * @param p2 an arbitrary point - * @returns the Euclidean distance between p1 and p2. - * @static - */ - static distance(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):number; - /** - * Returns the euclidean distance between this point and a given point. - * @param x the x coordinate of an arbitrary point - * @param y the y coordinate of an arbitrary point - * @returns the Euclidean distance between this point and the point (x,y). - */ - distanceTo(x:number,y:number):number; - /** - * Returns the euclidean distance between this point and a given point. - * @param p an arbitrary point - * @returns the Euclidean distance between this point and p. - */ - distanceTo(p:yfiles.algorithms.YPoint):number; - /** - * Returns a point that geometrically lies in in the middle of the line formed by the given points. - * @param p1 an arbitrary instance of YPoint. - * @param p2 an arbitrary instance of YPoint. - * @returns - * @static - */ - static midPoint(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Returns the point, got by moving this point to another position. - * @param x the value which is added on the x-coordinate of the point. - * @param y the value which is added on the y-coordinate of the point. - * @returns a new instance of YPoint which is the result of the moving operation. - */ - moveBy(x:number,y:number):yfiles.algorithms.YPoint; - /** - * Subtracts two points (p1 - p2) and returns the result. - * @param p1 an arbitrary instance of YPoint. - * @param p2 an arbitrary instance of YPoint. - * @returns - * @static - */ - static subtract(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Returns a copy of the given point with exchanged x- and y-coordinates. - * @param p an arbitrary instance of YPoint. - * @returns - * @static - */ - static swap(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.YPoint}. - * @returns The {@link }. - */ - toPoint():yfiles.geometry.Point; - /** - * A YPoint constant with coordinates (0,0). - * @const - * @static - * @type {yfiles.algorithms.YPoint} - */ - static ORIGIN:yfiles.algorithms.YPoint; - /** - * Gets the x-coordinate of the point object. - * @type {number} - */ - x:number; - /** - * Gets the y-coordinate of the point object. - * @type {number} - */ - y:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YPoint; - } - /** - * This class represents an ordered list of points in the plane. - * @class - * @final - */ - export interface YPointPath extends yfiles.lang.Object{} - export class YPointPath { - /** - * Creates a new path from an array of points. - * @param path - */ - constructor(path:yfiles.algorithms.YPoint[]); - /** - * Creates a new path from a list of points. - * @param l a list of {@link } instances. - */ - constructor(l:yfiles.collections.IList); - /** - * Creates a new empty path. - */ - constructor(); - /** - * Calculate the (geometric) length of the path. - *

- * The length of the path is the sum of lengths of all line segments making up the path. - *

- * @returns the (geometric) length of the path - */ - calculateLength():number; - /** - * Create a point path with reverse ordering of the points. - * @returns - */ - createReverse():yfiles.algorithms.YPointPath; - /** - * Get the points in the path. - * @returns - */ - cursor():yfiles.algorithms.ICursor; - /** - * Returns a line segment in the path. - * @param i - * @returns - */ - getLineSegment(i:number):yfiles.algorithms.LineSegment; - /** - * Get the number of points in the path. - * @returns - */ - length():number; - /** - * Get the points in the path. - * @returns - */ - lineSegments():yfiles.algorithms.ILineSegmentCursor; - /** - * Get the points in the path. - * @returns - */ - points():yfiles.algorithms.IPointCursor; - /** - * Get the points in the list as array. - * @returns - */ - toArray():yfiles.algorithms.YPoint[]; - /** - * Get the points in the path as list. - * @returns a list of {@link } instances. - */ - toList():yfiles.collections.IList; - /** - * Defines a path with no points. - * @const - * @static - * @type {yfiles.algorithms.YPointPath} - */ - static EMPTY_PATH:yfiles.algorithms.YPointPath; - /** - * Gets the first point in the path. - * @type {yfiles.algorithms.YPoint} - */ - first:yfiles.algorithms.YPoint; - /** - * Gets the last point in the path. - * @type {yfiles.algorithms.YPoint} - */ - last:yfiles.algorithms.YPoint; - /** - * Gets the number of line segments in the path. - * @type {number} - */ - lineSegmentCount:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YPointPath; - } - /** - * This class defines a rectangle and provides utility methods for it. - * @class - * @extends {yfiles.algorithms.YDimension} - * @implements {yfiles.algorithms.IPlaneObject} - */ - export interface YRectangle extends yfiles.algorithms.YDimension,yfiles.algorithms.IPlaneObject{} - export class YRectangle { - /** - * Creates a new rectangle with given upper left corner and size. - * @param x x-coordinate of upper left corner of the rectangle. - * @param y y-coordinate of upper left corner of the rectangle. - * @param width width of the rectangle. - * @param height height of the rectangle. - */ - constructor(x:number,y:number,width:number,height:number); - /** - * Creates a new rectangle with given upper left corner and size. - * @param pos upper left corner of the rectangle. - * @param size size of the rectangle. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension); - /** - * Creates a new rectangle with upper left corner (0,0) and size (0,0). - */ - constructor(); - /** - * Checks whether or not this YRectangle contains the given rectangle. - * @param p - * @returns - */ - contains(p:yfiles.algorithms.YRectangle):boolean; - /** - * Checks whether or not this YRectangle contains the given point. - * @param p - * @returns - */ - contains(p:yfiles.algorithms.YPoint):boolean; - /** - * Checks whether or not this YRectangle contains the rectangle defined by the given frame. - * @param x - * @param y - * @param width - * @param height - * @returns - */ - contains(x:number,y:number,width:number,height:number):boolean; - /** - * Checks whether or not this YRectangle contains the given point. - * @param x the x-coordinate of the point to check. - * @param y the x-coordinate of the point to check. - * @returns true if the point lies inside the rectangle; false otherwise. - */ - contains(x:number,y:number):boolean; - /** - * Determines whether the specified rectangle contains the specified point. - * @param rx the x-coordinate of the upper left corner of the rectangle. - * @param ry the y-coordinate of the upper left corner of the rectangle. - * @param rw the width of the rectangle. - * @param rh the height of the rectangle. - * @param x the x-coordinate of the point to check. - * @param y the x-coordinate of the point to check. - * @param [closed=false] if true, all points on the border of the rectangle are considered to be contained. - * @returns true if the point lies inside the rectangle; false otherwise. - * @static - */ - static contains(rx:number,ry:number,rw:number,rh:number,x:number,y:number,closed?:boolean):boolean; - /** - * Returns the Euclidean distance to the passed rectangle. - *

- * If they overlap, the distance is 0. - *

- * @param other the second rectangle. - * @returns the distance to the given rectangle. - */ - getEuclideanDistance(other:yfiles.algorithms.YRectangle):number; - /** - * Returns the Manhattan distance to the passed rectangle. - *

- * If they overlap the distance is 0. - *

- * @param other the second rectangle. - * @returns the distance to the given rectangle. - */ - getManhattanDistance(other:yfiles.algorithms.YRectangle):number; - /** - * Returns whether or not the given rectangles intersect. - * @param r1 - * @param r2 - * @returns - * @static - */ - static intersects(r1:yfiles.algorithms.YRectangle,r2:yfiles.algorithms.YRectangle):boolean; - /** - * Creates a {@link yfiles.geometry.Rect} from a given {@link yfiles.algorithms.YRectangle}. - * @returns The {@link }. - */ - toRect():yfiles.geometry.Rect; - /** - * Gets x-coordinate of upper left corner. - * @type {number} - */ - x:number; - /** - * Gets y-coordinate of upper left corner. - * @type {number} - */ - y:number; - /** - * Gets coordinates of upper left corner. - * @type {yfiles.algorithms.YPoint} - */ - location:yfiles.algorithms.YPoint; - /** - * Gets this object. - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YRectangle; - } - /** - * This class represents a vector in the 2-dimensional real vector space. - *

- * This vector is an ordered 2 tuple and is defined by two doubles. - *

- * @class - */ - export interface YVector extends yfiles.lang.Object{} - export class YVector { - /** - * Creates a new vector, whose direction is given by two points. - *

- * The vector is defined by p1 - p2. - *

- * @param p1 The first point. - * @param [p2=null] The second point. If no point is spcified, (0,0) is used instead. - */ - constructor(p1:yfiles.algorithms.YPoint,p2?:yfiles.algorithms.YPoint); - /** - * Creates a new vector which is a copy of another vector. - * @param v the vector, whose values are copied. - */ - constructor(v:yfiles.algorithms.YVector); - /** - * Creates a new vector, whose direction is given by two points. - *

- * The vector is defined by (x1 - x2, y1 - y2). - *

- * @param x1 the X-coordinate of the first point. - * @param y1 the Y-coordinate of the first point. - * @param x2 the X-coordinate of the second point. - * @param y2 the Y-coordinate of the second point. - */ - constructor(x1:number,y1:number,x2:number,y2:number); - /** - * Creates a new vector with given direction. - * @param dx the first coordinate - * @param dy the second coordinate - */ - constructor(dx:number,dy:number); - /** - * Adds a vector to this vector. - * @param v the vector to add. - */ - add(v:yfiles.algorithms.YVector):void; - /** - * Adds the vector to a point and returns the resulting point. - * @param p a point. - * @param v the vector to add to the point. - * @returns p+v - * @static - */ - static add(p:yfiles.algorithms.YPoint,v:yfiles.algorithms.YVector):yfiles.algorithms.YPoint; - /** - * Adds two vectors and returns the result. - * @param v first vector to sum. - * @param w second vector to sum. - * @returns v+w - * @static - */ - static add(v:yfiles.algorithms.YVector,w:yfiles.algorithms.YVector):yfiles.algorithms.YVector; - /** - * Returns the result of the addition of two angles between 0 and 2*Pi. - *

- * The result is calculated modulo 2*Pi. - *

- * @param a1 a value in [0,2Pi). - * @param a2 a value in [0,2Pi). - * @returns The sum of a1 and a2 modulo 2*Pi. - * @static - */ - static addAngle(a1:number,a2:number):number; - /** - * Returns the angle (measured in radians) between two vectors in clockwise order (with regards to screen coordinates) from - * v1 to v2. - *

- * Screen coordinates mean positive x-direction is from left to right and positive y-direction is from top to bottom. - *

- * @param v1 - * @param v2 - * @returns - * @static - */ - static angle(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):number; - /** - * Returns this vector with unit length. - * @param v - * @returns - * @static - */ - static getNormal(v:yfiles.algorithms.YVector):yfiles.algorithms.YVector; - /** - * Returns the length of the vector, this is the value of the euclidean norm. - * @returns a value > 0. - */ - length():number; - /** - * Assigns unit length to the vector. - *
- */ - norm():void; - /** - * Returns the vector which is orthogonal to the given one and has unit length. - * @param v a vector. - * @returns a vector which is orthogonal to v with unit length. - * @static - */ - static orthoNormal(v:yfiles.algorithms.YVector):yfiles.algorithms.YVector; - /** - * Returns true if vector v1 is on the right side of v2. - * @param v1 - * @param v2 - * @returns - * @static - */ - static rightOf(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):boolean; - /** - * Returns a new YVector instance that is obtained by rotating this vector by the given angle (measured in radians) in - * clockwise direction (with regards to screen coordinates). - *

- * Screen coordinates mean positive x-direction is from left to right and positive y-direction is from top to bottom. - *

- * @param angle the angle of rotation in radians. - * @returns the rotated vector. - */ - rotate(angle:number):yfiles.algorithms.YVector; - /** - * Returns the value of the scalar product of two vectors. - * @param v1 the first vector. - * @param v2 the second vector. - * @returns v1.x * v2.x + v1.y * v2.y - * @static - */ - static scalarProduct(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):number; - /** - * Scales the vector by an factor. - * @param factor the scale factor, with which the length is multiplied. - */ - scale(factor:number):void; - /** - * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.YVector}. - * @returns The {@link }. - */ - toPoint():yfiles.geometry.Point; - /** - * Gets the first coordinate of the vector. - * @type {number} - */ - x:number; - /** - * Gets the second coordinate of the vector. - * @type {number} - */ - y:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YVector; - } - /** - * This class implements a directed graph structure. - *

- * Basically, a directed graph consists of a set of objects called "nodes" (represented by instances of class - * {@link yfiles.algorithms.Node}) and a set of node pairs which are called "edges" (represented by instances of class - * {@link yfiles.algorithms.Edge}). - *
- * The directed stems from the fact that all edges in the graph have direction, i.e., they have a distinct source node and a - * distinct target node. Using the aforementioned pair notation, an edge would be written as (<source node>, <target node>). - *

- *

- * Class Graph presents a proper data type that provides support for all essential operations like element creation, - * removal, access, and iteration. - *
- * Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that - * there is no way to create or delete a node or an edge without using an actual Graph instance. - *

- *

- * Furthermore, this class is also responsible for providing access to its elements. This is done by means of bidirectional - * cursors that present a read-only view on the node set (interface {@link yfiles.algorithms.INodeCursor}) and edge set (interface - * {@link yfiles.algorithms.IEdgeCursor}). - *

- *

- * Class Graph fires notification events that signal structural changes, like, e.g., creation, removal, reinsertion, or - * modification of graph elements. - *

- *

- * This class provides direct support for the notion of data accessors. It allows to register so-called data providers - * (implementations of interface {@link yfiles.algorithms.IDataProvider}) that hold arbitrary data which is associated to its nodes - * and/or edges. - *
- * Also, it serves as a factory to create so-called maps ({@link yfiles.algorithms.INodeMap}, - * {@link yfiles.algorithms.IEdgeMap}) that can be utilized to bind arbitrary data to nodes and edges. - *

- * @class - */ - export interface Graph extends yfiles.lang.Object{} - export class Graph { - /** - * Instantiates a new Graph object as a partial copy of the given graph. - *

- * Only the subgraph induced by the given cursor will be copied to the new Graph instance. If no cursor is specified, the - * complete graph is copied. Values bound to the argument graph via node and edge keys are available in the new Graph - * instance with the keys registered with graph. Only references to these values are copied. - *

- *

- * The new Graph instance also inherits all graph listeners registered with the given graph. - *

- * @param graph The graph to be (partially) copied. - * @param [subNodes=null] A cursor to iterate over the nodes that actually induce the subgraph to be copied. - */ - constructor(graph:yfiles.algorithms.Graph,subNodes?:yfiles.algorithms.ICursor); - /** - * Instantiates an empty Graph object. - */ - constructor(); - /** - * Registers the given data provider using the given look-up key. - *

- * If there is already a data provider registered with that key, then it will be overwritten with the new one. - *

- * @param providerKey - * @param data - */ - addDataProvider(providerKey:any,data:yfiles.algorithms.IDataProvider):void; - /** - * Redefines an edge's end points and fires corresponding notification events to inform registered listeners. - *

- * Edge e has source node v := sourceReference.source() or v := newSource, if sourceReference == null and target node w := targetReference.target() - * or w := newTarget, if targetReference == null. - *
- * - *
- * Edge e is inserted in such a way that an iteration over the edges at v returns e - *

- *
    - *
  • after sourceReference, if sourceD == AFTER
  • - *
  • before sourceReference, if sourceD == BEFORE,
  • - *
- *

- * and an iteration over the edges at w returns e - *

- *
    - *
  • after targetReference, if targetD == AFTER
  • - *
  • before targetReference, if targetD == BEFORE.
  • - *
- * @param e The edge to be changed. - * @param newSource The new source node. - * @param sourceReference Reference edge for insertion at the new source node. - * @param sourceD One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param newTarget The new target node. - * @param targetReference Reference edge for insertion at the new target node. - * @param targetD One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - */ - changeEdge(e:yfiles.algorithms.Edge,newSource:yfiles.algorithms.Node,sourceReference:yfiles.algorithms.Edge,sourceD:yfiles.algorithms.GraphElementInsertion,newTarget:yfiles.algorithms.Node,targetReference:yfiles.algorithms.Edge,targetD:yfiles.algorithms.GraphElementInsertion):void; - /** - * Redefines an edge's end points and fires corresponding notification events to inform registered listeners. - *

- * Edge e has source node v := e1.source() and target node w := e2.target(). - *
- * - *
- * Edge e is inserted in such a way that an iteration over the edges at v returns e - *

- *
    - *
  • after e1, if d1 == AFTER
  • - *
  • before e1, if d1 == BEFORE,
  • - *
- *

- * and an iteration over the edges at w returns e - *

- *
    - *
  • after e2, if d2 == AFTER
  • - *
  • before e2, if d2 == BEFORE.
  • - *
- * @param e The edge to be changed. - * @param e1 Reference edge for insertion at a new source node. - * @param e2 Reference edge for insertion at a new target node. - * @param d1 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param d2 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - */ - changeEdge(e:yfiles.algorithms.Edge,e1:yfiles.algorithms.Edge,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion):void; - /** - * Redefines an edge's end points and fires corresponding notification events to inform registered listeners. - *

- * The edge is appended to the lists of incoming and outgoing edges at the given source node and target node, - * respectively. - *

- * @param e The edge to be changed. - * @param newSource The new source node of the given edge. - * @param newTarget The new target node of the given edge. - */ - changeEdge(e:yfiles.algorithms.Edge,newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node):void; - /** - * Removes all nodes and edges from this graph and fires corresponding notification events to inform registered listeners. - */ - clear():void; - /** - * Whether or not this graph contains the given edge. - * @param e - * @returns - */ - contains(e:yfiles.algorithms.Edge):boolean; - /** - * Whether or not this graph contains the given node. - * @param v - * @returns - */ - contains(v:yfiles.algorithms.Node):boolean; - /** - * Returns whether or not this graph contains an edge that connects the given nodes. - * @param source The source node. - * @param target The target node. - * @returns - * @see yfiles.algorithms.Node#getEdgeTo - * @see yfiles.algorithms.Node#getEdgeFrom - * @see yfiles.algorithms.Node#getEdge - */ - containsEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node):boolean; - /** - * Creates a copy of this graph. - *

- * Invokes {@link yfiles.algorithms.Graph#Graph}. - *

- * @returns The newly created Graph object. - */ - createCopy():yfiles.algorithms.Graph; - /** - * Creates a new edge in this graph to be ordered before or after a given edge and fires a corresponding notification event - * to inform registered listeners. - *

- * The new edge e has source node v and target node w, i.e., would be written as edge e = (v, w). - *
- * - *
- * Edge e is inserted in such a way that an iteration over the edges at node v returns e - *

- *
    - *
  • after e1, if d1 == AFTER
  • - *
  • before e1, if d1 == BEFORE,
  • - *
- *

- * and an iteration over the edges at w returns e - *

- *
    - *
  • after e2, if d2 == AFTER
  • - *
  • before e2, if d2 == BEFORE.
  • - *
- * @param v The source node of the edge. - * @param e1 An edge with source node v. - * @param w The target node of the edge. - * @param e2 An edge with target node w. - * @param d1 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param d2 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @returns The newly created Edge object. - */ - createEdge(v:yfiles.algorithms.Node,e1:yfiles.algorithms.Edge,w:yfiles.algorithms.Node,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion):yfiles.algorithms.Edge; - /** - * Creates a new edge in this graph and fires a corresponding notification event to inform registered listeners. - *

- * The new edge has source node v and target node w, i.e., would be written as edge e = (v, w). - *

- *

- * The edge is appended to the lists of incoming and outgoing edges at the source node and target node, respectively. - *

- * @param v The source node of the edge. - * @param w The target node of the edge. - * @returns The newly created Edge object. - */ - createEdge(v:yfiles.algorithms.Node,w:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns a newly created edge map that is valid for the edges in this graph. - *

- * The implementation returned by this method can be used for any edge that is part of this Graph instance at any point of - * time, i.e., it is safe to modify the graph structure (add and remove nodes and edges) freely. - *

- *

- * The implementation returned uses O(m) memory at all times and provides true O(1) read and write access for each edge. - *

- *

- * In order to release the resources held by this map, {@link yfiles.algorithms.Graph#disposeEdgeMap} has to be called. - *

- * @returns - */ - createEdgeMap():yfiles.algorithms.IEdgeMap; - /** - * Creates an empty base object of the same type as this graph. - *

- * Subclasses should override this method. - *

- * @returns - */ - createGraph():yfiles.algorithms.Graph; - /** - * Creates a new node in this graph and fires a corresponding notification event to inform registered listeners. - * @returns The newly created Node object. - */ - createNode():yfiles.algorithms.Node; - /** - * Returns a newly created node map that is valid for the nodes in this graph. - *

- * The implementation returned by this method can be used for any node that is part of this Graph instance at any point of - * time, i.e., it is safe to modify the graph structure (add and remove nodes and edges) freely. - *

- *

- * The implementation returned uses O(n) memory at all times and provides true O(1) read and write access for each node. - *

- *

- * In order to release the resources held by this map, {@link yfiles.algorithms.Graph#disposeNodeMap} has to be called. - *

- * @returns - */ - createNodeMap():yfiles.algorithms.INodeMap; - /** - * Informs the graph that the given edge map is no longer needed. - *

- * This method is used for EdgeMap implementations that have been obtained using the {@link yfiles.algorithms.Graph#createEdgeMap} - * factory method. - *

- *

- * Calling this method will destroy the edge map and associated resources can be freed. It is strongly recommended to - * dispose of all edge maps that are not needed anymore using this method. - *

- * @param map - */ - disposeEdgeMap(map:yfiles.algorithms.IEdgeMap):void; - /** - * Informs the graph that the given node map is no longer needed. - *

- * This method is used for NodeMap implementations that have been obtained using the {@link yfiles.algorithms.Graph#createNodeMap} - * factory method. - *

- *

- * Calling this method will destroy the node map and associated resources can be freed. It is strongly recommended to - * dispose of all node maps that are not needed anymore using this method. - *

- * @param map - */ - disposeNodeMap(map:yfiles.algorithms.INodeMap):void; - /** - * Low-level iteration support for adjacent edges. - * @param v - * @returns - * @protected - * @static - */ - static firstOutEdge(v:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns the data provider that is registered with the graph using the given look-up key. - *

- * The look-up domain of a returned data provider normally consists of either the nodes of the graph, or its edges, or - * both. - *

- * @param providerKey - * @returns - */ - getDataProvider(providerKey:any):yfiles.algorithms.IDataProvider; - /** - * Returns an array containing all edges of this graph. - * @returns - */ - getEdgeArray():yfiles.algorithms.Edge[]; - /** - * Provides access to the edges of the graph. - * @returns An EdgeCursor to iterate over the edges in the graph. - */ - getEdgeCursor():yfiles.algorithms.IEdgeCursor; - /** - * Returns an array containing all nodes of this graph. - * @returns - */ - getNodeArray():yfiles.algorithms.Node[]; - /** - * Provides access to the nodes of the graph. - * @returns A NodeCursor to iterate over the nodes in the graph. - */ - getNodeCursor():yfiles.algorithms.INodeCursor; - /** - * Hides the given node from this graph. - *

- * Hiding a node means to (temporarily) remove the node from the graph. - *

- *

- * The only difference to a proper node removal as performed by {@link yfiles.algorithms.Graph#removeNode} is that no event will be - * emitted that signals the structural change (i.e. the node's removal). - *

- *

- * Generally, hiding should only be used in the sense of temporarily removing an object that will be reinserted shortly after. - *

- *

- * To reinsert a hidden node use {@link yfiles.algorithms.Graph#unhide}. - *

- * @param v - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#unhide - */ - hide(v:yfiles.algorithms.Node):void; - /** - * Hides the given edge from this graph. - *

- * Hiding an edge means to (temporarily) remove the edge from the graph. - *

- *

- * The only difference to a proper edge removal as performed by {@link yfiles.algorithms.Graph#removeEdge} is that no event will be - * emitted that signals the structural change (i.e. the edge's removal). - *

- *

- * Generally, hiding should only be used in the sense of temporarily removing an object that will be reinserted shortly after. - *

- *

- * To reinsert a hidden edge use {@link yfiles.algorithms.Graph#unhide}. - *

- * @param e - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#unhide - */ - hide(e:yfiles.algorithms.Edge):void; - /** - * Moves the given edge to the first position within the sequence of edges in this graph. - * @param e - */ - moveToFirst(e:yfiles.algorithms.Edge):void; - /** - * Moves the given node to the first position within the sequence of nodes in this graph. - * @param v - */ - moveToFirst(v:yfiles.algorithms.Node):void; - /** - * Moves the given edge to the last position within the sequence of edges in this graph. - * @param e - */ - moveToLast(e:yfiles.algorithms.Edge):void; - /** - * Moves the given node to the last position within the sequence of nodes in this graph. - * @param v - */ - moveToLast(v:yfiles.algorithms.Node):void; - /** - * For internal debugging purposes only. - */ - printNodeSlotSize():void; - /** - * Reinserts a formerly removed edge into this graph and fires a corresponding notification event to inform registered - * listeners. - *

- * The reinserted edge is appended to the sequence of edges in this graph, i.e., normally, its new position does not match - * the position before its removal. The same holds for the edge's positions in the list of incoming and outgoing edges at - * its source node and target node, respectively. - *

- *

- * Note that reinserting an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) - * causes an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. - *

- * @param e The edge to be reinserted. - * @see yfiles.algorithms.Graph#removeEdge - */ - reInsertEdge(e:yfiles.algorithms.Edge):void; - /** - * Reinserts a formerly removed node into this graph and fires a corresponding notification event to inform registered - * listeners. - *

- * The reinserted node is appended to the sequence of nodes in this graph, i.e., normally, its new position does not match - * the position before its removal. - *

- * @param v The node to be reinserted. - * @see yfiles.algorithms.Graph#removeNode - */ - reInsertNode(v:yfiles.algorithms.Node):void; - /** - * Removes the data provider that is registered using the given look-up key. - * @param providerKey - */ - removeDataProvider(providerKey:any):void; - /** - * Removes the given edge from this graph and fires a corresponding notification event to inform registered listeners. - *

- * The edge will be deselected before it gets removed. - *

- * @param e The edge to be removed. - */ - removeEdge(e:yfiles.algorithms.Edge):void; - /** - * Removes the given node from this graph. - *

- * All edges connecting to the given node are removed as well (preceding the actual node removal). Corresponding - * notification events are fired to inform registered listeners. - *

- *

- * The node will be deselected before it gets removed. - *

- * @param v The node to be removed from this graph. - */ - removeNode(v:yfiles.algorithms.Node):void; - /** - * Reverses the given edge and fires corresponding notification events to inform registered listeners. - *

- * This operation exchanges source and target node of the edge. - *

- * @param e - */ - reverseEdge(e:yfiles.algorithms.Edge):void; - /** - * Sorts incoming and outgoing edges at each node of the graph. - *

- * If a given comparator is null, then the corresponding edges (i.e., incoming/outgoing) will not be sorted. This sorts the - * order of the edges as returned by {@link yfiles.algorithms.Node#getOutEdgeCursor} and {@link yfiles.algorithms.Node#getInEdgeCursor} - * respectively. - *

- * @param inComparer The comparator used for the incoming edges at each node. - * @param outComparer The comparator used for the outgoing edges at each node. - */ - sortEdges(inComparer:yfiles.collections.IComparer,outComparer:yfiles.collections.IComparer):void; - /** - * Sorts the internally held list of edges. - *

- * If the given comparator is null, then the edges will not be sorted. This list determines the order of the edges as - * returned by {@link yfiles.algorithms.Graph#getEdgeCursor}. - *

- * @param comparer The comparator used for the edges. - */ - sortEdges(comparer:yfiles.collections.IComparer):void; - /** - * Sorts the internally held list of nodes. - *

- * If the given comparator is null, then the nodes will not be sorted. This list determines the order of the nodes as - * returned by {@link yfiles.algorithms.Graph#getNodeCursor}. - *

- * @param comparer The comparator used for the nodes. - */ - sortNodes(comparer:yfiles.collections.IComparer):void; - /** - * Unhides the given node in this graph. - *

- * Unhiding a node means to reinsert a node that was formerly hidden from this graph by a call to - * {@link yfiles.algorithms.Graph#hide}. - *

- *

- * The only difference to a proper node reinsertion as performed by {@link yfiles.algorithms.Graph#reInsertNode} is that no event - * will be emitted that signals the structural change (i.e. the node's reinsertion). - *

- * @param v - */ - unhide(v:yfiles.algorithms.Node):void; - /** - * Unhides the given edge in this graph. - *

- * Unhiding an edge means to reinsert an edge that was formerly hidden from this graph by a call to - * {@link yfiles.algorithms.Graph#hide}. - *

- *

- * The only difference to a proper edge reinsertion as performed by {@link yfiles.algorithms.Graph#reInsertEdge} is that no event - * will be emitted that signals the structural change (i.e. the edge's reinsertion). - *

- *

- * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes - * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. - *

- * @param e - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#unhide - */ - unhide(e:yfiles.algorithms.Edge):void; - /** - * Gets the number of nodes in this graph. - *

- * Same as {@link yfiles.algorithms.Graph#nodeCount}. - *

- * @type {number} - */ - n:number; - /** - * Gets the number of nodes in this graph. - * @type {number} - */ - nodeCount:number; - /** - * Gets the number of edges in this graph. - *

- * Same as {@link yfiles.algorithms.Graph#edgeCount}. - *

- * @type {number} - */ - e:number; - /** - * Gets the number of edges in this graph. - * @type {number} - */ - edgeCount:number; - /** - * Gets true if this graph contains no nodes. - * @type {boolean} - */ - empty:boolean; - /** - * Gets the first node in this graph. - * @type {yfiles.algorithms.Node} - */ - firstNode:yfiles.algorithms.Node; - /** - * Gets the first edge in this graph. - * @type {yfiles.algorithms.Edge} - */ - firstEdge:yfiles.algorithms.Edge; - /** - * Gets the last node in this graph. - * @type {yfiles.algorithms.Node} - */ - lastNode:yfiles.algorithms.Node; - /** - * Gets the last edge in this graph. - * @type {yfiles.algorithms.Edge} - */ - lastEdge:yfiles.algorithms.Edge; - /** - * Gets all node maps that have been created by this graph but have not yet been disposed. - * @see yfiles.algorithms.Graph#createNodeMap - * @see yfiles.algorithms.Graph#disposeNodeMap - * @type {Array.} - */ - registeredNodeMaps:yfiles.algorithms.INodeMap[]; - /** - * Gets all edge maps that have been created by this graph but have not yet been disposed. - * @see yfiles.algorithms.Graph#createEdgeMap - * @see yfiles.algorithms.Graph#disposeEdgeMap - * @type {Array.} - */ - registeredEdgeMaps:yfiles.algorithms.IEdgeMap[]; - /** - * Gets an array of all data provider look-up keys that are registered with this graph. - * @type {Array.} - */ - dataProviderKeys:any[]; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Node}s that can be used to iterate over the nodes that are contained in this instance. - *

- * This is a live enumerable and will thus reflect the current state of the graph. Note that changes to the graph structure - * during the traversal should be carried out with great care. - *

- * @type {yfiles.collections.IEnumerable.} - */ - nodes:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Edge}s that can be used to iterate over the edges that are contained in this instance. - *

- * This is a live enumerable and will thus reflect the current state of the graph. Note that changes to the graph structure - * during the traversal should be carried out with great care. - *

- * @type {yfiles.collections.IEnumerable.} - */ - edges:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Graph; - } - /** - * This class provides methods that check structural properties of a given graph. - *

- * Definitions - *

- *
    - *
  • Cycle: An edge path with vertices v0, v1, v2, ... , vk forms a cycle if v0 = vk and consists of at least one edge.
  • - *
  • Acyclic graph: A graph that contains no directed cycle.
  • - *
  • Cyclic graph: A graph that contains a directed cycle.
  • - *
  • Connected graph: A graph in which there exists an undirected path of edges between every pair of nodes.
  • - *
  • Strongly connected graph: A graph in which there exists a directed path between each pair of nodes.
  • - *
  • Biconnected graph: A graph that has no cut vertex or articulation point (i.e., a node whose removal disconnects the graph).
  • - *
  • Bipartite graph: A graph whose nodes can be partitioned into two sets such that each edge connects two nodes of different sets.
  • - *
  • - * Tree graph: An acyclic graph, in which any pair of vertices is connected through a path. If one vertex of a tree is distinguished - * from the other vertices, then the tree is called rooted tree. - *
  • - *
  • N-ary tree graph: A directed rooted tree where each node has a maximum of n children.
  • - *
  • Forest graph: A graph whose connected components are trees.
  • - *
  • Simple graph: A graph that contains no self-loops and parallel edges.
  • - *
  • Planar graph: A graph that can be drawn on the plane without edge crossings.
  • - *
- * @class - * @static - */ - export interface GraphChecker extends yfiles.lang.Object{} - export class GraphChecker { - /** - * Checks whether or not the given directed graph is acyclic. - *

- * A graph is called acyclic if it contains no directed cycle. - *

- * @param graph the given graph - * @returns true if the graph is acyclic, false, otherwise - * @static - */ - static isAcyclic(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given undirected graph is biconnected. - *

- * A graph is called biconnected if it has no cut vertex or articulation point, i.e., no node whose removal disconnects the graph. - *

- * @param graph the given undirected graph - * @returns true if the graph is biconnected, false otherwise - * @static - */ - static isBiconnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given undirected graph is bipartite. - *

- * A graph is called bipartite if its nodes can be partitioned into two sets such that each edge connects two nodes of different - * sets. - *

- * @param graph the given undirected graph - * @returns true if the graph is bipartite, false otherwise - * @static - */ - static isBipartite(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is connected. - *

- * A graph is called connected if there exists an undirected path of edges between every pair of nodes. - *

- * @param graph the given graph - * @returns true if the graph is connected, false otherwise - * @static - */ - static isConnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given directed graph is cyclic. - *

- * A graph is called cyclic if it contains a directed cycle. - *

- * @param graph the given graph - * @returns true if the graph is cyclic, false, otherwise - * @static - */ - static isCyclic(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether the given graph is a forest. - *

- * A graph is a forest if its connected components are trees. - *

- * @param graph the given graph - * @returns true if the graph is a forest, false otherwise - * @static - */ - static isForest(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given undirected graph contains no multiple edges. - *

- * More precisely, the method returns true if the graph contains no two distinct edges e1, e2 that connect the same pairs - * of nodes in either direction. - *

- * @param graph the given undirected graph - * @returns true if the graph contains no multiple edges, false otherwise - * @static - */ - static isMultipleEdgeFree(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is a directed rooted tree where each node has a maximum of n children. - * @param graph the given graph - * @param n - * @returns true if the graph is a directed rooted tree where each node has at most n children, false otherwise - * @static - */ - static isNaryTree(graph:yfiles.algorithms.Graph,n:number):boolean; - /** - * Checks whether or not the given directed graph is a directed rooted tree. - * @param graph the given graph - * @returns true if the graph is a directed rooted tree, false otherwise - * @static - */ - static isRootedTree(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph contains no self-loops. - * @param graph the given graph - * @returns true if the graph contains no self-loops, false otherwise - * @static - */ - static isSelfLoopFree(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given directed graph is simple. - *

- * A graph is called simple if it contains no two distinct edges e1, e2 where - * e1.source() == e2.source() && e1.target() == e2.target(). - *

- * @param graph the given directed graph - * @returns true if the graph is simple, false otherwise - * @static - */ - static isSimple(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given directed graph is strongly connected. - *

- * A graph is called strongly connected if there exists a directed path between each pair of nodes. - *

- * @param graph the given directed graph - * @returns true if the graph is strongly connected, false, otherwise - * @static - */ - static isStronglyConnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is an undirected tree. - * @param graph the given graph - * @returns true if the graph is an undirected tree, false otherwise - * @static - */ - static isTree(graph:yfiles.algorithms.Graph):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphChecker; - } - /** - * This class provides algorithms for determining certain connectivity components within a graph. - *

- * It also provides convenience methods for working with these components. - *

- *

- * Definitions - *

- *
    - *
  • Connected graph: A graph is called connected if there exists an undirected path of edges between every pair of nodes.
  • - *
  • Strongly connected graph: A graph is called strongly connected if there exists a directed path between each pair of nodes.
  • - *
  • - * Biconnected graph: A graph is called biconnected if it has no cut vertex or articulation point (i.e., a node whose removal disconnects the - * remaining graph). - *
  • - *
- * @class - * @static - */ - export interface GraphConnectivity extends yfiles.lang.Object{} - export class GraphConnectivity { - /** - * Calculates the biconnected components and the articulation points of a given undirected graph and returns the number of - * biconnected components. - *

- * Articulation points are returned in the form of a {@link yfiles.algorithms.INodeMap} that returns for each node a boolean value - * indicating whether or not it is an articulation point. - *

- * @param graph the input graph - * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * biconnected component to which each edge belongs or -1 for self-loops - * @param [aPoint=null] the {@link } that will be filled during the execution and returns a boolean value indicating whether - * or not a given node is an articulation point - * @returns the number of biconnected components - * @see yfiles.algorithms.GraphConnectivity#biconnectedComponents - * @see yfiles.algorithms.GraphConnectivity#biconnectedComponents - * @static - */ - static biconnectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap,aPoint?:yfiles.algorithms.INodeMap):number; - /** - * Calculates the biconnected components of a given undirected graph. - *

- * The result is returned as an array of - * {@link yfiles.algorithms.EdgeList}s each containing all edges that belong to the same biconnected component. - *

- * @param graph the input graph - * @returns an array of {@link }s each containing all edges that belong to the same biconnected component - * @see yfiles.algorithms.GraphConnectivity#biconnectedComponents - * @static - */ - static biconnectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList[]; - /** - * Calculates the connected components of a given graph and returns their number. - *

- * A graph G is called connected if there exists an undirected path of edges between every pair of nodes. - *

- *

- * The connected components of a graph are the maximal connected subgraphs of which the graph consists. - *

- * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * connected component to which each node belongs - * @param graph - * @returns the number of connected components of the given graph - * @static - */ - static connectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap):number; - /** - * Calculates the connected components of a given graph. - *

- * A graph G is called connected if there exists an undirected path of edges between every pair of nodes. - *

- *

- * The connected components of a graph are the maximal connected subgraphs of which the graph consists. - *

- * @param graph the input graph - * @returns an array of {@link }s each of which contains the nodes that belong to the same connected component - * @static - */ - static connectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - /** - * Determines the direct or indirect neighbors of a given set of nodes. - *
    - *
  • A direct neighbor of a node is directly connected by an edge to that node.
  • - *
  • An indirect neighbor of a node is directly connected to another direct or indirect neighbor of a node.
  • - *
- *

- * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting - * set. - *

- *

- * To obtain the result, an integer value should be given as input that limits the distance between a start node and a - * returned node. For all returned nodes there must be a path to a start node that has a length equal to or smaller than - * this distance. - *

- *

- * Setting the maximum distance to 1 will only yield the direct neighbors of all start nodes. On the other hand, setting - * the maximum distance to graph.N() or larger will yield all neighbors of all start nodes. - *

- * @param graph - * @param startNodes - * @param maxDistance - * @returns a {@link } that contains all direct and indirect neighbors of a node - * @static - */ - static getNeighbors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; - /** - * Determines the direct or indirect predecessors of a given list of nodes. - *
    - *
  • A direct predecessor of a node is the source node of an incoming edge connected to a node.
  • - *
  • An indirect predecessor of a node is a direct predecessor to another predecessor of a node.
  • - *
- *

- * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting - * set. - *

- *

- * To obtain the result, an integer value should be given as input that limits the distance between a start node and a - * returned node. For all returned nodes there must be a path to a start node that has a length equal to or smaller than - * this distance. - *

- *

- * Setting the maximum distance to 1 will only yield the direct predecessors of all start nodes. On the other hand, setting - * the maximum distance to graph.N() or larger will yield all predecessors of all start nodes. - *

- * @param graph the given graph - * @param startNodes a {@link } containing the nodes from which the search starts - * @param maxDistance an integer value that limits the distance between a start node and a returned node - * @returns a {@link } that contains all direct and indirect predecessors of a node - * @static - */ - static getPredecessors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; - /** - * Determines the direct or indirect successors of a given list of nodes. - *
    - *
  • A direct successor of a node is the target node of an outgoing edge connected to a node.
  • - *
  • An indirect successor of a node is a direct successor to another successor of a node.
  • - *
- *

- * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting - * set. - *

- *

- * To obtain the result, an integer value should be given as input that limits the distance between a start node and a - * returned node. For all returned nodes there must be a path to a start node that has a length equal to or smaller than - * this distance. - *

- *

- * Setting the maximum distance to 1 will only yield the direct successors of all start nodes. On the other hand, setting - * the maximum distance to graph.N() or larger will yield all successors of all start nodes. - *

- * @param graph the given graph - * @param startNodes a {@link } containing the nodes from which the search starts - * @param maxDistance an integer value that limits the distance between a start node and a returned node - * @returns a {@link } that contains all direct and indirect successors of a node - * @static - */ - static getSuccessors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; - /** - * Checks whether or not the given undirected graph is biconnected. - *

- * A graph is called biconnected if it has no cut vertex or articulation point, i.e., no node whose removal disconnects the graph. - *

- * @param graph the given undirected graph - * @returns true if the graph is biconnected, false otherwise - * @static - */ - static isBiconnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is connected. - *

- * A graph is called connected if there exists an undirected path of edges between every pair of nodes. - *

- * @param graph the given graph - * @returns true if the graph is connected, false otherwise - * @static - */ - static isConnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given directed graph is strongly connected. - *

- * A graph is called strongly connected if there exists a directed path between each pair of nodes. - *

- * @param graph the given directed graph - * @returns true if the graph is strongly connected, false, otherwise - * @static - */ - static isStronglyConnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Makes the given graph biconnected by inserting a minimum number of edges in the graph. - *

- * The given graph is considered to be undirected. - *

- * @param graph the input graph - * @returns an {@link } containing the edges added to the graph - * @static - */ - static makeBiconnected(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; - /** - * Makes a graph connected by adding additional edges to the graph. - *

- * The number of edges that will be added equals the number of separate components of the original graph minus 1. - *

- * @param graph the input graph - * @returns an {@link } containing the edges added to the graph - * @static - */ - static makeConnected(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; - /** - * Determines the set of nodes that are reachable from a given node when a set of edges that cannot be traversed is - * specified. - *

- * The result is based on a depth first search. - *

- * @param graph the given graph - * @param start the node from which the search starts - * @param directed true if the edges should be traversed from source to target, false if edges can be traversed in both directions - * @param [forbidden=null] an array that holds for each {@link } a {@link } value indicating whether or not an edge can be traversed; an edge - * e is marked as forbidden if forbidden[e.index()] == true - * @param reached an array that will be filled during the execution and returns for each {@link } a {@link } value based on whether - * the node can be reached during the DFS; if a node v is reachable, then reached[v.index()] = true - * @static - */ - static reachable(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,directed:boolean,reached:boolean[],forbidden?:boolean[]):void; - /** - * Calculates the strongly connected components of a given graph and returns their number. - *

- * A graph is called strongly connected if there exists a directed path between each pair of nodes. - *

- *

- * The strongly connected components of a graph are the strongly connected subgraphs of which it consists. - *

- * @param graph the input graph - * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * connected component to which each node belongs - * @returns the number of strongly connected components of the given graph - * @see yfiles.algorithms.GraphConnectivity#stronglyConnectedComponents - * @static - */ - static stronglyConnectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap):number; - /** - * Calculates the strongly connected components of a given graph. - *

- * A graph is called strongly connected if there exists a directed path between each pair of nodes. - *

- *

- * The strongly connected components of a graph are the strongly connected subgraphs of which it consists. - *

- * @param graph the input graph - * @returns an array of - * {@link }s each of which contains the nodes that belong to the same strongly connected component - * @see yfiles.algorithms.GraphConnectivity#stronglyConnectedComponents - * @static - */ - static stronglyConnectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - /** - * Transforms the return values of {@link yfiles.algorithms.GraphConnectivity#biconnectedComponents} to an array of - * {@link yfiles.algorithms.EdgeList}s, like it is returned by {@link yfiles.algorithms.GraphConnectivity#biconnectedComponents}. - * @param graph the input graph - * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * connected component to which each edge belongs - * @param maxCompNum the maximum number of biconnected components - * @returns an array of {@link }s each containing all edges that belong to the same biconnected component - * @static - */ - static toEdgeListArray(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap,maxCompNum:number):yfiles.algorithms.EdgeList[]; - /** - * Transforms the return values of method {@link yfiles.algorithms.GraphConnectivity#connectedComponents} to an array of - * {@link yfiles.algorithms.NodeList}s, like it is returned by {@link yfiles.algorithms.GraphConnectivity#connectedComponents}. - * @param graph the input graph - * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * connected component to which each node belongs - * @param maxCompNum the maximum number of connected components - * @returns an array of {@link }s each of which contains the nodes that belong to the same connected component - * @static - */ - static toNodeListArray(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap,maxCompNum:number):yfiles.algorithms.NodeList[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphConnectivity; - } - /** - * Common base type for both {@link yfiles.algorithms.Node} and {@link yfiles.algorithms.Edge}. - *

- * This type does not add public functionality to its base type. - *

- * @class - */ - export interface GraphObject extends yfiles.lang.Object{} - export class GraphObject { - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphObject; - } - /** - * This class provides the result of hierarchical clustering algorithms by means of a binary tree structure. - *

- * The dendrogram is created using the agglomerative strategy (i.e., a bottom-up approach) based on the following steps: - *

- *
    - *
  • - * At the beginning (i.e., at level - * 0), each node belongs to its own cluster. At this point, each node of the original graph (the one that will be - * clustered) is mapped to one of the dendrogram nodes that represent a leaf node (i.e., a node with no children). - *
  • - *
  • - * At each step, pairs of clusters are merged while moving up to the hierarchy. In this case, a new dendrogram node is - * created and the corresponding dissimilarity value between the two merged clusters can be obtained using - * {@link yfiles.algorithms.Dendrogram#getDissimilarityValue}. The dissimilarity values are monotone increasing starting from zero - * which corresponds to the leaf nodes of the dendrogram. - *
  • - *
  • - * The algorithm continues until all nodes belong to the same cluster. At this point, the root of the dendrogram is reached - * and can be obtained using method {@link yfiles.algorithms.Dendrogram#root}. - *
  • - *
- *

- * The dendrogram is a binary tree that is directed from the root to the leaves. This means that one can iterate the - * dendrogram starting with the {@link yfiles.algorithms.Dendrogram#root root node}, moving on to its {@link yfiles.algorithms.Dendrogram#getChildren children}, then moving on to their children and so on. - *

- *

- * From each node of the dendrogram, it is possible to retrieve the set of nodes of the original graph that belong to this - * dendrogram node using {@link yfiles.algorithms.Dendrogram#getClusterNodes}. This method returns an array of - * {@link yfiles.algorithms.NodeList}s that contain the nodes of all clusters that are merged when this dendrogram node was - * created. For example, say that clusters C1 = {v1, v2} and C2 = {v3, v4} are merged, where {v1, v2, v3, v4} are nodes of - * the original graph. Say that dendrogram node u is created by this merging. Then, the cluster nodes of u will be returned - * as two {@link yfiles.algorithms.NodeList}s where the first contains nodes v1, v2 and the second v3, v4. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @class - */ - export interface Dendrogram extends yfiles.lang.Object{} - export class Dendrogram { - /** - * Returns a {@link yfiles.algorithms.NodeList} that contains the child nodes of the given parent node. - *

- * If the given node is a {@link yfiles.algorithms.Dendrogram#isLeaf leaf} node, the returned list will be empty. - *

- * @param parent the parent node for which to retrieve the child nodes - * @returns the list of child nodes of the given parent node - */ - getChildren(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns an array of - * {@link yfiles.algorithms.NodeList}s that contain the nodes of the original graph that are associated with the given dendrogram - * node. - *

- * Each such {@link yfiles.algorithms.NodeList} represents nodes that belong to the same cluster. For example, say that clusters C1 = {v1, v2} - * and C2 = {v3, v4} are merged, where {v1, v2, v3, v4} are nodes of the original graph. Say that dendrogram node u is - * created by this merging. Then, the cluster nodes of u will be returned as two {@link yfiles.algorithms.NodeList}s where the - * first contains nodes v1, v2 and the second v3, v4. - *

- * @param node the given dendrogram node - * @returns an array of - * {@link }s that contain the nodes of the original graph that are associated with the given dendrogram - * node - */ - getClusterNodes(node:yfiles.algorithms.Node):yfiles.algorithms.NodeList[]; - /** - * Returns the dissimilarity value associated with the given node of the dendrogram. - * @param node the given dendrogram node - * @returns the dissimilarity value associated with the given dendrogram node - */ - getDissimilarityValue(node:yfiles.algorithms.Node):number; - /** - * Returns the level of the given node of the dendrogram. - * @param node the given dendrogram node - * @returns the level of the given dendrogram node - */ - getLevel(node:yfiles.algorithms.Node):number; - /** - * Returns the node of the dendrogram that belongs to the given level index. - *

- * If the given level index is greater than the {@link yfiles.algorithms.Dendrogram#levelCount number of levels}, then this method will return null. - *

- * @param level the given level index - * @returns the node of the dendrogram that belongs to the given level index or null if there exists no level with the given index. - * @throws {Stubs.Exceptions.ArgumentError} if the given level is negative or greater than the {@link yfiles.algorithms.Dendrogram#nodeCount node count} minus one. - */ - getNodeAtLevel(level:number):yfiles.algorithms.Node; - /** - * Returns the node of original graph that is mapped with the given leaf node of the dendrogram. - * @param node the given leaf node - * @returns the node of original graph that is mapped with the given leaf node or null if the given node is an inner dendrogram - * node - */ - getOriginalNode(node:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Returns whether or not the given dendrogram node is a leaf node. - *

- * A leaf node has no further children and represents a node of the original graph. The original node can be retrieved via - * {@link yfiles.algorithms.Dendrogram#getOriginalNode}. - *

- * @param node a dendrogram node - * @returns true if the given node is a leaf node, false otherwise - */ - isLeaf(node:yfiles.algorithms.Node):boolean; - /** - * Gets the root node of the dendrogram. - *

- * A dendrogram traversal can be implemented by starting from this node, then moving on to its children using method - * {@link yfiles.algorithms.Dendrogram#getChildren}, and so on. - *

- * @type {yfiles.algorithms.Node} - */ - root:yfiles.algorithms.Node; - /** - * Gets the number of nodes in this dendrogram. - * @type {number} - */ - nodeCount:number; - /** - * Gets the number of levels this dendrogram has. - * @type {number} - */ - levelCount:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Dendrogram; - } - /** - * An interface that determines the distance between two nodes of a graph. - *

- * It is used by the hierarchical clustering algorithm in order to determine the distance between any two nodes of a - * graph. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @interface - */ - export interface INodeDistanceProvider extends yfiles.lang.Object{ - /** - * Returns the distance between two given nodes of a graph. - *

- * Implementations of this method have to guarantee that the returned value is greater or equal to zero. Furthermore, the - * distances between two nodes have to be symmetric, i.e., the distance between node n1 and n2 is equal to the distance - * between node n2 and n1. - *

- * @param n1 the first node - * @param n2 the second node - * @returns the distance between the two given nodes - * @abstract - */ - getDistance(n1:yfiles.algorithms.Node,n2:yfiles.algorithms.Node):number; - } - var INodeDistanceProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.INodeDistanceProvider; - }; - /** - * This class provides methods for automatically partitioning nodes of a graph into groups. - *

- * Partitions can be defined using edge betweenness centrality, biconnectivity, k-means clustering or hierarchical - * clustering. - *

- *

- * Definitions - *

- *
    - *
  • Betweenness centrality is a measure for how often a node lies on a shortest path between each pair of nodes in the graph.
  • - *
  • Biconnected graph is a graph that has no cut vertex or articulation point (i.e., a node whose removal disconnects the graph).
  • - *
  • K-means clustering algorithm partitions the nodes of a graph into k-clusters based on their positions on the plane and a given distance metric.
  • - *
  • Hierarchical clustering creates a hierarchy of clusters in a bottom-to-top approach based on some distance metric and linkage.
  • - *
- * @class - * @static - */ - export interface Groups extends yfiles.lang.Object{} - export class Groups { - /** - * This method partitions the graph by analyzing its biconnected components. - *

- * Nodes will be grouped such that the nodes within each group are biconnected. Nodes that belong to multiple biconnected - * components will be assigned to exactly one of these components. - *

- * @param graph the input graph - * @param groupIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @returns the resulting number of different groups - * @static - */ - static biconnectedComponentGrouping(graph:yfiles.algorithms.Graph,groupIDs:yfiles.algorithms.INodeMap):number; - /** - * Partitions the graph into groups using edge betweenness clustering proposed by Girvan and Newman. - *

- * In each iteration the edge with the highest betweenness centrality is removed from the graph. The method stops, if there - * are no more edges to remove or if the requested maximum number of groups is found. The clustering with the best quality - * reached during the process is returned. - *

- *

- * The algorithm includes several heuristic speed-up techniques available through the quality/time ratio. For the highest - * quality setting, it is used almost unmodified. The fast betweenness approximation of Brandes and Pich (Centrality Estimation in Large Networks) is employed for - * values around 0.5. Typically, this results in a tiny decrease in quality but a large speed-up and is the recommended - * setting. To achieve the lowest running time, a local betweenness calculation is used (Gregory: Local Betweenness for Finding Communities in Networks). - *

- *

- * The method requires the maximum number of groups that will be returned. The smaller this value is, the faster the - * overall computation time. The upper bound on the number of groups is - * graph.N(). Also, the number of returned groups is never smaller than the number of connected components of the graph. - *

- * @param graph the input graph - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param qualityTimeRatio a value between 0.0 (low quality, fast) and 1.0 (high quality, slow); the recommended value is 0.5 - * @param minGroupCount the minimum number of groups that will be returned - * @param maxGroupCount the maximum number of groups that will be returned - * @param refine true if the algorithm refines the current grouping, false if the algorithm discards the current grouping - * @returns the resulting number of different groups - * @throws {Stubs.Exceptions.ArgumentError} if minGroupCount > maxGroupCount or minGroupCount > graph.N() or maxGroupCount <= 0 - * @static - */ - static edgeBetweennessClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,qualityTimeRatio:number,minGroupCount:number,maxGroupCount:number,refine:boolean):number; - /** - * Partitions the graph into groups using edge betweenness centrality. - *

- * In each iteration the edge with the highest betweenness centrality is removed from the graph. The method stops, if there - * are no more edges to remove. The clustering with the best quality reached during the process will be returned. - *

- *

- * The method requires the maximum number of groups that will be returned. The smaller this value is, the faster the - * overall computation time. The upper bound on the number of groups is - * graph.N(). Also, the number of returned groups is never smaller than the number of connected components of the graph. - *

- * @param graph the input graph - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param directed true if the graph should be considered as directed, false otherwise - * @param minGroupCount the minimum number of groups that will be returned - * @param maxGroupCount the maximum number of groups that will be returned - * @param edgeCosts the {@link } that holds a positive {@link } cost or null if the edges of the graph are considered to be - * of equal cost - * @returns the resulting number of different groups - * @throws {Stubs.Exceptions.ArgumentError} if minGroupCount > maxGroupCount or minGroupCount > graph.N() or maxGroupCount <= 0 - * @static - */ - static edgeBetweennessClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,directed:boolean,minGroupCount:number,maxGroupCount:number,edgeCosts:yfiles.algorithms.IDataProvider):number; - /** - * Partitions the graph into clusters based on hierarchical clustering, while the dendrogram is cut based on a given - * maximum number of clusters. - *

- * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the - * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the - * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances. The - * algorithm continues until all nodes belong to the same cluster. - *

- *

- * The result will be given based on the given maximum number of clusters value that is used for cutting the hierarchical - * tree at a point such that the number of remaining clusters equals to this value. - *

- *

- * The maximum number of clusters needs to be greater than zero and less than the number of the nodes of the graph. - *

- * @param graph the input graph - * @param maxCluster the maximum number of clusters that determines where to cut the hierarchic tree into clusters - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param distances a given {@link } object that determines the distance between any two graph nodes - * @param linkage one of the predefined linkage values - * @returns the resulting number of clusters - * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is given or if the maximum number of clusters is less than or equal to zero or greater than the - * number of nodes of the graph - * @static - */ - static hierarchicalClustering(graph:yfiles.algorithms.Graph,maxCluster:number,clusterIDs:yfiles.algorithms.INodeMap,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage):number; - /** - * Partitions the graph into clusters based on hierarchical clustering, while the dendrogram is cut based on a given - * cut-off value. - *

- * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the - * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the - * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances. The - * algorithm continues until all nodes belong to the same cluster. - *

- *

- * The result will be given based on the given cut-off value that is used for cutting the hierarchical tree at a point such - * that the dissimilarity values of the nodes that remain at the dendrogram are less than this value. - *

- * @param graph the input graph - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param distances a given {@link } object that determines the distance between any two nodes - * @param linkage one of the predefined linkage values - * @param cutOff the cut-off value that determines where to cut the hierarchic tree into clusters - * @returns the resulting number of clusters - * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is used - * @static - */ - static hierarchicalClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage,cutOff:number):number; - /** - * Partitions the graph into clusters based on hierarchical clustering. - *

- * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the - * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the - * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances - * metric. The algorithm continues until all nodes belong to the same cluster. - *

- *

- * The result is returned as a {@link yfiles.algorithms.Dendrogram} object which represents the result of the clustering algorithm - * as a binary tree structure. It can easily be traversed by starting from the {@link yfiles.algorithms.Dendrogram#root root node} and moving on to nodes of the next - * level via method {@link yfiles.algorithms.Dendrogram#getChildren}. - *

- * @param graph the input graph - * @param distances a given {@link } object that determines the distance between any two nodes - * @param linkage one of the predefined linkage values - * @returns a {@link } which represents the result of the clustering as a binary tree - * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is given - * @static - */ - static hierarchicalClustering(graph:yfiles.algorithms.Graph,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage):yfiles.algorithms.Dendrogram; - /** - * Partitions the graph into clusters using k-means clustering algorithm. - *

- * The nodes of the graph will be partitioned in k clusters based on their positions such that their distance from the - * cluster's mean (centroid) is minimized. - *

- *

- * The distance can be defined using diverse metrics as euclidean distance, euclidean-squared distance, manhattan distance - * or chebychev distance. - *

- * @param graph the input graph - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param nodePositions the {@link } that holds a {@link point} representing the current position of each node in the graph - * @param distanceMetric one of the predefined distance metrics - * @param k the number of clusters - * @param [iterations=100] the maximum number of iterations performed by the algorithm for convergence - * @param [centroids=null] the initial centroids - * @returns the number of resulting (non-empty) clusters - * @throws {Stubs.Exceptions.ArgumentError} if the given distance metric is not supported - * @static - */ - static kMeansClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,nodePositions:yfiles.algorithms.IDataProvider,distanceMetric:yfiles.algorithms.DistanceMetric,k:number,iterations?:number,centroids?:yfiles.algorithms.YPoint[]):number; - /** - * Partitions the graph into clusters using k-means clustering algorithm. - *

- * The nodes of the graph will be partitioned in k clusters based on their positions such that their distance from the - * cluster's mean (centroid) is minimized. - *

- *

- * The distance can be defined using diverse metrics as euclidean distance, euclidean-squared distance, manhattan distance - * or chebychev distance. - *

- * @param {Object} options The parameters to pass. - * @param options.graph the input graph - * @param options.clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param options.nodePositions the {@link } that holds a {@link point} representing the current position of each node in the graph - * @param options.distanceMetric one of the predefined distance metrics - * @param options.k the number of clusters - * @param [options.iterations=100] the maximum number of iterations performed by the algorithm for convergence - * @param [options.centroids=null] the initial centroids - * @returns the number of resulting (non-empty) clusters - * @throws {Stubs.Exceptions.ArgumentError} if the given distance metric is not supported - * @static - */ - static kMeansClustering(options:{graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,nodePositions:yfiles.algorithms.IDataProvider,distanceMetric:yfiles.algorithms.DistanceMetric,k:number,iterations?:number,centroids?:yfiles.algorithms.YPoint[]}):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Groups; - } - /** - * A general interface for iterating over a collection of objects. - *

- * It can be regarded as a read-only view of such a collection. - *

- *

- * A YCursor acts like a movable pointer on the elements of a collection. The pointer can be moved forward and backward and - * the element currently pointed on can be accessed. The removal of elements can only be performed on the provider of the - * cursor, not on the cursor itself. (That's why the cursor presents a read-only view.) - *

- *

- * Implementations of this interface do not need to support operations marked "optional." - *

- * @interface - */ - export interface ICursor extends yfiles.lang.Object{ - /** - * Moves this cursor one position forward. - * @abstract - */ - next():void; - /** - * Moves this cursor one position backward (optional). - * @abstract - */ - prev():void; - /** - * Moves this cursor to the first valid cursor position (optional). - * @abstract - */ - toFirst():void; - /** - * Moves this cursor to the last valid cursor position (optional). - * @abstract - */ - toLast():void; - /** - * Gets true if the current cursor position is valid. - * @abstract - * @type {boolean} - */ - ok:boolean; - /** - * Gets the object currently pointed on. - * @abstract - * @type {any} - */ - current:any; - /** - * Gets the number of elements that can be accessed with this cursor. - * @abstract - * @type {number} - */ - size:number; - } - var ICursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.ICursor; - }; - /** - * A general interface for setting data. - *

- * A data acceptor associates data with data holders. It constitutes a write-only view on particular data. - *

- * @interface - */ - export interface IDataAcceptor extends yfiles.lang.Object{ - /** - * Sets an object value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @param value - * @abstract - */ - set(dataHolder:any,value:any):void; - /** - * Sets a boolean value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @param value - * @abstract - */ - setBoolean(dataHolder:any,value:boolean):void; - /** - * Sets an integer value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @param value - * @abstract - */ - setInt(dataHolder:any,value:number):void; - /** - * Sets a double value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @param value - * @abstract - */ - setNumber(dataHolder:any,value:number):void; - } - var IDataAcceptor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IDataAcceptor; - }; - /** - * Interface that combines the {@link yfiles.algorithms.IDataProvider} and {@link yfiles.algorithms.IDataAcceptor} interfaces. - *

- * This interface does not declare any additional methods. - *

- * @interface - * @implements {yfiles.algorithms.IDataProvider} - * @implements {yfiles.algorithms.IDataAcceptor} - */ - export interface IDataMap extends yfiles.lang.Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor{ - } - var IDataMap:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IDataMap; - }; - /** - * A general interface for data provision. - *

- * A data provider grants access to data associated with one or more data holders. It constitutes a read-only view on - * particular data. - *

- * @interface - */ - export interface IDataProvider extends yfiles.lang.Object{ - /** - * Returns an object value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @returns - * @abstract - */ - get(dataHolder:any):any; - /** - * Returns a boolean value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @returns - * @abstract - */ - getBoolean(dataHolder:any):boolean; - /** - * Returns an integer value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @returns - * @abstract - */ - getInt(dataHolder:any):number; - /** - * Returns a double value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @returns - * @abstract - */ - getNumber(dataHolder:any):number; - } - var IDataProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IDataProvider; - }; - /** - * A cursor interface for iterating over edges. - * @interface - * @implements {yfiles.algorithms.ICursor} - */ - export interface IEdgeCursor extends yfiles.lang.Object,yfiles.algorithms.ICursor{ - /** - * Moves the cursor to the cyclic next element of the underlying sequence. - *

- * This is the next element if available, else it is the first element. - *

- * @abstract - */ - cyclicNext():void; - /** - * Moves the cursor to the cyclic previous element of the underlying sequence. - *

- * This is the previous element if available, else it is the last element. - *

- * @abstract - */ - cyclicPrev():void; - /** - * Gets the edge at the current location of the cursor. - *

- * This method is the typed variant of {@link yfiles.algorithms.ICursor#current}. - *

- * @abstract - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - } - var IEdgeCursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IEdgeCursor; - }; - /** - * Provides access to data associated with an edge. - *

- * An edge map can be considered as a map that allows only edges as keys. Edge keys of an edge map must belong to the same - * graph. - *

- *

- * There are data access methods defined for the most common typed values as well. - *

- *

- * The edge values are initialized with Java(TM) default values (null, 0, 0.0, false) upon initialization. - *

- * @interface - * @implements {yfiles.algorithms.IDataProvider} - * @implements {yfiles.algorithms.IDataAcceptor} - * @implements {yfiles.algorithms.IDataMap} - */ - export interface IEdgeMap extends yfiles.lang.Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor,yfiles.algorithms.IDataMap{ - } - var IEdgeMap:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IEdgeMap; - }; - /** - * A cursor interface for iterating over nodes. - * @interface - * @implements {yfiles.algorithms.ICursor} - */ - export interface INodeCursor extends yfiles.lang.Object,yfiles.algorithms.ICursor{ - /** - * Moves the cursor to the cyclic next element of the underlying sequence. - *

- * This is the next element if available, else it is the first element. - *

- * @abstract - */ - cyclicNext():void; - /** - * Moves the cursor to the cyclic previous element of the underlying sequence. - *

- * This is the previous element if available, else it is the last element. - *

- * @abstract - */ - cyclicPrev():void; - /** - * Gets the node at the current location of the cursor. - *

- * This method is the typed variant of {@link yfiles.algorithms.ICursor#current}. - *

- * @abstract - * @type {yfiles.algorithms.Node} - */ - node:yfiles.algorithms.Node; - } - var INodeCursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.INodeCursor; - }; - /** - * Provides access to data associated with a node. - *

- * A node map can be considered as a map that allows only nodes as keys. Node keys of a node map must belong to the same - * graph. - *

- *

- * There are data access methods defined for the most common typed values as well. - *

- *

- * The node values are initialized with Java(TM) default values (null, 0, 0.0, false) upon initialization. - *

- * @interface - * @implements {yfiles.algorithms.IDataProvider} - * @implements {yfiles.algorithms.IDataAcceptor} - * @implements {yfiles.algorithms.IDataMap} - */ - export interface INodeMap extends yfiles.lang.Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor,yfiles.algorithms.IDataMap{ - } - var INodeMap:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.INodeMap; - }; - /** - * This is a generic interface for classes that provide an ordering for the nodes of a graph. - * @interface - */ - export interface INodeSequencer extends yfiles.lang.Object{ - /** - * Returns a cursor that grants access to all nodes of the given graph in some order. - * @param graph the input graph - * @returns a {@link } that grants access to all nodes of a graph - * @abstract - */ - nodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.INodeCursor; - } - var INodeSequencer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.INodeSequencer; - }; - /** - * This class provides methods for calculating independent sets. - *

- * An independent set is a set of nodes in a graph, in which no two nodes are adjacent. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0, "c":0},"styles":{"6":{"s":[35,35],"c":1, "f":"#FF0000", "b":0}},"n":[[425,305,6],[645,305],[425,525],[645,525,6],[485,365],[585,365,6],[485,465,6],[585,465]],"e":[[0,4],[0,1],[1,3],[3,2],[2,0],[4,6],[6,2],[6,7],[7,5],[5,4],[5,1],[7,3]],"vp":[425.0,305.0,250.0,250.0]}} Circular nodes represent one of the independent sets of the given graph - *

- * @class - * @static - */ - export interface IndependentSets extends yfiles.lang.Object{} - export class IndependentSets { - /** - * Calculates an independent set for a given graph. - *

- * A greedy heuristic is applied which tries to find a large independent set. - *

- * @param conflictGraph the input graph - * @returns a {@link } containing an independent set of nodes - * @see yfiles.algorithms.IndependentSets#getIndependentSet - * @static - */ - static getIndependentSet(conflictGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; - /** - * Partitions the set of nodes of the given graph into independent sets. - *

- * The method iteratively calls method {@link yfiles.algorithms.IndependentSets#getIndependentSet}. - *

- * @param conflictGraph the input graph - * @returns an array of {@link }s each of which contains an independent set of nodes - * @see yfiles.algorithms.IndependentSets#getIndependentSet - * @static - */ - static getIndependentSets(conflictGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.IndependentSets; - } - /** - * Represents a so-called "cell" or "link" of the doubly linked list implementation {@link yfiles.algorithms.YList}. - *

- * It may be used to perform fast access and remove operations on that type of list. - *

- * @class - * @final - */ - export interface ListCell extends yfiles.lang.Object{} - export class ListCell { - /** - * Returns the predecessor cell of this cell. - *

- * If there is no predecessor, then null is returned. - *

- * @returns - */ - pred():yfiles.algorithms.ListCell; - /** - * Returns the successor cell of this cell. - *

- * If there is no successor, then null is returned. - *

- * @returns - */ - succ():yfiles.algorithms.ListCell; - /** - * Gets or sets the element stored in this cell. - * @type {any} - */ - info:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.ListCell; - } - /** - * This class provides sophisticated algorithms for solving classical network flow problems. - *

- * Definitions - *

- *
    - *
  • - * Maximum flow problem: – Given a directed graph in which each edge has a capacity and given a source node s and a sink node t, find a flow of - * maximum value from s to t. - *
  • - *
  • - * Minimum cut problem: – Given a directed graph in which each edge has a capacity and given a source node s and a sink node t, find an s-t cut of - * minimum capacity (i.e., a set of edges of minimum capacity whose removal would disconnect t from s). - *
  • - *
  • - * Minimum cost flow problem: – Given a directed graph in which each edge has a cost and a capacity and each node has a supply or demand, find a flow of - * minimum total cost that satisfies the edge capacities and the node balances. - *
  • - *
  • - * Minimum cost maximum flow problem: – Given a directed graph in which each edge has a cost and a capacity and given a source node s and a sink node t, find a - * flow of maximum value from s to t that has the minimum total cost. - *
  • - *
- * @class - * @static - */ - export interface NetworkFlows extends yfiles.lang.Object{} - export class NetworkFlows { - /** - * Solves a maximum flow problem using the preflow-push method. - *

- * The implementation is based on - *

- *
    - *
  • Mehlhorn, Naeher: LEDA: a platform for combinatorial and geometric computing, Cambridge University Press, 2000, pp. 443-488.
  • - *
- *

- * The worst case running time is O(mdeg * n^2 * m^(1/2)), where n is the number of nodes in the network, m the number of - * edges and mdeg the maximal degree of any node. - *

- *

- * Edges may have infinite capacity, which is denoted by the value 0x7FFFFFFF. - *

- * @param graph the given network - * @param source the source node of the network - * @param sink the sink node of the network - * @param eCapDP the {@link } that returns the integer capacity of each edge or null if no bound is specified - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @returns the maximum flow value - * @see yfiles.algorithms.NetworkFlows#calcMaxFlowMinCut - * @static - */ - static calcMaxFlow(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,sink:yfiles.algorithms.Node,eCapDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap):number; - /** - * Solves a maximum flow problem using the preflow-push method but additionally marks all nodes that belong to the minimum - * cut set that is associated with the source of the network. - * @param graph the given network - * @param source the source node of the network - * @param sink the sink node of the network - * @param eCapDP the {@link } that returns the integer capacity of each edge or null if no bound is specified - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @param sourceCutNM the {@link } that will be filled during the execution and returns a boolean value indicating whether - * or not a node belongs to the cut set associated with the source of the network - * @returns the maximum flow value - * @see yfiles.algorithms.NetworkFlows#calcMaxFlow - * @static - */ - static calcMaxFlowMinCut(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,sink:yfiles.algorithms.Node,eCapDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,sourceCutNM:yfiles.algorithms.INodeMap):number; - /** - * Solves a minimum cost maximum flow problem. - * @param graph the given network - * @param s the source node of the network - * @param t the sink node of the network - * @param uCapDP the {@link } that returns the integer capacity of each edge or null if no bound is specified - * @param cost0DP the {@link } that returns a double value (cost) for each edge - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @param dualsNM the {@link } that will be filled during the execution with an integer value (dual value) for each node - * or null if no such values occur; dual values are also referred as potentials - * @returns the total cost of the flow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @static - */ - static minCostFlow(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number; - /** - * Solves a minimum cost flow problem with a capacity scaling algorithm. - *

- * This algorithm is a variant of the successive shortest path algorithm (see Ahuja,Magnanti,Orlin: Network flows, Prentice Hall, 1993, - * pp.320-324). It has the pseudo-polynomial running time O(m*log U*(m+n log n)) where n is the number of nodes in the - * network, m the number of edges and U the maximal edge capacity. - *

- *

- * Edges may have infinite capacity, which is denoted by the value 0x7FFFFFFF. - *

- *

- * There are no restriction for the costs. In particular, they can also be negative. - *

- * @param graph the given network - * @param lCapDP the {@link } that returns the integer lower bound for the capacity of each edge or null if no - * bound is specified - * @param uCapDP the {@link } that returns the integer upper bound for the capacity of each edge or null if no - * bound is specified - * @param cost0DP the {@link } that returns a double value (cost) of each edge - * @param supplyDP the {@link } that returns the supply/demand of each node; supply is denoted by a positive value, - * demand by a negative value - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @param dualsNM the {@link } that will be filled during the execution with an integer value (dual value) for each node - * or null if no such values occur; dual values are also referred as potentials - * @returns the total cost of the flow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @static - */ - static minCostFlow(graph:yfiles.algorithms.Graph,lCapDP:yfiles.algorithms.IDataProvider,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,supplyDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number; - /** - * Uses method {@link yfiles.algorithms.NetworkFlows#minCostFlow} to solve a minimum cost flow problem. - * @param graph the given network - * @param uCapDP the {@link } that returns the integer capacity of each edge or null if no bound is specified - * @param cost0DP the {@link } that returns a double value (cost) for each edge - * @param supplyDP the {@link } that returns the supply/demand of each node; supply is denoted by a positive value, - * demand by a negative value - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @param dualsNM the {@link } that will be filled during the execution with an integer value (dual value) for each node - * or null if no such values occur; dual values are also referred as potentials - * @returns the total cost of the flow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @static - */ - static minCostFlow(graph:yfiles.algorithms.Graph,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,supplyDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.NetworkFlows; - } - /** - * Represents a so-called node in the directed graph data type {@link yfiles.algorithms.Graph}. - *

- * Most notably, a node provides access to its adjacent edges (represented by instances of class - * {@link yfiles.algorithms.Edge}). These can be distinguished into the sets of incoming and outgoing edges. - *

- *

- * Iteration over all three sets of edges is provided by means of bidirectional cursors that present a read-only view of - * the respective set ({@link yfiles.algorithms.Node#getEdgeCursor}, {@link yfiles.algorithms.Node#getInEdgeCursor}, - * {@link yfiles.algorithms.Node#getOutEdgeCursor}). Also supported is iteration over all nodes at opposite ends of either incoming - * edges or outgoing edges ({@link yfiles.algorithms.Node#getPredecessorCursor}, {@link yfiles.algorithms.Node#getSuccessorCursor}). - *

- *

- * The number of overall edges at a node is called its degree ({@link yfiles.algorithms.Node#degree}), which is the sum of incoming and outgoing edges ({@link yfiles.algorithms.Node#inDegree}, {@link yfiles.algorithms.Node#outDegree}). - *

- *

- * Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that - * there is no way to create or delete a node or an edge without using an actual Graph instance. - *

- * @class - * @extends {yfiles.algorithms.GraphObject} - */ - export interface Node extends yfiles.algorithms.GraphObject{} - export class Node { - /** - * Instantiates a new Node object that will be part of the given graph. - * @param g The graph that the created node will belong to. - */ - constructor(g:yfiles.algorithms.Graph); - /** - * Creates a copy of this node that will be inserted into the given graph. - * @param g The graph that the created node will belong to. - * @returns The newly created Node object. - */ - createCopy(g:yfiles.algorithms.Graph):yfiles.algorithms.Node; - /** - * Returns an edge that connects this node with the given node, if such an edge exists. - *

- * Otherwise null is returned. - *

- *

- * Note that the first matching edge is returned, and that outgoing edges are tested prior to incoming edges. - *

- * @param opposite - * @returns - * @see yfiles.algorithms.Node#getEdgeFrom - * @see yfiles.algorithms.Node#getEdgeTo - */ - getEdge(opposite:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns an edge cursor for all incoming and outgoing edges at this node. - * @returns - * @see yfiles.algorithms.Node#getInEdgeCursor - * @see yfiles.algorithms.Node#getOutEdgeCursor - */ - getEdgeCursor():yfiles.algorithms.IEdgeCursor; - /** - * Returns an incoming edge that connects the given node with this node, if such an edge exists. - *

- * Otherwise null is returned. - *

- * @param source - * @returns - * @see yfiles.algorithms.Node#getEdge - * @see yfiles.algorithms.Node#getEdgeTo - */ - getEdgeFrom(source:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns an outgoing edge that connects this node with the given node, if such an edge exists. - *

- * Otherwise null is returned. - *

- * @param target - * @returns - * @see yfiles.algorithms.Node#getEdge - * @see yfiles.algorithms.Node#getEdgeFrom - */ - getEdgeTo(target:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns an edge cursor for incoming edges at this node. - *

- * If an edge is specified, the cursor starts at the given edge, and the cyclic sequence order is the same as returned by - * {@link yfiles.algorithms.Node#getInEdgeCursor}. - *

- * @param [startEdge=null] The first edge being accessed by the returned cursor. - * @returns - * @see yfiles.algorithms.Node#getOutEdgeCursor - */ - getInEdgeCursor(startEdge?:yfiles.algorithms.Edge):yfiles.algorithms.IEdgeCursor; - /** - * Returns a node cursor for all neighbor nodes of this node. - *

- * Neighbor nodes are those at the opposite ends of both incoming and outgoing edges. - *

- * @returns - * @see yfiles.algorithms.Node#getPredecessorCursor - * @see yfiles.algorithms.Node#getSuccessorCursor - */ - getNeighborCursor():yfiles.algorithms.INodeCursor; - /** - * Returns an edge cursor for outgoing edges at this node. - *

- * If an edge is specified, the cursor starts at the given edge, and the cyclic sequence order is the same as returned by - * {@link yfiles.algorithms.Node#getOutEdgeCursor}. - *

- * @param [startEdge=null] The first edge being accessed by the returned cursor. - * @returns - * @see yfiles.algorithms.Node#getInEdgeCursor - */ - getOutEdgeCursor(startEdge?:yfiles.algorithms.Edge):yfiles.algorithms.IEdgeCursor; - /** - * Returns a node cursor for all predecessor nodes of this node. - *

- * Predecessor nodes are those at the opposite ends of incoming edges. - *

- * @returns - * @see yfiles.algorithms.Node#getSuccessorCursor - */ - getPredecessorCursor():yfiles.algorithms.INodeCursor; - /** - * Returns a node cursor for all successor nodes of this node. - *

- * Successor nodes are those at the opposite ends of outgoing edges. - *

- * @returns - * @see yfiles.algorithms.Node#getPredecessorCursor - */ - getSuccessorCursor():yfiles.algorithms.INodeCursor; - /** - * Sorts incoming edges at this node according to the given comparator. - * @param c - * @see yfiles.algorithms.Node#sortOutEdges - */ - sortInEdges(c:yfiles.collections.IComparer):void; - /** - * Sorts outgoing edges at this node according to the given comparator. - * @param c - * @see yfiles.algorithms.Node#sortInEdges - */ - sortOutEdges(c:yfiles.collections.IComparer):void; - /** - * Gets the overall number of incoming and outgoing edges at this node. - *

- * Note that self-loops are counted twice. - *

- * @see yfiles.algorithms.Edge - * @see yfiles.algorithms.Node#inDegree - * @see yfiles.algorithms.Node#outDegree - * @type {number} - */ - degree:number; - /** - * Gets the number of incoming edges at this node. - * @see yfiles.algorithms.Node#degree - * @see yfiles.algorithms.Node#outDegree - * @type {number} - */ - inDegree:number; - /** - * Gets the number of outgoing edges at this node. - * @see yfiles.algorithms.Node#degree - * @see yfiles.algorithms.Node#inDegree - * @type {number} - */ - outDegree:number; - /** - * Gets the index of this node within its graph G. - *

- * Node indices represent the ordering of standard node iteration on G. The value of an index is >= 0 and - * < G.nodeCount(). - *

- *

- * Note that indices are subject to change whenever the sequence of nodes in a graph is modified by either removing, - * hiding, reinserting, or unhiding a node, or by explicitly changing its position in the sequence. - *

- * @see yfiles.algorithms.Graph#removeNode - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#reInsertNode - * @see yfiles.algorithms.Graph#unhide - * @see yfiles.algorithms.Graph#moveToFirst - * @see yfiles.algorithms.Graph#moveToLast - * @type {number} - */ - index:number; - /** - * Gets the graph this node belongs to. - *

- * If the node does not belong to a graph, because it was removed or hidden from it, this method returns null. - *

- * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - /** - * Gets the first outgoing edge at this node, or null if it does not exist. - * @see yfiles.algorithms.Node#firstInEdge - * @see yfiles.algorithms.Node#lastOutEdge - * @type {yfiles.algorithms.Edge} - */ - firstOutEdge:yfiles.algorithms.Edge; - /** - * Gets the first incoming edge at this node, or null if it does not exist. - * @see yfiles.algorithms.Node#firstOutEdge - * @see yfiles.algorithms.Node#lastInEdge - * @type {yfiles.algorithms.Edge} - */ - firstInEdge:yfiles.algorithms.Edge; - /** - * Gets the last outgoing edge at this node, or null if it does not exist. - * @see yfiles.algorithms.Node#firstOutEdge - * @see yfiles.algorithms.Node#lastInEdge - * @type {yfiles.algorithms.Edge} - */ - lastOutEdge:yfiles.algorithms.Edge; - /** - * Gets the last incoming edge at this node, or null if it does not exist. - * @see yfiles.algorithms.Node#firstInEdge - * @see yfiles.algorithms.Node#lastOutEdge - * @type {yfiles.algorithms.Edge} - */ - lastInEdge:yfiles.algorithms.Edge; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for {@link yfiles.algorithms.Edge}s that can be used to iterate over outgoing edges at this instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that self-loop edges are reported, - * too. - *

- * @type {yfiles.collections.IEnumerable.} - */ - outEdges:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for {@link yfiles.algorithms.Edge}s that can be used to iterate over ingoing edges at this instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that self-loop edges are reported, - * too. - *

- * @type {yfiles.collections.IEnumerable.} - */ - inEdges:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for {@link yfiles.algorithms.Edge}s that can be used to iterate over the adjacent edges at this instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that self-loop edges are reported twice - * (as in edge and as out edge). - *

- * @type {yfiles.collections.IEnumerable.} - */ - edges:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent outgoing edges at this - * instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that for self-loop edges this node - * itself will be reported as a successor. - *

- * @type {yfiles.collections.IEnumerable.} - */ - successors:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent incoming edges at this - * instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that for self-loop edges this node - * itself will be reported as a predecessor. - *

- * @type {yfiles.collections.IEnumerable.} - */ - predecessors:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent adjacent edges at this - * instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that for self-loop edges this node - * itself will be reported as a neighbor, twice. - *

- * @type {yfiles.collections.IEnumerable.} - */ - neighbors:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Node; - } - /** - * Specialized list implementation for instances of type {@link yfiles.algorithms.Node}. - * @class - * @extends {yfiles.algorithms.YList} - * @implements {yfiles.collections.IEnumerable.} - */ - export interface NodeList extends yfiles.algorithms.YList{} - export class NodeList { - /** - * Creates a list that is initialized with the entries of the given list. - * @param list the values are added to the new list - */ - constructor(list:yfiles.algorithms.NodeList); - /** - * Creates a list that is initialized with a single node provided. - * @param v - */ - constructor(v:yfiles.algorithms.Node); - /** - * Creates a list that is initialized with the nodes provided by the given array of nodes. - * @param a - */ - constructor(a:yfiles.algorithms.Node[]); - /** - * Creates a list that is initialized with those nodes from the given NodeCursor object for which the given data provider - * returns true upon calling its {@link yfiles.algorithms.IDataProvider#getBoolean getBool} method. - * @param nc A node cursor providing nodes that should be added to this list. - * @param predicate A data provider that acts as a inclusion predicate for each node accessible by the given node cursor. - */ - constructor(nc:yfiles.algorithms.INodeCursor,predicate:yfiles.algorithms.IDataProvider); - /** - * Creates a list that is initialized with the nodes provided by the given NodeCursor object. - * @param c - */ - constructor(c:yfiles.algorithms.INodeCursor); - /** - * Creates an empty node list. - */ - constructor(); - /** - * Returns the first node in this list, or null when the list is empty. - * @returns The first node in the list. - */ - firstNode():yfiles.algorithms.Node; - /** - * Returns an enumerator for this collection. - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Returns the last node in this list, or null when the list is empty. - * @returns The last node in the list. - */ - lastNode():yfiles.algorithms.Node; - /** - * Returns a node cursor for this node list. - * @returns A node cursor granting access to the nodes within this list. - */ - nodes():yfiles.algorithms.INodeCursor; - /** - * Removes the first node from this list and returns it. - * @returns The first node from the list. - */ - popNode():yfiles.algorithms.Node; - /** - * Returns a node array containing all elements of this list in the canonical order. - * @returns - */ - toNodeArray():yfiles.algorithms.Node[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.NodeList; - } - /** - * This class provides algorithms that order the nodes of a graph using specific criteria. - *

- * Definitions - *

- *
    - *
  • - * A topological ordering of the nodes of a directed graph is a linear ordering of the nodes such that for each directed edge (u,v), node u lies - * before v in the ordering. - *
  • - *
  • A DFS completion ordering of the nodes of a graph is a node ordering identical to the order of node completion events in a {@link yfiles.algorithms.Dfs depth first search}.
  • - *
  • An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that:
  • - *
- * @class - * @static - */ - export interface NodeOrders extends yfiles.lang.Object{} - export class NodeOrders { - /** - * Calculates an ordering of the nodes identical to the order of node completion events in a depth first search. - *

- * This ordering is a reversed topological ordering in case the input graph is acyclic. - *

- * @param graph the input graph - * @param order an array of {@link }s that returns for each {@link } v, its zero-based index within the calculated ordering, i.e., - * order[v.index()] == 5 means that v is the 6-th node within the ordering - * @see yfiles.algorithms.NodeOrders#topological - * @see yfiles.algorithms.NodeOrders#dfsCompletion - * @static - */ - static dfsCompletion(graph:yfiles.algorithms.Graph,order:number[]):void; - /** - * Calculates an ordering of the nodes identical to the order of node completion events in a depth first search. - *

- * Like {@link yfiles.algorithms.NodeOrders#dfsCompletion} but the result is returned as a {@link yfiles.algorithms.NodeList}. - *

- *

- * This ordering is a reversed topological ordering in case the input graph is acyclic. - *

- * @param graph the input graph - * @returns a {@link } containing the nodes of the graph in the order identical to the order of node completion - * events in a depth first search - * @see yfiles.algorithms.NodeOrders#topological - * @see yfiles.algorithms.NodeOrders#dfsCompletion - * @static - */ - static dfsCompletion(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; - /** - * Assigns an st-ordering to the nodes of a biconnected graph given the edge between source node s and sink node t. - *

- * An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that: - *

- *
    - *
  • Source node s and sink node t are connected by an edge.
  • - *
  • For each node v_i in the ordering other than s or t, there are neighbors v_j and v_k with j < i and k > i.
  • - *
- * @param graph the input graph - * @param stOrder an array of {@link }s that will be filled during the execution and returns for each {@link } v, its zero-based - * index within the calculated ordering, i.e., stOrder[v.index()] == 5 means that v is the 6-th node within the ordering - * @param [stEdge=null] an {@link } that connects source node s and sink node t - * @see yfiles.algorithms.NodeOrders#st - * @see yfiles.algorithms.NodeOrders#st - * @static - */ - static st(graph:yfiles.algorithms.Graph,stOrder:number[],stEdge?:yfiles.algorithms.Edge):void; - /** - * Assigns an st-ordering to the nodes of a biconnected graph. - *

- * Like {@link yfiles.algorithms.NodeOrders#st} but the result is returned as a {@link yfiles.algorithms.NodeList}. - *

- *

- * An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that: - *

- *
    - *
  • Source node s and sink node t are connected by an edge.
  • - *
  • For each node v_i in the ordering other than s or t, there are neighbors v_j and v_k with j < i and k > i.
  • - *
- * @param graph the input graph - * @returns a {@link } containing the nodes of the graph in the order defined by the st-ordering - * @see yfiles.algorithms.NodeOrders#st - * @static - */ - static st(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; - /** - * Converts an array-based result returned by a method of this class to a {@link yfiles.algorithms.NodeList} that contains all - * nodes in the order provided by the given array. - * @param graph the input graph - * @param order an array of {@link }s that will be filled during the execution and returns for each {@link } v, its zero-based - * index within the calculated ordering, i.e., order[v.index()] == 5 means that v is the 6-th node within the ordering - * @returns a {@link } containing the nodes of the graph in the order provided by the given array - * @static - */ - static toNodeList(graph:yfiles.algorithms.Graph,order:number[]):yfiles.algorithms.NodeList; - /** - * Copies an array-based result returned by a method of this class to a {@link yfiles.algorithms.INodeMap} that will provide values - * of basic type int. - * @param graph the input graph - * @param order an array of {@link }s that returns for each {@link } v, its zero-based index within the calculated ordering, i.e., - * order[v.index()] == 5 means that v is the 6-th node within the ordering - * @param result the {@link } that will be filled during the execution with the zero-based index of each node within - * the calculated ordering - * @static - */ - static toNodeMap(graph:yfiles.algorithms.Graph,order:number[],result:yfiles.algorithms.INodeMap):void; - /** - * Copies a {@link yfiles.algorithms.NodeList}-based result returned by a method of this class to a {@link yfiles.algorithms.INodeMap} that - * will provide values of basic type int. - * @param order a {@link } containing the nodes of the graph in the appropriate order - * @param result the {@link } that will be filled during the execution with the zero-based index of each node within - * the calculated ordering - * @static - */ - static toNodeMap(order:yfiles.algorithms.NodeList,result:yfiles.algorithms.INodeMap):void; - /** - * Assigns a topological ordering to the nodes of a directed acyclic graph. - *

- * A topological ordering of the nodes of a directed graph is a linear ordering of the nodes such that for each directed - * edge (u,v), node u lies before v in the ordering. - *

- * @param graph the input graph - * @param order an array of {@link }s that will be filled during the execution and returns for each {@link } v, its zero-based - * index within the calculated ordering, i.e., order[v.index()] == 5 means that v is the 6-th node within the ordering - * @returns true if the graph is acyclic, false otherwise - * @see yfiles.algorithms.NodeOrders#topological - * @static - */ - static topological(graph:yfiles.algorithms.Graph,order:number[]):boolean; - /** - * Returns a topological ordering of the nodes of a directed acyclic graph. - * @param graph the input graph - * @returns a {@link } containing the nodes of the graph in the order they appear in the topological ordering - * @throws {Stubs.Exceptions.ArgumentError} if the graph is cyclic - * @see yfiles.algorithms.NodeOrders#topological - * @static - */ - static topological(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.NodeOrders; - } - /** - * This class provides methods for finding paths within a graph that have certain properties. - *

- * Definitions - *

- *
    - *
  • - * A path of length k from node u to node v in a graph is a sequence v0, v1, v2, ... , vk of nodes such that u = v0, v = vk and - * (vi-1, vi) in E, for each i = 1, 2, .. , k. - *
  • - *
  • A path is called simple if no node appears twice.
  • - *
  • A chain is a path of maximum length in which each internal node has degree 2.
  • - *
  • - * The longest path problem is the problem of finding a simple path of maximum length in a given graph. The longest path problem is - * NP-hard for undirected graphs, but can be solved in linear time for directed acyclic graphs. - *
  • - *
- * @class - * @static - */ - export interface Paths extends yfiles.lang.Object{} - export class Paths { - /** - * Constructs a {@link yfiles.algorithms.NodeList path of nodes} from a given {@link yfiles.algorithms.EdgeList path of edges}. - *

- * The returned node path has length path.size()+1, if the given path is not empty. Otherwise, the returned path will be - * empty. The i-th node in the returned path will be either source or target node of the i-th edge in the given path. - *

- * @param path the given {@link path of edges} - * @returns a {@link path of nodes} from the given {@link path of edges} - * @static - */ - static constructNodePath(path:yfiles.algorithms.EdgeList):yfiles.algorithms.NodeList; - /** - * Returns all chains present in the given graph. - *

- * A chain is a path of maximum length in which each internal node has degree 2. - *

- *

- * The internal nodes on directed chains all have in-degree 1 and out-degree 1. - *

- * @param graph the input graph - * @param directed true if the chain should be considered as directed, false otherwise - * @returns an array of {@link }s each of which contains the edges (at least two) that make up a chain - * @see yfiles.algorithms.Paths#constructNodePath - * @static - */ - static findAllChains(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList[]; - /** - * A variant of {@link yfiles.algorithms.Paths#findAllPaths} which returns all simple directed or undirected paths between two - * given nodes and, additionally, allows to specify a filter for the paths to be returned. - * @param graph the input graph - * @param startNode the given start node - * @param endNode the given end node - * @param directed true if the path should be considered as directed, false otherwise - * @param filter a predicate that accepts or rejects a found {@link } and adds it to the result - * @returns an array of {@link }s each of which represents a path between the start and end node. - * @static - */ - static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean,filter:(obj:yfiles.algorithms.EdgeList)=>boolean):yfiles.algorithms.EdgeList[]; - /** - * Returns all simple directed or undirected paths that connect a start node with an end node. - * @param graph the input graph - * @param startNode the given start node - * @param endNode the given end node - * @param directed true if the path should be considered as directed, false otherwise - * @returns an array of {@link }s each of which represents a path between the start and end node - * @static - */ - static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.EdgeList[]; - /** - * Finds all edges that belong to a directed path from a start node to an end node. - * @param graph the input graph - * @param startNode the given start node - * @param endNode the given end node - * @param pathEdges the {@link } that will be filled during the execution with a boolean value indicating whether or not - * an edge belongs to a path connecting the two given nodes - * @static - */ - static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,pathEdges:yfiles.algorithms.IEdgeMap):void; - /** - * A variant of - * {@link yfiles.algorithms.Paths#findAllPaths}, which returns all simple directed or undirected paths between two given nodes as a - * special cursor that calculates the next path in the sequence, only when needed. - *

- * The returned cursor only supports the operation {@link yfiles.algorithms.ICursor#ok}, {@link yfiles.algorithms.ICursor#current}, {@link yfiles.algorithms.ICursor#size} and {@link yfiles.algorithms.ICursor#next}. - *

- * @param graph the input graph - * @param startNode the given start node - * @param endNode the given end node - * @param directed true if the path should be considered as directed, false otherwise - * @returns a {@link } that calculates the next path in the sequence - * @static - */ - static findAllPathsCursor(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.ICursor; - /** - * Returns the longest directed path in a given acyclic weighted graph. - *

- * All edges of the graph have an integral length associated with them. The longest path is defined as one of all directed - * paths within the graph for which the edge lengths of all contained edges sum up to a maximum. - *

- * @param graph a directed acyclic graph - * @param [edgeLength=null] the {@link } that returns the non-negative integer length of each edge - * @returns an {@link } containing the edges of the longest directed path - * @static - */ - static findLongestPath(graph:yfiles.algorithms.Graph,edgeLength?:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Calculates the longest path from a given node to all other node in a given directed acyclic graph. - * @param graph a directed acyclic graph - * @param startNode the node for which the distances are calculated - * @param dist the {@link } that returns the distance (i.e. weight) of type double for each edge - * @param maxDist the {@link } that will be filled during the execution and holds the maximum distance between the given - * node and all other nodes - * @param predicate the {@link } that returns a boolean value indicating whether or not an edge should be considered - * during the path search - * @static - */ - static findLongestPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,dist:yfiles.algorithms.IEdgeMap,maxDist:yfiles.algorithms.INodeMap,predicate:yfiles.algorithms.IEdgeMap):void; - /** - * Returns an {@link yfiles.algorithms.EdgeList} containing the edges of an undirected simple path within the given graph. - *

- * The edges are returned in the order that they appear in the found path. - *

- *

- * A heuristic is used for finding a path that is long. It is not guaranteed, though, that the returned path is actually - * the longest path within the given graph, since that is a well known hard problem. - *

- * @param graph the given graph - * @returns an {@link } containing the edges of an undirected simple path - * @static - */ - static findLongPath(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; - /** - * Returns whether or not a directed path from a start node to another node in an acyclic graph exists. - * @param graph an acyclic graph which contains the two nodes - * @param topSort a {@link list} of nodes sorted in topological order - * @param predicate the {@link } that returns a boolean value indicating whether or not an edge should be considered - * during the path search - * @param startNode - * @param endNode - * @returns true if a directed path from a start node to another node exists, false otherwise - * @static - */ - static findPath(graph:yfiles.algorithms.Graph,topSort:yfiles.algorithms.NodeList,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,predicate:yfiles.algorithms.IEdgeMap):boolean; - /** - * Returns an {@link yfiles.algorithms.EdgeList} containing the edges of a path from the given start node to the given end node, if - * such a path exists. - *

- * The edges are returned in the order that they appear in the found path. If the returned path is empty, no path between - * the given nodes was found. - *

- * @param graph the input graph - * @param startNode the first node of the path - * @param endNode the last node of the path - * @param directed true if the path should be directed, false otherwise - * @returns an {@link } containing the path edges between the start node and the end node - * @static - */ - static findPath(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.EdgeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Paths; - } - /** - * Represents an embedding of a planar graph. - *

- * A planar embedding is represented by a {@link yfiles.algorithms.PlanarEmbedding#faces list of faces}. Each face is represented by a list of {@link yfiles.algorithms.Dart darts} which describe the - * border of the face. - *

- * @class - * @final - */ - export interface PlanarEmbedding extends yfiles.lang.Object{} - export class PlanarEmbedding { - /** - * Creates a new embedding for the specified planar graph. - * @param graph a planar graph - * @throws {Stubs.Exceptions.ArgumentError} if the specified graph is not planar - */ - constructor(graph:yfiles.algorithms.Graph); - /** - * Returns the cyclic next dart of the given dart. - * @param dart a dart - * @returns the cyclic next dart of the given dart - */ - getCyclicNext(dart:yfiles.algorithms.Dart):yfiles.algorithms.Dart; - /** - * Returns the cyclic previous dart of the given dart. - * @param dart a dart - * @returns the cyclic previous dart of the given dart - */ - getCyclicPrevious(dart:yfiles.algorithms.Dart):yfiles.algorithms.Dart; - /** - * Returns the two darts associated with the given edge. - * @param edge an edge - * @returns the two darts associated with the given edge - */ - getDarts(edge:yfiles.algorithms.Edge):yfiles.algorithms.Dart[]; - /** - * Returns a {@link yfiles.collections.IList.} containing the (cyclic ordered) outgoing darts of the specified node. - * @param node a node - * @returns a {@link } containing the (cyclic ordered) outgoing darts - */ - getOutgoingDarts(node:yfiles.algorithms.Node):yfiles.collections.IList; - /** - * Return whether or not the given graph is planar. - * @param graph the input graph - * @returns true if the given graph is planar, false otherwise - * @static - */ - static isPlanar(graph:yfiles.algorithms.Graph):boolean; - /** - * Gets a {@link yfiles.collections.IList.} of face lists. - *

- * More precisely, each entry of this list is another list that contains all {@link yfiles.algorithms.Dart darts} of a face. - *

- * @type {yfiles.collections.IList.>} - */ - faces:yfiles.collections.IList>; - /** - * Gets the {@link yfiles.collections.IList.} that represents the outer face. - * @see yfiles.algorithms.PlanarEmbedding#faces - * @type {yfiles.collections.IList.} - */ - outerFace:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.PlanarEmbedding; - } - /** - * This class provides algorithms for solving the rank assignment problem. - *

- * Definitions Let G=(V,E) be a directed acyclic graph. Let length(e) denote the minimum length and weight(e) the weight of an edge - * e. - *

- *

- * The rank assignment problem is the problem of finding integer values rank(v) for all v in V, such that: - *

- *
    - *
  • rank(v) - rank(w) >= length(v,w), for all (v,w) in E and,
  • - *
  • the sum ∑(weight(v,w) * (rank(v) - rank(w))) over all (v,w) in E is minimized.
  • - *
- * @class - * @static - */ - export interface RankAssignments extends yfiles.lang.Object{} - export class RankAssignments { - /** - * Like {@link yfiles.algorithms.RankAssignments#simple}, but arrays are used instead of {@link yfiles.algorithms.INodeMap}s and - * {@link yfiles.algorithms.IEdgeMap}s. - *

- * Minimum edge length and weights should be non-negative. - *

- * @param graph the input graph in which all the edges have directions, such that rank[source] < rank[target] and - * rank[target] - rank[source] >= minlength[edge] - * @param rank an array that will be filled with the ranking r of each node v such that rank[v.index] == r - * @param minLength an array holding a non-negative value len of each edge e such that minLength[e.index] == len - * @param [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) - * @returns the number of layers - * @see yfiles.algorithms.RankAssignments#simple - * @static - */ - static simple(graph:yfiles.algorithms.Graph,rank:number[],minLength:number[],maximalDuration?:number):number; - /** - * This method quickly calculates a tight tree given a maximum time duration for the algorithm. - *

- * The algorithm is using a highly optimized version of Gansner's algorithm: - *

- *
    - *
  • E.R. Gansner et al., A Technique for Drawing Directed Graphs, IEEE Transactions on Software Engineering, Vol.19, No.3, March 1993.
  • - *
- *

- * Minimum edge length and weights should be non-negative. - *

- * @param graph the input graph in which all the edges have directions, such that rank[source] < rank[target] and - * rank[target] - rank[source] >= minlength[edge] - * @param rank the {@link } that will be filled during the execution and returns the integer ranking of each node - * @param minLength the {@link } that returns an integer value (minimum/tight length) of each edge - * @param [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) - * @returns - * @see yfiles.algorithms.RankAssignments#simple - * @static - */ - static simple(graph:yfiles.algorithms.Graph,rank:yfiles.algorithms.INodeMap,minLength:yfiles.algorithms.IEdgeMap,maximalDuration?:number):number; - /** - * Similar to {@link yfiles.algorithms.RankAssignments#simplex} but, additionally, it is possible to provide a valid initial tree - * solution for the problem. - *

- * Minimum edge length and weights should be non-negative. - *

- * @param graph the given graph - * @param layer the {@link } that will be filled during the execution and returns the zero-based ranking index for - * each node - * @param w the {@link } that returns an integer value (weight) of each edge - * @param minLength the {@link } that returns an integer value (minimum length) of each edge - * @param tree the {@link } that returns a boolean value indicating whether or not an edge is a tree edge - * @param _root the given root node of the tree solution - * @param validRanking true if the argument layer contains a valid ranking, false otherwise - * @param [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) - * @returns the number of layers - * @see yfiles.algorithms.RankAssignments#simplex - * @see yfiles.algorithms.RankAssignments#simplex - * @static - */ - static simplex(graph:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider,tree:yfiles.algorithms.IEdgeMap,_root:yfiles.algorithms.Node,validRanking:boolean,maximalDuration?:number):number; - /** - * Solves the rank assignment problem using the simplex method given a maximum time duration for the algorithm. - *

- * This method assigns a minimum rank to the nodes in a acyclic graph. - *

- *

- * Although its time complexity has not been proven polynomial, in practice it takes few iterations and runs quickly. - *

- *

- * The algorithm is based on: - *

- *
    - *
  • E.R. Gansner et al., A Technique for Drawing Directed Graphs, IEEE Transactions on Software Engineering, Vol.19, No.3, March 1993.
  • - *
- *

- * Minimum edge length and weights should be non-negative. - *

- * @param graph the given graph - * @param layer the {@link } that will be filled during the execution and returns the zero-based ranking index for - * each node - * @param w the {@link } that returns an integer value (weight) of each edge - * @param minLength the {@link } that returns an integer value (minimum length) of each edge - * @param [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) - * @returns the number of layers - * @see yfiles.algorithms.RankAssignments#simplex - * @see yfiles.algorithms.RankAssignments#simplex - * @static - */ - static simplex(graph:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider,maximalDuration?:number):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.RankAssignments; - } - /** - * This class provides diverse algorithms and helper methods for solving the shortest path problem on weighted graphs. - *

- * Definitions Given a weighted directed/undirected graph: - *

- *
    - *
  • The shortest path problem is the problem of finding a shortest path between a source node s - * and a target node t such that the sum of the edge costs is minimized.
  • - *
  • The k-shortest path problem is the problem of finding k shortest paths between a source - * node s and a target node t such that the sum of the edge costs is minimized.
  • - *
  • The single-source shortest path problem is the problem of finding shortest paths from a source node - * s to all other nodes such that the sum of the edge costs is minimized.
  • - *
  • The single-source single-sink shortest path problem is the problem of finding shortest paths from a source node s to a target node t such that the sum of the edge costs is minimized.
  • - *
  • The all-pairs shortest path problem is the problem of finding shortest paths between every pair of - * nodes such that the sum of the edge costs is minimized.
  • - *
- * @class - * @static - */ - export interface ShortestPaths extends yfiles.lang.Object{} - export class ShortestPaths { - /** - * Solves the single-source shortest path problem for acyclic directed graphs. - *

- * Each edge is associated with an arbitrary double value that represents the cost of that edge. - *

- *

- * This method yields the shortest distance from a given node s to all other nodes. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns true if the input graph is acyclic, false otherwise - * @see yfiles.algorithms.ShortestPaths#acyclic - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static acyclic(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; - /** - * Solves the single-source shortest path problem for acyclic directed graphs. - *

- * Each edge is associated with an arbitrary double value that represents the cost of that edge. - *

- *

- * This method yields the shortest distance from a given node s to all other nodes. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns true if the input graph is acyclic, false otherwise - * @see yfiles.algorithms.ShortestPaths#acyclic - * @static - */ - static acyclic(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean; - /** - * This method solves the all-pairs shortest path problem for graphs with arbitrary edge costs. - *

- * If the given graph contains a negative-cost cycle, then false is returned and the values returned in dist are left - * unspecified. - *

- * @param graph the input graph - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest path distances from all pairs of - * nodes s and t in the graph. The distance from s to t is dist[s.index()][t.index()]. If there is no path from s to t, - * then dist[s.index()][t.index()] == Double.POSITIVE_INFINITY. - * @returns true if the given graph does not contain a negative-cost cycle, false otherwise - * @static - */ - static allPairs(graph:yfiles.algorithms.Graph,directed:boolean,cost:number[],dist:number[][]):boolean; - /** - * Solves the single-source shortest path problem for arbitrary graphs. - *

- * Each edge is associated with an arbitrary double value that represents the cost of this edge. - *

- *

- * In case the given weighted graph contains no negative-cost cycles, this method will yield the shortest distance from a given node s to all - * other nodes. If, on the other hand, the given graph contains negative-cost cycles, this method will yield no reasonable - * result which will be indicated by the return value false. - *

- * @param graph the input graph - * @param s the source node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns - * @see yfiles.algorithms.ShortestPaths#bellmanFord - * @static - */ - static bellmanFord(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean; - /** - * Solves the single-source shortest path problem for arbitrary graphs. - *

- * Each edge is associated with an arbitrary double value that represents the cost of this edge. - *

- *

- * In case the given weighted graph contains no negative cost cycles, this method will yield the shortest distance from a given node s to all - * other nodes. If, on the other hand, the given graph contains negative-cost cycles, this method will yield no reasonable - * result which will be indicated by the return value false. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#bellmanFord - * @static - */ - static bellmanFord(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; - /** - * Convenience method that constructs an explicit {@link yfiles.algorithms.EdgeList path of edges} from the result returned by one of the shortest paths - * methods defined in this class. - *

- * If there is no path from node s to t, then an empty list is returned. - *

- * @param s the start node of the shortest path which must be the same start node that was specified when pred was calculated - * @param t the target node of the path - * @param pred an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns a {@link list} containing the edges on the shortest path from s to t in the correct order - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static constructEdgePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.Edge[]):yfiles.algorithms.EdgeList; - /** - * Like {@link yfiles.algorithms.ShortestPaths#constructEdgePath} but the path edges are given by a - * {@link yfiles.algorithms.IDataProvider}. - *

- * If there is no path from node s to t, then an empty list is returned. - *

- * @param s the start node of the shortest path which must be the same start node that was specified when pred was calculated - * @param t the target node of the path - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns a {@link list} containing the edges on the shortest path from s to t in the correct order - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static constructEdgePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Convenience method that constructs an explicit {@link yfiles.algorithms.NodeList path of nodes} from the result returned by one of the shortest paths - * methods defined in this class. - *

- * If there is no path from node s to t, then an empty list is returned. - *

- * @param s the start node of the shortest path which must be the same start node that was specified when pred was calculated - * @param t the target node of the path - * @param pred an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns a {@link list} containing the nodes on the shortest path from s to t in the correct order - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @static - */ - static constructNodePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.Edge[]):yfiles.algorithms.NodeList; - /** - * Like {@link yfiles.algorithms.ShortestPaths#constructNodePath} but the path edges are given by a - * {@link yfiles.algorithms.IDataProvider}. - *

- * If there is no path from node s to t, then an empty list is returned. - *

- * @param s the start node of the shortest path which must be the same start node that was specified when pred was calculated - * @param t the target node of the path - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns a {@link list} containing the nodes on the shortest path from s to t in the correct order - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @static - */ - static constructNodePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList; - /** - * Solves the single-source shortest path problem for arbitrary graphs. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * This method yields the shortest distance from a given node s to all other nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#dijkstra - * @static - */ - static dijkstra(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):void; - /** - * Solves the single-source shortest path problem for arbitrary graphs. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * This method yields the shortest distance from a given node s to all other nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#dijkstra - * @static - */ - static dijkstra(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):void; - /** - * Finds all nodes and edges that belong to a shortest path from a start node to a set of target nodes in the graph not - * farther away than a given distance. - *

- * This method assumes that each edge of the input graph has a cost of 1.0. - *

- * @param graph the input graph - * @param start the start node - * @param targetMap the {@link } that returns a boolean value indicating whether or not a node belongs to the set of - * target nodes - * @param directed true if the graph should be considered as directed, false otherwise - * @param maxLength the maximum edge length of the shortest paths - * @param pathEdges a {@link list} that will be filled during the execution and returns the edges on the shortest path from s to t in the correct - * order - * @param pathNodes a {@link list} that will be filled during the execution and returns the nodes on the shortest path from s to t in the correct - * order - * @static - */ - static findShortestUniformPaths(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,targetMap:yfiles.algorithms.IDataProvider,directed:boolean,maxLength:number,pathEdges:yfiles.algorithms.EdgeList,pathNodes:yfiles.algorithms.NodeList):void; - /** - * Marks all edges that belong to a shortest path from start node to target node. - *

- * This method assumes that each edge of the input graph has a cost of 1.0. - *

- * @param graph the input graph - * @param start the start node - * @param end the target node - * @param directed true if the graph should be considered as directed, false otherwise - * @param pathMap the {@link } that will be filled during the execution and returns a boolean value indicating whether - * or not the edge belongs to a shortest path connecting the two nodes - * @static - */ - static findShortestUniformPaths(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,directed:boolean,pathMap:yfiles.algorithms.IEdgeMap):void; - /** - * This method finds the k shortest paths connecting a pair of nodes in a directed graph with non-negative edge costs. - *

- * The result will be returned as a list of {@link yfiles.algorithms.EdgeList} objects. - *

- *

- * The cost should be non-negative. - *

- * @param graph the input graph - * @param costDP the {@link } that returns a double value (cost) for traversing each edge - * @param start the given start node - * @param end the given target node - * @param k a non-negative integer value - * @returns a {@link list} of {@link } objects each of which represents a path from start node to target node. The i-th - * path in the list contains the i-th shortest path between the start and target node. - * @static - */ - static kShortestPaths(graph:yfiles.algorithms.Graph,costDP:yfiles.algorithms.IDataProvider,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,k:number):yfiles.algorithms.YList; - /** - * A variant of {@link yfiles.algorithms.ShortestPaths#kShortestPaths} that returns the result as a special cursor that calculates - * the next path in the sequence only when needed. - *

- * The returned cursor only supports the operation {@link yfiles.algorithms.ICursor#ok}, {@link yfiles.algorithms.ICursor#current} and {@link yfiles.algorithms.ICursor#next}. - *

- *

- * The cost should be non-negative. - *

- * @param graph the input graph - * @param costDP the {@link } that returns a double value (cost) for traversing each edge - * @param start the given start node - * @param end the given target node - * @param k a non-negative integer value - * @returns a {@link cursor} that calculates the next path in the sequence only when needed - * @static - */ - static kShortestPathsCursor(graph:yfiles.algorithms.Graph,costDP:yfiles.algorithms.IDataProvider,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,k:number):yfiles.algorithms.ICursor; - /** - * Returns two edge-disjoint paths in a non-negatively weighted directed graph, such that both paths connect nodes s and t - * and have minimum total length. - * @param graph the input graph - * @param source the source node of the shortest pair - * @param target the target node of the shortest pair - * @param directed true if the graph should be considered as directed, false otherwise - * @param costDP the {@link } that returns a double value (cost) for traversing each edge - * @returns a two-dimensional array of {@link }s holding the resulting edge-disjoint paths or null if no such - * edge-disjoint paths exist - * @static - */ - static shortestPair(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,directed:boolean,costDP:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList[]; - /** - * This method solves the single-source shortest path problem for arbitrary graphs. - * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns true if the weighted graph does not contain a negative-cost cycle, false otherwise - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#singleSource - * @static - */ - static singleSource(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; - /** - * This method solves the single-source shortest path problem for arbitrary graphs. - * @param graph the input graph - * @param s the source node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns true if the weighted graph does not contain a negative-cost cycle, false otherwise - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#singleSource - * @static - */ - static singleSource(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean; - /** - * This method solves the single-source single-sink shortest path problem for arbitrary graphs. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * This method returns the shortest distance from node s to node - * t. It also returns information to construct the actual path between these two nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the source node - * @param t the sink node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param pred an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns the distance between sand t if a path between these two nodes exists or Double.POSITIVE_INFINITY otherwise - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @static - */ - static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:number[],pred:yfiles.algorithms.Edge[]):number; - /** - * Like {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSink} but uses {@link yfiles.algorithms.INodeMap}s and - * {@link yfiles.algorithms.IDataProvider}s instead of arrays. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the source node - * @param t the sink node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns a shortest {@link path of edges} between source and sink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @static - */ - static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,pred:yfiles.algorithms.INodeMap):number; - /** - * Similar to {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSink} but instead of returning the shortest distance between - * the source and sink the actual shortest edge path between these nodes will be returned. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * If the returned path is empty, then there is no path between the nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the source node - * @param t the sink node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @returns a shortest {@link path of edges} between source and sink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @static - */ - static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:number[]):yfiles.algorithms.EdgeList; - /** - * Similar to {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSink} but instead of returning the shortest distance between - * the source and sink the actual shortest edge path between these nodes will be returned. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * If the returned path is empty, then there is no path between the nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the source node - * @param t the sink node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @returns a shortest {@link path of edges} between source and sink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @static - */ - static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Solves the single-source shortest path problem for arbitrary graphs in which each edge has a uniform cost of - * 1.0. - * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static uniform(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:number[],pred?:yfiles.algorithms.Edge[]):void; - /** - * Like {@link yfiles.algorithms.ShortestPaths#uniform} but uses {@link yfiles.algorithms.INodeMap}s instead of arrays. - * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @see yfiles.algorithms.ShortestPaths#uniform - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static uniform(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):void; - /** - * Convenience method that returns an array containing uniform edge costs of 1.0 for each edge of the given graph. - * @param graph the input graph - * @returns an array that contains uniform edge costs of value 1.0 (i.e., for each edge e: cost[e.index()] == 1.0) - * @static - */ - static uniformCost(graph:yfiles.algorithms.Graph):number[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.ShortestPaths; - } - /** - * This class provides methods for efficiently sorting graph elements in graph structures. - * @class - * @static - */ - export interface Sorting extends yfiles.lang.Object{} - export class Sorting { - /** - * Sorts the nodes of a given graph by degree in ascending order. - * @param graph the given graph - * @returns an array of {@link }s sorted by degree in ascending order - * @static - */ - static sortNodesByDegree(graph:yfiles.algorithms.Graph):yfiles.algorithms.Node[]; - /** - * Sorts the nodes of a given graph by an integer key associated with each node through a {@link yfiles.algorithms.IDataProvider}. - *

- * The nodes are sorted in ascending order. - *

- * @param graph the given graph - * @param keys the {@link } that returns the keys based on which the nodes will be sorted - * @returns an array of {@link }s sorted by an integer key in ascending order - * @static - */ - static sortNodesByIntKey(graph:yfiles.algorithms.Graph,keys:yfiles.algorithms.IDataProvider):yfiles.algorithms.Node[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Sorting; - } - /** - * This class provides (minimum) spanning tree algorithms for graphs. - *

- * Definitions - *

- *
    - *
  • A spanning tree of an undirected connected graph is a subset of its edges that induce a tree that connects all nodes of the graph.
  • - *
  • - * A minimum spanning tree of a weighted connected graph is a spanning tree whose edges have minimum overall cost among all spanning trees of - * that graph. - *
  • - *
- * @class - * @static - */ - export interface SpanningTrees extends yfiles.lang.Object{} - export class SpanningTrees { - /** - * Returns the overall cost of a previously calculated minimum spanning tree. - * @param treeEdges the given {@link list} of edges that form a minimum spanning tree - * @param edgeCost the {@link } that returns a double value (cost) for each tree edge - * @returns the overall cost of the tree edges - * @static - */ - static cost(treeEdges:yfiles.algorithms.EdgeList,edgeCost:yfiles.algorithms.IDataProvider):number; - /** - * Calculates a minimum spanning tree for the given graph. - *

- * The implementation is based on an algorithm originally published in: - *

- *
    - *
  • J.B. Kruskal. On the shortest spanning subtree of a graph and the traveling salesman problem. Proceedings of the American Mathematical Society, pages 48-50, 1956.
  • - *
- * @param graph the input graph - * @param cost the {@link } that returns a double value (cost) for each edge - * @returns a {@link list} containing the edges that form the minimum spanning tree - * @static - */ - static kruskal(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Calculates a minimum spanning tree for the given graph. - *

- * Currently, the result is obtained by calling {@link yfiles.algorithms.SpanningTrees#prim}. - *

- * @param graph the input graph - * @param cost the {@link } that returns a double value (cost) for each edge - * @returns a {@link list} containing the edges that form the minimum spanning tree - * @static - */ - static minimum(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Calculates a minimum spanning tree for the given graph. - *

- * The implementation is based on an algorithm originally published in: - *

- *
    - *
  • R.C. Prim. Shortest connection networks and some generalizations. Bell System Technical Journal, 36:1389-1401, 1957.
  • - *
- * @param graph the input graph - * @param cost the {@link } that returns a double value (cost) for each edge - * @returns a {@link list} containing the edges that form the minimum spanning tree - * @static - */ - static prim(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Calculates a spanning tree for the given graph in which each edge has a uniform cost of 1.0. - * @param graph the input graph - * @returns a {@link list} containing the edges that form the minimum spanning tree - * @static - */ - static uniform(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.SpanningTrees; - } - /** - * This class provides algorithms to compute reachability information for directed, acyclic graphs. - *

- * Definitions - *

- *
    - *
  • - * Reflexive, transitive closure: Let G = (V,E) be a directed acyclic graph. The reflexive, transitive closure of G is a graph which contains edge (v,w) only if there exists a path - * from v to w in G. - *
  • - *
  • - * Transitive reduction: Let G = (V,E) be a directed acyclic graph. The transitive reduction of G is a graph which contains edge (v,w) only if there exists no path - * from v to w in G of length 2 or more. - *
  • - *
- * @class - * @static - */ - export interface Transitivity extends yfiles.lang.Object{} - export class Transitivity { - /** - * Calculates the transitive closure for a directed acyclic graph. - *

- * Given a G = (V,E) be a directed acyclic graph. The reflexive, transitive closure of G is a graph which contains edge (v,w) only if there exists a - * path from v to w in G. - *

- * @param graph the input graph to which this method will add transitive edges, if necessary - * @param [addedEdges=null] a {@link list} that will be filled during the execution and contains the edges that have been added to the graph by this method - * @static - */ - static transitiveClosure(graph:yfiles.algorithms.Graph,addedEdges?:yfiles.algorithms.EdgeList):void; - /** - * Calculates the transitive reduction for a directed acyclic graph. - *

- * The transitive edges in the graph will be removed by this method. - *

- *

- * Given G = (V,E) be a directed acyclic graph. The transitive reduction of G is a graph which contains edge (v,w) only if there exists no path - * from v to w in G of length 2 or more. - *

- * @param graph the input graph - * @param [transitiveEdges=null] a {@link list} that will be filled during the execution and contains all transitive edges of the given graph; removal of these - * edges will yield the transitive reduction of the graph - * @static - */ - static transitiveReduction(graph:yfiles.algorithms.Graph,transitiveEdges?:yfiles.algorithms.EdgeList):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Transitivity; - } - /** - * This class provides diverse algorithms and services for tree-structured graphs or subgraphs. - *

- * Definitions - *

- *
    - *
  • - * Tree: An acyclic graph, in which any pair of vertices (nodes) is connected through a path. If one vertex of a tree is - * distinguished from the other vertices, then this vertex is called the root and the tree is called a rooted tree. - *
  • - *
  • Directed rooted tree: A rooted tree where edges are directed from the root to the leaves.
  • - *
  • Depth: The depth of a vertex in a rooted tree is the number of edges of the unique path between this vertex and the root.
  • - *
  • - * Parent: In a rooted tree a vertex v is called parent of a vertex w if v and w are adjacent (i.e. connected by an edge) and the - * unique path between w and the root contains v. Note that each vertex except the root has exactly one parent. - *
  • - *
  • Children: In a rooted tree a vertex w is called child of a vertex v if v is the parent of w. A vertex may have several children.
  • - *
  • N-ary tree: A directed rooted tree where each node has a maximum of n children.
  • - *
  • Forest: A graph whose connected components are trees.
  • - *
  • - * Leaf: A leaf v is a node with out-degree (i.e., the number of edges having v as a target) zero if the input is a directed - * rooted tree, and a node with degree (i.e., the number of edges incident to v) one, otherwise. - *
  • - *
  • Subtree: A subtree of a tree T is a subgraph of T which is also a tree.
  • - *
  • - * Nearest or Lowest or Least common ancestor: The nearest common ancestor of two nodes u and v in a tree graph is the shared ancestor of u and v that is located - * farthest from the root. - *
  • - *
  • Eccentricity: The eccentricity of a tree node is the maximum distance to any other node.
  • - *
  • Center node: The center of a tree is the set of nodes that have minimal eccentricity.
  • - *
- * @class - * @static - */ - export interface Trees extends yfiles.lang.Object{} - export class Trees { - static collectSubtree(root:yfiles.algorithms.Node,nodes:yfiles.algorithms.NodeList):void; - /** - * Converts the given tree to a directed rooted tree with the given node as root element by reversing some edges. - *

- * A list of all reversed edges will be returned by this method. - *

- * @param tree the given tree - * @param [root=null] the given root element - * @returns an {@link } containing the reversed edges - * @static - */ - static directTree(tree:yfiles.algorithms.Graph,root?:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; - /** - * Returns the center node of an undirected tree. - *

- * The center node has the property of inducing a minimum depth tree when being used as the root of that tree. - *

- * @param tree the given undirected tree - * @returns the center node of the given undirected tree - * @static - */ - static getCenterRoot(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node; - /** - * Returns all leaf nodes of the given tree. - *

- * A leaf node is a node with outdegree == 0 if the input is a directed rooted tree, and a node with - * degree == 1, otherwise. - *

- * @param tree the given tree - * @param directedRootedTree true if the algorithm should consider the tree as directed, false otherwise - * @returns a {@link } that contains all leaf nodes of the given tree - * @static - */ - static getLeafNodes(tree:yfiles.algorithms.Graph,directedRootedTree:boolean):yfiles.algorithms.NodeList; - /** - * Returns the nearest common ancestor of a subset of nodes within a directed rooted tree. - *

- * It is not part of the given subset. - *

- * @param tree the given directed rooted tree - * @param root the root of the tree - * @param rootedDownward true if the tree is directed from the root to the leaves, false otherwise - * @param nodes the subset of nodes - * @returns the {@link nearest common ancestor} of the given subset of nodes - * @static - */ - static getNearestCommonAncestor(tree:yfiles.algorithms.Graph,root:yfiles.algorithms.Node,rootedDownward:boolean,nodes:yfiles.algorithms.NodeList):yfiles.algorithms.Node; - /** - * Returns a possible root for the given (undirected) tree. - *

- * More precisely: - *

- *
    - *
  • If the input is a directed rooted tree or reversed directed rooted tree, it returns the corresponding root node.
  • - *
  • - * If the input is a tree, the method returns a maximum weight center node as defined in - * {@link yfiles.algorithms.Trees#getWeightedCenterNode}. - *
  • - *
  • If the input is not a tree, a node with indegree == 0 (or outdegree == 0) is returned.
  • - *
- * @param tree the given tree - * @returns a possible root for the given tree - * @static - */ - static getRoot(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node; - /** - * Returns the depths of each subtree of a rooted directed tree. - * @param tree a rooted directed tree graph - * @param subtreeDepthMap the {@link } that will be filled during the execution with the depth of the subtree rooted at each - * node - * @static - */ - static getSubTreeDepths(tree:yfiles.algorithms.Graph,subtreeDepthMap:yfiles.algorithms.INodeMap):void; - /** - * Returns the size (number of nodes) of each subtree of a rooted directed tree. - * @param tree a rooted directed tree graph - * @param subtreeSizeMap the {@link } that will be filled during the execution with the size of the subtree rooted at each - * node - * @static - */ - static getSubTreeSizes(tree:yfiles.algorithms.Graph,subtreeSizeMap:yfiles.algorithms.INodeMap):void; - /** - * Returns an array of {@link yfiles.algorithms.EdgeList} objects each containing edges that belong to a maximal directed subtree - * of the given graph. - *

- * This method can also be applied to the result obtained by - * {@link yfiles.algorithms.Trees#getUndirectedTreeNodes}. In this case, the subtrees are considered to be undirected. - *

- * @param graph the given graph - * @param [treeNodes=null] an array of {@link }s previously calculated by {@link #getTreeNodes} - * @returns an array of {@link } objects each containing edges that belong to a maximal subtree - * @static - */ - static getTreeEdges(graph:yfiles.algorithms.Graph,treeNodes?:yfiles.algorithms.NodeList[]):yfiles.algorithms.EdgeList[]; - /** - * Returns an array of {@link yfiles.algorithms.NodeList} objects each containing nodes that belong to a maximal directed subtree - * of the given graph. - *

- * For each list of tree nodes, the first node element is the root of a tree. On each such root, all outgoing edges connect - * to nodes in the subtree and each in-degree of the root is at least two. - *

- * @param graph the given graph - * @returns an array of {@link } objects each containing nodes that belong to a maximal directed subtree - * @static - */ - static getTreeNodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - /** - * Returns an array of {@link yfiles.algorithms.NodeList} objects each containing nodes that belong to a maximal undirected subtree - * of the given graph. - *

- * For each list of tree nodes, the first node is the only node of the subtree that may be incident to non-tree edges. - *

- * @param graph the given graph - * @returns an array of {@link } objects each containing nodes that belong to a maximal undirected subtree - * @static - */ - static getUndirectedTreeNodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - /** - * Finds a node used by the greatest number of all (undirected) paths interconnecting all nodes with each other. - *

- * The number of paths per node are stored in the given {@link yfiles.algorithms.INodeMap}. - *

- * @param tree the given tree - * @param [intWeight=null] the {@link } that holds the number of paths per node - * @returns a {@link } used by the greatest number of all undirected paths - * @static - */ - static getWeightedCenterNode(tree:yfiles.algorithms.Graph,intWeight?:yfiles.algorithms.INodeMap):yfiles.algorithms.Node; - /** - * Checks whether or not the given graph is a forest. - *

- * If - * directedRootedTree == true, each component has to be a directed rooted tree. Otherwise, each component has to be an - * undirected tree. - *

- * @param graph the given graph - * @param directedRootedTree true if the algorithm should check for directed rooted trees, false otherwise - * @returns true if the given graph is a forest, false otherwise - * @static - */ - static isForest(graph:yfiles.algorithms.Graph,directedRootedTree:boolean):boolean; - /** - * Checks whether or not the given graph is a forest, that is, a graph whose connected components are directed rooted - * trees. - * @param graph the given graph - * @returns true if the given graph is a forest, false otherwise - * @static - */ - static isForest(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is a directed rooted tree in which each node has a maximum of n children. - * @param graph the given graph - * @param n the allowed maximum of children - * @returns true if the given graph is a n-ary tree, false otherwise - * @static - */ - static isNaryTree(graph:yfiles.algorithms.Graph,n:number):boolean; - /** - * Checks whether or not the given graph is a directed rooted tree. - * @param graph the given graph - * @returns true if the given graph is a directed rooted tree, false otherwise - * @static - */ - static isRootedTree(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is an undirected tree. - * @param graph the given graph - * @returns true if the given graph is an undirected tree, false otherwise - * @static - */ - static isTree(graph:yfiles.algorithms.Graph):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Trees; - } - /** - * This class provides access to some Comparator instances that are commonly used in yFiles. - * @class - * @static - */ - export interface Comparers extends yfiles.lang.Object{} - export class Comparers { - /** - * Compares the specified floating point numbers. - *

- * Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than - * the second. - *

- *

- * Warning: This method does not handle NaN! If you need NaN-safe comparison, use {@link yfiles.lang.Object#compare} instead. - *

- * @param d1 the first number to compare. - * @param d2 the second number to compare. - * @returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the - * second. - * @see yfiles.collections.IComparer.#compare - * @static - */ - static compare(d1:number,d2:number):number; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares to Objects of type Comparable. - * @returns - * @static - */ - static createComparableComparer():yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of arbitrary type. - *

- * Two objects are compared by comparing the {@link yfiles.lang.IComparable} instances the given data provider returns for each of - * these objects. - *

- * @param dp a data provider that must return a {@link } for each object that is being compared by this comparator. - * @returns a {@link } that compares arbitrary objects. - * @static - */ - static createComparableDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of arbitrary type. - *

- * Two objects are compared by comparing the int value the given data provider returns for each of these objects. - *

- * @param dp a data provider that must return an int value for each object that is being compared by this comparator. - * @returns a {@link } that compares arbitrary objects. - * @static - */ - static createIntDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of type {@link yfiles.algorithms.Edge}. - *

- * Two edges are compared by comparing their source nodes. Each source node e.source() in turn is compared by the int value - * provided by the given data provider: dp.getInt(e.source()). - *

- * @param dp a data provider that must return an int value for the source node of each edge being compared. - * @returns a {@link } that compares edges. - * @static - */ - static createIntDataSourceComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of type {@link yfiles.algorithms.Edge}. - *

- * Two edges are compared by comparing their target nodes. Each target node e.target() in turn is compared by the int value - * provided by the given data provider: dp.getInt(e.target()). - *

- * @param dp a data provider that must return an int value for the target node of each edge being compared. - * @returns a {@link } that compares edges. - * @static - */ - static createIntDataTargetComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of arbitrary type. - *

- * Two objects are compared by comparing the double value the given data provider returns for each of these objects. - *

- * @param dp a data provider that must return a double value for each object that is being compared by this comparator. - * @returns a {@link } that compares arbitrary objects. - * @static - */ - static createNumberDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of type {@link yfiles.algorithms.Edge}. - *

- * Two edges are compared by comparing their source nodes. Each source node e.source() in turn is compared by the double - * value provided by the given data provider: dp.getDouble(e.source()). - *

- * @param dp a data provider that must return a double value for the source node of each edge being compared. - * @returns a {@link } that compares edges. - * @static - */ - static createNumberDataSourceComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of type {@link yfiles.algorithms.Edge}. - *

- * Two edges are compared by comparing their target nodes. Each target node e.target() in turn is compared by the double - * value provided by the given data provider: dp.getDouble(e.target()). - *

- * @param dp a data provider that must return a double value for the target node of each edge being compared. - * @returns a {@link } that compares edges. - * @static - */ - static createNumberDataTargetComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Comparers; - } - /** - * Provides utility methods for working with {@link yfiles.algorithms.ICursor cursors}. - * @class - * @static - */ - export interface Cursors extends yfiles.lang.Object{} - export class Cursors { - /** - * Creates a new cursor that provides a logical view on the concatenation of the two given cursors. - * @param c1 - first concatenation argument - * @param c2 - second concatenation argument - * @returns - * @static - */ - static concatenate(c1:yfiles.algorithms.ICursor,c2:yfiles.algorithms.ICursor):yfiles.algorithms.ICursor; - /** - * Creates a cursor view of the given collection. - *

- * Creates an ICursor view of the given collection. - *

- *

- * Note that the returned cursor does not support the {@link yfiles.algorithms.ICursor#prev prev} and {@link yfiles.algorithms.ICursor#toLast toLast} operations. - *

- * Type parameter T. - * @param c The collection. - * @returns The cursor view of the given collection. - * @template T - * @static - */ - static createCursor(c:yfiles.collections.ICollection):yfiles.algorithms.ICursor; - /** - * Creates a cursor view of the given collection. - *

- * Note that the returned cursor does not support the operations {@link yfiles.algorithms.ICursor#prev prev}, {@link yfiles.algorithms.ICursor#toLast toLast}, and - * {@link yfiles.algorithms.IEdgeCursor#cyclicPrev}. - *

- * Type parameter T. - * @param c The collection. - * @returns an {@link } view of the given collection. - * @template T - * @static - */ - static createEdgeCursor(c:yfiles.collections.ICollection):yfiles.algorithms.IEdgeCursor; - /** - * Creates a cursor view of the given collection. - *

- * Note that the returned cursor does not support the operations {@link yfiles.algorithms.ICursor#prev prev}, {@link yfiles.algorithms.ICursor#toLast toLast}, and - * {@link yfiles.algorithms.INodeCursor#cyclicPrev}. - *

- * Type parameter T. - * @param c The collection. - * @returns an {@link } view of the given collection. - * @template T - * @static - */ - static createNodeCursor(c:yfiles.collections.ICollection):yfiles.algorithms.INodeCursor; - /** - * Creates or fills an array with the values provided by the cursor - * @param cursor the cursor - * @param dest the array to fill with the values or null if the method should create the array itself - * @returns dest or a newly created array filled with the values from cursor - * @static - */ - static toArray(cursor:yfiles.algorithms.ICursor,dest:any[]):any[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Cursors; - } - /** - * An abstract adapter class for providing data. - *

- * The data provision methods in this class throw a {@link yfiles.lang.Exception} and {@link yfiles.algorithms.DataProviderAdapter#defined} - * always returns false. - *

- *

- * This class exists as a convenience for creating data provider objects. - *

- *

- * Extend this class to provide either typed or untyped data for a certain lookup domain. - *

- * @class - * @implements {yfiles.algorithms.IDataProvider} - */ - export interface DataProviderAdapter extends yfiles.lang.Object,yfiles.algorithms.IDataProvider{} - export class DataProviderAdapter { - /** - * Returns false for all data holders. - *

- * Subclasses should override this method to make clear for which data holders there is a value accessible via this data - * provider. - *

- * @param dataHolder - * @returns false. - */ - defined(dataHolder:any):boolean; - /** - * Subclasses may override this method to provide access to object values. - * @param dataHolder - * @returns - * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. - */ - get(dataHolder:any):any; - /** - * Subclasses may override this method to provide access to boolean values. - * @param dataHolder - * @returns - * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. - */ - getBoolean(dataHolder:any):boolean; - /** - * Subclasses may override this method to provide access to integer values. - * @param dataHolder - * @returns - * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. - */ - getInt(dataHolder:any):number; - /** - * Subclasses may override this method to provide access to double values. - * @param dataHolder - * @returns - * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. - */ - getNumber(dataHolder:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.DataProviderAdapter; - } - /** - * This class provides convenience and transformation services for DataProviders. - * @class - * @static - */ - export interface DataProviders extends yfiles.lang.Object{} - export class DataProviders { - /** - * Returns a DataProvider that returns the given value for each key. - * @param data constant Object data returned by the created data provider. - * @returns a data provider view of a single value. - * @static - */ - static createConstantDataProvider(data:any):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of an Object array defined for edges. - *

- * The Object value data[edge.index()] will be returned by the data provider upon the method call get(edge). - *

- * @param data array data for each edge of a static graph - * @returns a data provider view of the given array - * @static - */ - static createEdgeDataProvider(data:any[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a double, int, boolean and Object array defined for edges. - *

- * The double value doubleData[edge.index()] will be returned by the data provider upon the method call getDouble(edge). - *

- *

- * The int value intData[edge.index()] will be returned by the data provider upon the method call getInt(edge). - *

- *

- * The boolean value boolData[edge.index()] will be returned by the data provider upon the method call getBool(edge). - *

- *

- * The Object value objectData[edge.index()] will be returned by the data provider upon the method call get(edge). - *

- * @param doubleData double data for each edge of a static graph - * @param intData int data for each edge of a static graph - * @param boolData boolean data for each edge of a static graph - * @param objectData Object data for each edge of a static graph - * @returns a data provider view of the given arrays - * @static - */ - static createEdgeDataProviderForArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:any[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a boolean array defined for edges. - *

- * The boolean value data[edge.index()] will be returned by the data provider upon the method call getBool(edge). - *

- * @param data array data for each edge of a static graph - * @returns a data provider view of the given array - * @static - */ - static createEdgeDataProviderForBoolean(data:boolean[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of an int array defined for edges. - *

- * The int value data[edge.index()] will be returned by the data provider upon the method call getInt(edge). - *

- * @param data array data for each edge of a static graph - * @returns a data provider view of the given array - * @static - */ - static createEdgeDataProviderForInt(data:number[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a double array defined for edges. - *

- * The double value data[edge.index()] will be returned by the data provider upon the method call getDouble(edge). - *

- * @param data array data for each edge of a static graph - * @returns a data provider view of the given array - * @static - */ - static createEdgeDataProviderForNumber(data:number[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider that returns the negated boolean values provided by another data provider. - * @param data - * @returns - * @static - */ - static createNegatedDataProvider(data:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of an Object array defined for nodes. - *

- * The Object value data[node.index()] will be returned by the data provider upon the method call get(node). - *

- * @param data array data for each node of a static graph - * @returns a data provider view of the given array - * @static - */ - static createNodeDataProvider(data:any[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a boolean array defined for nodes. - *

- * The boolean value data[node.index()] will be returned by the data provider upon the method call getBool(node). - *

- * @param data array data for each node of a static graph - * @returns a data provider view of the given array - * @static - */ - static createNodeDataProviderForBoolean(data:boolean[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of an int array defined for nodes. - *

- * The int value data[node.index()] will be returned by the data provider upon the method call getInt(node). - *

- * @param data array data for each node of a static graph - * @returns a data provider view of the given array - * @static - */ - static createNodeDataProviderForInt(data:number[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a double array defined for nodes. - *

- * The double value data[node.index()] will be returned by the data provider upon the method call getDouble(node). - *

- * @param data array data for each node of a static graph - * @returns a data provider view of the given array - * @static - */ - static createNodeDataProviderForNumber(data:number[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a double, int, boolean and Object array defined for nodes. - *

- * The double value doubleData[node.index()] will be returned by the data provider upon the method call getDouble(node). - *

- *

- * The int value intData[node.index()] will be returned by the data provider upon the method call getInt(node). - *

- *

- * The boolean value boolData[node.index()] will be returned by the data provider upon the method call getBool(node). - *

- *

- * The Object value objectData[node.index()] will be returned by the data provider upon the method call get(node). - *

- * @param doubleData double data for each node of a static graph - * @param intData int data for each node of a static graph - * @param boolData boolean data for each node of a static graph - * @param objectData Object data for each node of a static graph - * @returns a data provider view of the given arrays - * @static - */ - static createNodeDataProviderWithArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:any[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider for edges that return the data provider values bound to their source nodes. - * @param nodeData - * @returns - * @static - */ - static createSourceDataProvider(nodeData:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider for edges that return the data provider values bound to their target nodes. - * @param nodeData - * @returns - * @static - */ - static createTargetDataProvider(nodeData:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.DataProviders; - } - /** - * Provides functionality to hide and unhide partitions of nodes and their adjacent edges of a graph temporarily for - * algorithmic operations. - *

- * This class can be used to temporarily hide away certain elements of a graph and to unhide that parts at a later time - * again. Instances of this class keep track of graph elements that were hidden from a graph in order to make them visible - * again at a later time. - *

- *

- * Note that this class should not be used to hide elements from a Graph2D for pure hiding purposes. Since this class will - * by default prevent the graph instance from firing events, other code might cease to work correctly. Use this class for - * short term removal of nodes and edges, only. - *

- * @class - */ - export interface GraphPartitionManager extends yfiles.lang.Object{} - export class GraphPartitionManager { - /** - * Instantiates a new GraphPartitionManager for the given graph. - *

- * All non-static hiding and unhiding methods will refer to the given graph. - *

- * @param graph - * @param partitionId - */ - constructor(graph:yfiles.algorithms.Graph,partitionId:yfiles.algorithms.IDataProvider); - /** - * Assures that only nodes are visible in the graph that are associated with the given partitionId. - * @param partitionId the partitionId for the nodes that will be made visible - */ - displayPartition(partitionId:any):void; - /** - * Hides the given list of nodes from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param nl - */ - hide(nl:yfiles.algorithms.NodeList):void; - /** - * Hides the given list of edges from the graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- * @param el - */ - hide(el:yfiles.algorithms.EdgeList):void; - /** - * Hides the given edge from the graph. - *

- * The hidden edge will be stored so that they can be unhidden again at a later time. - *

- * @param e - */ - hide(e:yfiles.algorithms.Edge):void; - /** - * Hides the given node and all it's adjacent edges from the graph. - *

- * The hidden elements will be stored so that they can be unhidden again at a later time. - *

- * @param v - */ - hide(v:yfiles.algorithms.Node):void; - /** - * Hides all nodes and edges from this graph. - *

- * The hidden elements will be stored so that they can be unhidden again at a later time. - *

- */ - hideAll():void; - /** - * Hides the given edges from the graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- * @param ec - */ - hideEdgeCursor(ec:yfiles.algorithms.IEdgeCursor):void; - /** - * Hides all edges from this graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideEdges():void; - /** - * Hides the given elements from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param cursor - */ - hideItemCursor(cursor:yfiles.algorithms.ICursor):void; - /** - * Hides multiple edges from the graph. - *

- * If there are multiple edges connecting two nodes then all but one (representative) of these edges will be hidden. The - * hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideMultipleEdges():void; - /** - * Hides the given nodes from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param nc - */ - hideNodeCursor(nc:yfiles.algorithms.INodeCursor):void; - /** - * Hides nodes and adjacent edges that have the given partitionId associated. - * @param partitionId the id - */ - hidePartition(partitionId:any):void; - /** - * Hides all self-loop edges from this graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideSelfLoops():void; - /** - * Initializes internal data structures using the new DataProvider. - *

- * This method must also be called whenever the content of the given DataProvider changes. - *

- * @param partitionId the data provider that holds the partitionIds for all elements. - */ - initPartitions(partitionId:yfiles.algorithms.IDataProvider):void; - /** - * Hides all self-loops and multiple edges from the graph. - *

- * The overall effect of this method is that the minimum number of edges are hidden from the graph such that it contains no - * self-loops and no multiple edges anymore. The hidden edges will be stored so that they can be unhidden again at a later - * time. - *

- */ - simplifyGraph():void; - /** - * This method will be called whenever the partition manager is requested to unhide the given node from the graph. - * @param v - * @protected - */ - unhide(v:yfiles.algorithms.Node):void; - /** - * This method will be called whenever the partition manager is requested to unhide the given edge from the graph. - * @param e - * @protected - */ - unhide(e:yfiles.algorithms.Edge):void; - /** - * Unhides all formerly hidden elements in the graph. - */ - unhideAll():void; - /** - * Unhides all formerly hidden edges in the graph. - */ - unhideEdges():void; - /** - * Unhides all formerly hidden nodes in the graph. - *

- * Note that this method does not unhide hidden edges. - *

- */ - unhideNodes():void; - /** - * Unhides nodes that have the given partitionId associated. - * @param partitionId the id - */ - unhidePartition(partitionId:any):void; - /** - * Gets or sets whether or not this partition manager should fire graph events. - *

- * By default the partition manager does not fire graph events. - *

- * @type {boolean} - */ - fireGraphEventsEnabled:boolean; - /** - * Gets the Graph for which this partition manager was created. - * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphPartitionManager; - } - /** - * Provides functionality to hide and unhide nodes and edges of a graph temporarily for algorithmic operations. - *

- * This class can be used to temporarily hide away certain elements of a graph and to unhide that parts at a later time - * again. Instances of this class keep track of graph elements that were hidden from a graph in order to make them visible - * again at a later time. - *

- *

- * Note that this class should not be used to hide elements from a Graph2D for pure hiding purposes. Since this class will - * by default prevent the graph instance from firing events, other code might cease to work correctly. Use this class for - * short term removal of nodes and edges, only. - *

- * @class - */ - export interface LayoutGraphHider extends yfiles.lang.Object{} - export class LayoutGraphHider { - /** - * Instantiates a new GraphHider for the given graph. - *

- * All non-static hiding and unhiding methods will refer to the given graph. - *

- * @param g - */ - constructor(g:yfiles.algorithms.Graph); - /** - * The edges that are currently hidden - * @returns a cursor of the currently hidden edges - */ - getHiddenEdgeCursor():yfiles.algorithms.IEdgeCursor; - /** - * The nodes that are currently hidden - * @returns a cursor of the currently hidden nodes - */ - getHiddenNodeCursor():yfiles.algorithms.INodeCursor; - /** - * Hides the given list of nodes from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param nl - */ - hide(nl:yfiles.algorithms.NodeList):void; - /** - * Hides the given list of edges from the graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- * @param el - */ - hide(el:yfiles.algorithms.EdgeList):void; - /** - * Hides the given edge from the graph. - *

- * The hidden edge will be stored so that they can be unhidden again at a later time. - *

- * @param e - */ - hide(e:yfiles.algorithms.Edge):void; - /** - * Hides the given node and all it's adjacent edges from the graph. - *

- * The hidden elements will be stored so that they can be unhidden again at a later time. - *

- * @param v - */ - hide(v:yfiles.algorithms.Node):void; - /** - * Hides all nodes and edges from this graph. - *

- * The hidden elements will be stored so that they can be unhidden again at a later time. - *

- */ - hideAll():void; - /** - * Hides the given edges from the graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- * @param ec - */ - hideEdgeCursor(ec:yfiles.algorithms.IEdgeCursor):void; - /** - * Hides all edges from this graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideEdges():void; - /** - * Hides the given elements from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param cursor - */ - hideItemCursor(cursor:yfiles.algorithms.ICursor):void; - /** - * Hides multiple edges from the graph. - *

- * If there are multiple edges connecting two nodes then all but one (representative) of these edges will be hidden. The - * hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideMultipleEdges():void; - /** - * Hides the given nodes from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param nc - */ - hideNodeCursor(nc:yfiles.algorithms.INodeCursor):void; - /** - * Hides all self-loop edges from this graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideSelfLoops():void; - /** - * Hides the subgraph induced by the given edges from the given graph. - *

- * The induced subgraph defined by the given edges consists of the given edges and all nodes that are solely connected to - * the rest of the graph by the given edges. - *

- * @param graph - * @param ec - * @static - */ - static hideSubgraph(graph:yfiles.algorithms.Graph,ec:yfiles.algorithms.IEdgeCursor):void; - /** - * Hides all self-loops and multiple edges from the graph. - *

- * The overall effect of this method is that the minimum number of edges are hidden from the graph such that it contains no - * self-loops and no multiple edges anymore. The hidden edges will be stored so that they can be unhidden again at a later - * time. - *

- */ - simplifyGraph():void; - /** - * This method will be called whenever the hider is requested to unhide the given node from the graph. - * @param v - * @protected - */ - unhide(v:yfiles.algorithms.Node):void; - /** - * This method will be called whenever the hider is requested to unhide the given edge from the graph. - * @param e - * @protected - */ - unhide(e:yfiles.algorithms.Edge):void; - /** - * Unhides all formerly hidden elements in the graph. - */ - unhideAll():void; - /** - * Unhides the given edge. - *

- * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. - *

- *

- * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes - * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. - *

- * @param e the edge that will be unhidden - */ - unhideEdge(e:yfiles.algorithms.Edge):void; - /** - * Unhides the given edges. - *

- * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. - *

- *

- * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes - * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. - *

- * @param edges the edges that will be unhidden - */ - unhideEdges(edges:yfiles.algorithms.EdgeList):void; - /** - * Unhides all formerly hidden edges in the graph. - */ - unhideEdges():void; - /** - * Unhides the given node and if requested its adjacent edges. - *

- * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenNodes} and {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. - *

- * @param v the node that will be unhidden - * @param unhideAdjacentEdges whether of not to unhide previously hidden edges connected at v whose other end point is not hidden, i.e. it is part of - * the graph. - */ - unhideNode(v:yfiles.algorithms.Node,unhideAdjacentEdges:boolean):void; - /** - * Unhides the given nodes and if requested its adjacent edges. - *

- * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenNodes} and {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. - *

- * @param nodes the nodes that will be unhidden - * @param unhideAdjacentEdges whether of not to unhide previously hidden edges connected at the given nodes whose other end point is not hidden, i.e. - * it is part of the graph. - */ - unhideNodes(nodes:yfiles.algorithms.NodeList,unhideAdjacentEdges:boolean):void; - /** - * Unhides all formerly hidden nodes in the graph. - *

- * Note that this method does not unhide hidden edges. - *

- */ - unhideNodes():void; - /** - * Unhides the subgraph induced by the given edges in the given graph. - *

- * The induced subgraph defined by the given edges consists of the given edges and all nodes that are either source or - * target of at least one of the given edges. - *

- *

- * Parts of the subgraph that are already contained in the given graph will not be unhidden and pose no problem to this - * method. - *

- * @param graph - * @param ec - * @static - */ - static unhideSubgraph(graph:yfiles.algorithms.Graph,ec:yfiles.algorithms.IEdgeCursor):void; - /** - * holds the list of the hidden edges in stack order - * @protected - * @type {yfiles.algorithms.EdgeList} - */ - hiddenEdges:yfiles.algorithms.EdgeList; - /** - * holds the list of the hidden nodes in stack order - * @protected - * @type {yfiles.algorithms.NodeList} - */ - hiddenNodes:yfiles.algorithms.NodeList; - /** - * Gets or sets whether or not this hider should fire graph events. - *

- * By default the hider does not fire graph events. - *

- * @type {boolean} - */ - fireGraphEvents:boolean; - /** - * Gets the Graph for which this GraphHider was created. - * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.LayoutGraphHider; - } - /** - * This class provides convenience and transformation services for Node- and EdgeMaps and other layout-related collection - * types. - * @class - * @static - */ - export interface Maps extends yfiles.lang.Object{} - export class Maps { - /** - * Create a DataMap view of the given map. - *

- * Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer and Boolean within the - * given Map. - *

- * @param map - * @returns - * @static - */ - static createDataMap(map:yfiles.collections.IMap):yfiles.algorithms.IDataMap; - /** - * Create an EdgeMap view of the given map. - *

- * Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer and Boolean within the - * given Map. - *

- * @param map - * @returns - * @static - */ - static createEdgeMap(map:yfiles.collections.IMap):yfiles.algorithms.IEdgeMap; - /** - * Creates a DataMap that is based on hashing. - *

- * The preconditions specified in java.util.HashMap apply for the keys and values of this map. - *

- * @returns - * @static - */ - static createHashedDataMap():yfiles.algorithms.IDataMap; - /** - * Creates an EdgeMap that is based on hashing. - *

- * The preconditions specified in java.util.HashMap apply for the keys and values of this map. - *

- * @returns - * @static - */ - static createHashedEdgeMap():yfiles.algorithms.IEdgeMap; - /** - * Creates a NodeMap that is based on hashing. - *

- * The preconditions specified in java.util.HashMap apply for the keys and values of this map. - *

- * @returns - * @static - */ - static createHashedNodeMap():yfiles.algorithms.INodeMap; - /** - * Factory method that creates a {@link yfiles.collections.IMap.} that is a special hash map implementation mainly used by the layout algorithms. - * Type parameter K. - * Type parameter V. - * @param [entries=null] The items to optionally populate the set with initially. - * @returns A new instance. - * @template K,V - * @static - */ - static createHashMap(entries?:yfiles.collections.ICollection>):yfiles.collections.IMap; - /** - * Factory method that creates an {@link yfiles.collections.ICollection.} implementation with set semantics that is a special hash map based implementation mainly - * used by the layout algorithms. - * Type parameter T. - * @param [items=null] The items to optionally populate the set with initially. - * @returns A new instance. - * @template T - * @static - */ - static createHashSet(items?:yfiles.collections.IEnumerable):yfiles.collections.ICollection; - /** - * Creates a resettable high performance map for values of type double. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingProvider - * @param backingAcceptor - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceDoubleMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:number):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type double. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingMap - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceDoubleMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:number):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type int. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingProvider - * @param backingAcceptor - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceIntMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:number):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type int. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingMap - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceIntMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:number):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type Object. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingProvider - * @param backingAcceptor - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:any):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type Object. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingMap - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:any):yfiles.algorithms.INodeMap; - /** - * Returns a EdgeMap view of an Object array defined for edges. - *

- * The Object value data[edge.index()] will be accessed by the EdgeMap upon the method calls get(edge) and - * set(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param data array data for each edge of a static graph - * @returns a EdgeMap view of the given array - * @static - */ - static createIndexEdgeMap(data:any[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a EdgeMap view of a boolean array defined for edges. - *

- * The boolean value data[edge.index()] will be accessed by the EdgeMap upon the method calls getBool(edge) and - * setBool(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param data array data for each edge of a static graph - * @returns a EdgeMap view of the given array - * @static - */ - static createIndexEdgeMapForBoolean(data:boolean[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a EdgeMap view of an int array defined for edges. - *

- * The int value data[edge.index()] will be accessed by the EdgeMap upon the method calls getInt(edge) and - * setInt(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param data array data for each edge of a static graph - * @returns a EdgeMap view of the given array - * @static - */ - static createIndexEdgeMapForInt(data:number[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a EdgeMap view of a double array defined for edges. - *

- * The double value data[edge.index()] will be accessed by the EdgeMap upon the method calls getDouble(edge) and - * setDouble(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param data array data for each edge of a static graph - * @returns a EdgeMap view of the given array - * @static - */ - static createIndexEdgeMapForNumber(data:number[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a EdgeMap view of a double, int, boolean and Object array defined for edges. - *

- * The double value doubleData[edge.index()] will be accessed by the EdgeMap upon the method calls getDouble(edge) and - * setDouble(edge,value). - *

- *

- * The int value intData[edge.index()] will be accessed by the EdgeMap upon the method calls getInt(edge) and - * setInt(edge,value). - *

- *

- * The boolean value boolData[edge.index()] will be accessed by the EdgeMap upon the method calls getBool(edge) and - * setBool(edge,value). - *

- *

- * The Object value objectData[edge.index()] will be accessed by the EdgeMap upon the method calls get(edge) and - * set(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param doubleData double data for each edge of a static graph - * @param intData int data for each edge of a static graph - * @param boolData boolean data for each edge of a static graph - * @param objectData Object data for each edge of a static graph - * @returns a EdgeMap view of the given arrays - * @static - */ - static createIndexEdgeMapFromArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:any[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a NodeMap view of an Object array defined for nodes. - *

- * The Object value data[node.index()] will be accessed by the NodeMap upon the method calls get(node) and set(node,value). - * Warning! The indices of the accessed nodes must not change during the use of this NodeMap. - *

- * @param data array data for each node of a static graph - * @returns a NodeMap view of the given array - * @static - */ - static createIndexNodeMap(data:any[]):yfiles.algorithms.INodeMap; - /** - * Returns a NodeMap view of a boolean array defined for nodes. - *

- * The boolean value data[node.index()] will be accessed by the NodeMap upon the method calls getBool(node) and - * setBool(node,value). - *

- * @param data array data for each node of a static graph - * @returns a NodeMap view of the given array - * @static - */ - static createIndexNodeMapForBoolean(data:boolean[]):yfiles.algorithms.INodeMap; - /** - * Returns a NodeMap view of an int array defined for nodes. - *

- * The int value data[node.index()] will be accessed by the NodeMap upon the method calls getInt(node) and - * setInt(node,value). Warning! The indices of the accessed nodes must not change during the use of this NodeMap. - *

- * @param data array data for each node of a static graph - * @returns a NodeMap view of the given array - * @static - */ - static createIndexNodeMapForInt(data:number[]):yfiles.algorithms.INodeMap; - /** - * Returns a NodeMap view of a double array defined for nodes. - *

- * The double value data[node.index()] will be accessed by the NodeMap upon the method calls getDouble(node) and - * setDouble(node,value). - *

- *

- * Warning! The indices of the accessed nodes must not change during the use of this NodeMap. - *

- * @param data array data for each node of a static graph - * @returns a NodeMap view of the given array - * @static - */ - static createIndexNodeMapForNumber(data:number[]):yfiles.algorithms.INodeMap; - /** - * Returns a NodeMap view of a double, int, boolean and Object array defined for nodes. - *

- * The double value doubleData[node.index()] will be accessed by the NodeMap upon the method calls getDouble(node) and - * setDouble(node,value). - *

- *

- * The int value intData[node.index()] will be accessed by the NodeMap upon the method calls getInt(node) and - * setInt(node,value). - *

- *

- * The boolean value boolData[node.index()] will be accessed by the NodeMap upon the method calls getBool(node) and - * setBool(node,value). - *

- *

- * The Object value objectData[node.index()] will be accessed by the NodeMap upon the method calls get(node) and - * set(node,value). - *

- *

- * Warning! The indices of the accessed nodes must not change during the use of this NodeMap. - *

- * @param doubleData double data for each node of a static graph - * @param intData int data for each node of a static graph - * @param boolData boolean data for each node of a static graph - * @param objectData Object data for each node of a static graph - * @returns a NodeMap view of the given arrays - * @static - */ - static createIndexNodeMapFromArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:any[]):yfiles.algorithms.INodeMap; - /** - * Create a NodeMap view of the given map. - *

- * Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer and Boolean within the - * given Map. - *

- * @param map - * @returns - * @static - */ - static createNodeMap(map:yfiles.collections.IMap):yfiles.algorithms.INodeMap; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Maps; - } - /** - * An implementation of a doubly linked list that provides direct access to the cells that store the elements. - *

- * The cells are represented by class {@link yfiles.algorithms.ListCell}. - *

- *

- * This class supports fast access and removal operations, specifically, it is possible to remove an element in constant - * time (i.e. O(1)) given a reference to its list cell. - *

- *

- * Class YList supports iteration over the elements either by using the list cells directly (methods {@link yfiles.algorithms.YList#firstCell}/{@link yfiles.algorithms.YList#lastCell} together with - * {@link yfiles.algorithms.YList#succCell}/{@link yfiles.algorithms.YList#predCell}, respectively) or by means of a cursor - * ({@link yfiles.algorithms.YList#cursor}). - *

- *

- * Furthermore, YList offers its own {@link yfiles.algorithms.YList#sort} method. Note that this class also provides all relevant - * methods to use the list like a stack data type. - *

- *

- * This implementation permits null as values. It implements the {@link yfiles.collections.IList.} interface but does not support the {@link yfiles.algorithms.YList#subList} - * method. The implementation of this method will throw an {@link yfiles.lang.Exception} if invoked. The {@link yfiles.algorithms.YList#cursor} - * returned by instances of this class is not fail fast. - *

- * @class - * @implements {yfiles.collections.IList.} - */ - export interface YList extends yfiles.lang.Object,yfiles.collections.IList{} - export class YList { - /** - * Creates a list that is initialized with the elements provided by the given array of objects. - * @param a - */ - constructor(a:any[]); - /** - * Creates a list that is initialized with those elements from the given YCursor object for which the given data provider - * returns true upon calling its {@link yfiles.algorithms.IDataProvider#getBoolean getBool} method. - * @param c A cursor providing objects that should be added to this list. - * @param predicate A data provider that acts as a inclusion predicate for each object accessible by the given cursor. - */ - constructor(c:yfiles.algorithms.ICursor,predicate:yfiles.algorithms.IDataProvider); - /** - * Creates a list that is initialized with the elements provided by the given Collection object. - * @param c - */ - constructor(c:yfiles.collections.IEnumerable); - /** - * Creates a list that is initialized with the elements provided by the given YCursor object. - * @param c - */ - constructor(c:yfiles.algorithms.ICursor); - /** - * Creates an empty doubly linked list. - */ - constructor(); - /** - * Appends all elements provided by the given cursor to this list. - *

- * The cursor will be moved from its given position to the end. - *

- *

- * Be aware that a statement like aList.append(aList.cursor()) results in an infinite recursion. - *

- * @param c - */ - addAll(c:yfiles.algorithms.ICursor):void; - /** - * Appends all elements provided by the given collection to this list. - * @param collection - * @returns Whether there have been elements appended. - */ - addAll(collection:yfiles.collections.ICollection):boolean; - /** - * - * @param index - * @param c - * @returns - */ - addAll(index:number,c:yfiles.collections.ICollection):boolean; - /** - * Inserts the given object at the head of this list. - * @param o - * @returns The newly created ListCell object that stores the given object. - */ - addFirst(o:any):yfiles.algorithms.ListCell; - /** - * Adds a formerly removed ListCell object at the head of this list. - *

- * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. - *

- * @param cell A list cell which is not part of any list. - */ - addFirstCell(cell:yfiles.algorithms.ListCell):void; - /** - * Inserts the given object at the tail of this list. - * @param o - * @returns The newly created ListCell object that stores the given object. - */ - addLast(o:any):yfiles.algorithms.ListCell; - /** - * Adds a formerly removed ListCell object at the tail of this list. - *

- * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. - *

- * @param cell A list cell which is not part of any list. - */ - addLastCell(cell:yfiles.algorithms.ListCell):void; - /** - * Removes all elements from this list. - */ - clear():void; - /** - * Whether or not this list contains all the elements in the given collection. - *

- * Equality of elements is defined by the {@link any#equals} method. - *

- * @param collection - * @returns - */ - containsAll(collection:yfiles.collections.ICollection):boolean; - /** - * Copies the elements of this collection to an array, starting at the specified array index. - * @param array The one-dimensional array that is the destination of the elements copied from this collection. - * @param arrayIndex The zero-based index in array at which copying begins. - */ - copyTo(array:any[],arrayIndex:number):void; - /** - * Returns a cursor for this list. - *

- * All cursor operations are supported. This cursor implementation is not fail-fast and continues to work if this list is - * modified during the traversal as long as the current ListCell the cursor points at is this in this list or has been - * removed from this list but has not been added to another instance since then. - *

- * @returns - */ - cursor():yfiles.algorithms.ICursor; - /** - * Returns the cyclic predecessor cell of the given list cell. - *

- * The last cell is returned as the cyclic predecessor of the first list cell. - *

- * @param c - * @returns - */ - cyclicPred(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Returns the cyclic successor cell of the given list cell. - *

- * The first cell is returned as the cyclic successor of the last list cell. - *

- * @param c - * @returns - */ - cyclicSucc(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Returns the i-th element of this list. - * @param i - * @returns - */ - elementAt(i:number):any; - /** - * Returns the {@link yfiles.algorithms.ListCell} where object o is stored. - *

- * This operation returns null, if no such cell exists. Equality of elements is defined by the {@link any#equals} method. The first - * element in the list that matches that criteria is returned. - *

- * @param o - * @returns the ListCell that contains the element or null if no such ListCell was found - */ - findCell(o:any):yfiles.algorithms.ListCell; - /** - * Gets the element at the specified index. - * @param index The zero-based index of the element to get or set. - * @returns The element at the specified index. - * @see yfiles.algorithms.YList#set - */ - get(index:number):any; - /** - * Gets the cell at the given index. - * @param index the zero-based index of the cell in this list. - * @returns The cell. - * @throws {Stubs.Exceptions.IndexOutOfRangeError} if the index is negative or greater or equal than the {@link yfiles.algorithms.YList#size} - */ - getCell(index:number):yfiles.algorithms.ListCell; - /** - * Returns an enumerator that iterates through this collection. - * @returns An {@link } that can be used to iterate through this collection. - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Returns the element stored in the given list cell. - * @param c - * @returns - */ - getInfo(c:yfiles.algorithms.ListCell):any; - /** - * Whether or not this list contains the given element. - *

- * Equality of elements is defined by the {@link any#equals} method. - *

- * @param o - * @returns - */ - includes(o:any):boolean; - /** - * Returns the zero-based index of the given element in this list. - *

- * If the given element is not in the list, -1 is returned. - *

- * @param obj - * @returns - */ - indexOf(obj:any):number; - /** - * - * @param index - * @param element - */ - insert(index:number,element:any):void; - /** - * Inserts the given object into this list with respect to a given reference list cell. - *

- * The (newly created) list cell that stores the object is inserted right after the reference list cell refCell. - *

- *

- * If refCell == null, the given object is inserted at the head of the list. - *

- * @param o The object to be inserted. - * @param refCell The list cell used to reference the position. - * @returns The newly created ListCell object that stores object o. - */ - insertAfter(o:any,refCell:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Inserts the given object into this list with respect to a given reference list cell. - *

- * The (newly created) list cell that stores the object is inserted right before the reference list cell refCell. - *

- *

- * If refCell == null, the given object is appended to the list. - *

- * @param o The object to be inserted. - * @param refCell The list cell used to reference the position. - * @returns The newly created ListCell object that stores object o. - */ - insertBefore(o:any,refCell:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Inserts a formerly removed ListCell object into this list with respect to a given reference list cell. - *

- * The ListCell object is inserted right after the reference list cell refCell. - *

- *

- * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. - *

- * @param cellToInsert A list cell which is not part of any list. - * @param refCell The list cell used to reference the position. - */ - insertCellAfter(cellToInsert:yfiles.algorithms.ListCell,refCell:yfiles.algorithms.ListCell):void; - /** - * Inserts a formerly removed ListCell object into this list with respect to a given reference list cell. - *

- * The ListCell object is inserted right before the reference list cell refCell. - *

- *

- * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. - *

- * @param cellToInsert A list cell which is not part of any list. - * @param refCell The list cell used to reference the position. - */ - insertCellBefore(cellToInsert:yfiles.algorithms.ListCell,refCell:yfiles.algorithms.ListCell):void; - /** - * Checks whether this list contains elements. - * @returns - */ - isEmpty():boolean; - /** - * - * @param o - * @returns - */ - lastIndexOf(o:any):number; - /** - * Equivalent to {@link yfiles.algorithms.YList#firstObject}. - * @returns - */ - peek():any; - /** - * Removes the first element from this list and returns it. - * @returns - */ - pop():any; - /** - * Removes the last element from this list and returns it. - * @returns - */ - popLast():any; - /** - * Returns the predecessor cell of the given list cell. - * @param c - * @returns - */ - predCell(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Equivalent to {@link yfiles.algorithms.YList#addFirst}. - * @param o - * @returns - */ - push(o:any):yfiles.algorithms.ListCell; - /** - * Removes the given object from this list. - *

- * Only the first element for which equality to o holds gets removed. - *

- * @param o - * @returns - */ - remove(o:any):boolean; - /** - * Removes the given collection of objects from this list. - * @param collection - * @returns Whether there have been elements removed. - */ - removeAll(collection:yfiles.collections.ICollection):boolean; - /** - * - * @param index - */ - removeAt(index:number):void; - /** - * Removes the element pointed to by the given YCursor object. - * @param c - * @returns The removed element. - */ - removeAtCursor(c:yfiles.algorithms.ICursor):any; - /** - * Removes the given list cell, and hence the element stored in it, from this list. - * @param c - * @returns The element that is stored in the removed cell. - */ - removeCell(c:yfiles.algorithms.ListCell):any; - /** - * Retains only those elements in this list which are contained in the given collection. - * @param collection - * @returns Whether there have been elements removed. - */ - retainAll(collection:yfiles.collections.ICollection):boolean; - /** - * Reverses the sequence of elements in this list. - */ - reverse():void; - /** - * Sets the element at the specified index. - * @param index The zero-based index of the element to get or set. - * @param value The element at the specified index. - * @see yfiles.algorithms.YList#get - */ - set(index:number,value:any):void; - /** - * Updates the element stored in the given list cell with the given object. - * @param c - * @param value - */ - setInfo(c:yfiles.algorithms.ListCell,value:any):void; - /** - * Sorts the elements in this list according to the given comparator. - *

- * NOTE: The elements will be assigned to different list cells by this method. - *

- * @param comparer - */ - sort(comparer:yfiles.collections.IComparer):void; - /** - * Sorts the elements in this list into ascending order, according to their natural ordering. - *

- * All elements must implement the {@link yfiles.lang.IComparable} interface. Furthermore, all elements in this list must be - * mutually comparable (that is, e1.compareTo(e2) must not throw a ClassCastException for any elements e1 and e2 in this - * list). - *

- *

- * NOTE: The elements will be assigned to different list cells by this method. - *

- */ - sort():void; - /** - * Transfers the contents of the given list to the end of this list. - *

- * The given list will be empty after this operation. - *

- *

- * Note that this operation transfers the list cells of the given list to this list. No new list cells are created by this - * operation. - *

- * @param list - */ - splice(list:yfiles.algorithms.YList):void; - /** - * - * @param fromIndex - * @param toIndex - * @returns - */ - subList(fromIndex:number,toIndex:number):yfiles.collections.IList; - /** - * Returns the successor cell of the given list cell. - * @param c - * @returns - */ - succCell(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Returns an array representation of this list. - * @returns - */ - toArray():any[]; - /** - * Gets the number of elements in this list. - * @type {number} - */ - size:number; - /** - * Gets the first element of this list. - * @type {any} - */ - firstObject:any; - /** - * Gets the last element of this list. - * @type {any} - */ - lastObject:any; - /** - * Gets the first cell of this list. - * @type {yfiles.algorithms.ListCell} - */ - firstCell:yfiles.algorithms.ListCell; - /** - * Gets the last cell of this list. - * @type {yfiles.algorithms.ListCell} - */ - lastCell:yfiles.algorithms.ListCell; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YList; - } - }export namespace layout{ - /** - * {@link yfiles.layout.BendConverter} replaces edge bends with dummy nodes for the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - *

- * Concept Replacing the bends works in three steps: - *

- *
    - *
  1. Replacing the bends and the edge segments between them with dummy nodes and edges
  2. - *
  3. Invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} on the altered graph
  4. - *
  5. Recreating the bends and removing all dummy elements
  6. - *
- *

- * When the dummy elements have been inserted, edge information about {@link yfiles.layout.BendConverter#adoptPortConstraints port constraints}, {@link yfiles.layout.BendConverter#adoptEdgeGroups edge groups} and {@link yfiles.layout.BendConverter#adoptAffectedEdges selection state} can - * be adopted from the original edges. That way, the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} can access the mentioned information. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface BendConverter extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class BendConverter { - /** - * Creates a new {@link yfiles.layout.BendConverter} instance with the given size as the width and height for the dummy nodes. - * @param size the size for the dummy nodes - * @throws {Stubs.Exceptions.ArgumentError} if the given size is negative - */ - constructor(size:number); - /** - * Creates a new instance of {@link yfiles.layout.BendConverter} with the given {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - * @param core the core layout algorithm - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - /** - * Creates a new {@link yfiles.layout.BendConverter} instance with default settings. - */ - constructor(); - /** - * Adds information to newly created dummy nodes. - *

- * This is a callback method that will be invoked after new elements for the given edge have been added to the given graph - * by {@link yfiles.layout.BendConverter#prepare}. At this point, the original edge is still in the graph. - *

- *

- * The current implementation does nothing. - *

- * @param graph the input graph - * @param edge the edge whose bends were replaced by the given dummy nodes - * @param dummyNodes the dummy nodes representing the bends of the edge - * @protected - */ - addedPathForEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,dummyNodes:yfiles.algorithms.NodeList):void; - /** - * Replaces all bends in the current {@link yfiles.layout.BendConverter#DEFAULT_AFFECTED_EDGES_DP_KEY scope} with dummy nodes before invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - *

- * After the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} has finished, the edges between the dummy nodes are reconnected and the dummy nodes are - * replaced by bends again. - *

- * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Prepares the graph before calling the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - *

- * The bends of the edges belonging to the current scope are replaced by dummy nodes and the segments between those dummy - * nodes are replaced by dummy edges. - *

- *

- * Edge-specific information like {@link yfiles.layout.PortConstraint}s, edge groups or selection state can be applied to the dummy - * edges to keep this information for the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - *

- *

- * This method is called by {@link yfiles.layout.BendConverter#applyLayout} before invoking the - * {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. It may be overridden to extend the edge-specific information that should be adopted by the dummy - * edges. - *

- * @param graph the input graph - * @see yfiles.layout.BendConverter#restore - * @see yfiles.layout.BendConverter#adoptAffectedEdges - * @see yfiles.layout.BendConverter#adoptPortConstraints - * @see yfiles.layout.BendConverter#adoptEdgeGroups - * @protected - */ - prepare(graph:yfiles.layout.LayoutGraph):void; - /** - * Restores the structure of the graph after the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} has finished. - *

- * This method is called by {@link yfiles.layout.BendConverter#applyLayout} after invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. It may be - * overridden to clean up all additional information added in {@link yfiles.layout.BendConverter#prepare}. - *

- * @param graph the graph arranged by the {@link #coreLayout core layout algorithm} - * @see yfiles.layout.BendConverter#prepare - * @see yfiles.layout.BendConverter#adoptAffectedEdges - * @see yfiles.layout.BendConverter#adoptPortConstraints - * @see yfiles.layout.BendConverter#adoptEdgeGroups - * @protected - */ - restore(graph:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for specifying the set of edges for which this stage will replace bends - *

- * Only the bends of the marked edges will be replaced with dummy nodes. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the core layout algorithm that is wrapped by this {@link yfiles.layout.ILayoutStage}. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets whether or not edge grouping information of the original edge should be adopted by its replacement edges. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {boolean} - */ - adoptEdgeGroups:boolean; - /** - * Gets or sets whether or not the associated - * {@link yfiles.layout.PortConstraint}s of the original edge should be adopted by its replacement edges. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {boolean} - */ - adoptPortConstraints:boolean; - /** - * Gets or sets whether or not the selection state of the original edge should be adopted by its replacement edges. - *

- * The selection state is looked up in a {@link yfiles.algorithms.IDataProvider} registered with the key returned by {@link yfiles.layout.BendConverter#affectedEdgesDpKey}. - *

- * @see yfiles.layout.BendConverter#affectedEdgesDpKey - * @type {boolean} - */ - adoptAffectedEdges:boolean; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which identifies edges as selected. - *

- * If {@link yfiles.layout.BendConverter#adoptAffectedEdges the selection is conserved}, the selection state described by the {@link yfiles.algorithms.IDataProvider} registered with this - * key is applied to the according dummy edges. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.layout.BendConverter#adoptAffectedEdges - * @type {any} - */ - affectedEdgesDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.BendConverter; - } - /** - * A {@link yfiles.layout.BufferedLayout} is a hull algorithm that invokes its {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} on a copy of the input graph. - *

- * After the layout process has finished, the calculated layout will be written back to the original graph. - *

- *

- * This class also provides the possibility to perform arbitrary layout algorithms merely on a graph interface plus - * associated graph layout. This comes in handy if an application has its own graph and only provides a graph interface - * adapter to the yFiles graph layout machinery. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface BufferedLayout extends yfiles.layout.LayoutStageBase{} - export class BufferedLayout { - /** - * Creates a new {@link yfiles.layout.BufferedLayout} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] the core layout routine - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.BufferedLayout; - } - /** - * A {@link yfiles.layout.ComponentLayout} arranges the connected components of a graph. - *

- * Layout Style The components can be arranged using different {@link yfiles.layout.ComponentLayout#style styles}. All styles except {@link yfiles.layout.ComponentArrangementStyles#NONE} - * place the components without overlaps. {@graph {"ann":{"s":[30,30],"d":1},"n":[[552,150],[477,75],[75,150],[150,375],[150,225],[150,300],[351,150],[150,75],[0,150],[552,75],[477,0],[426,75],[351,225],[552,225],[150,150],[351,0],[276,75],[351,75],[75,300],[426,150],[225,150],[75,75],[225,300],[150,0],[477,351],[477,276],[553,351],[553,276],[150,450],[327,402],[276,402],[378,402],[429,402]],"e":[[0,1,-15,0,0,15,[492,165]],[3,5,0,-15,0,15],[5,4,0,-15,0,15],[8,2,15,0,-15,0],[0,9,0,-15,0,15],[9,1,-15,0,15,0],[1,10,0,-15,0,15],[12,6,0,-15,0,15],[0,13,0,15,0,-15],[4,14,0,-15,0,15],[14,2,-15,0,15,0],[14,7,0,-15,0,15],[16,15,0,-15,-15,0,[291,15]],[15,17,0,15,0,-15],[17,11,15,0,-15,0],[17,6,0,15,0,-15],[17,16,-15,0,15,0],[18,5,15,0,-15,0],[6,19,15,0,-15,0],[19,11,0,-15,0,15],[20,14,-15,0,15,0],[2,21,0,-15,0,15],[22,5,-15,0,15,0],[22,20,0,-15,0,15],[23,7,0,15,0,-15],[24,25,0,-15,0,15],[24,26],[26,27,0,-15,0,15],[25,27],[3,28,0,15,0,-15],[30,29],[31,32]],"vp":[0.0,0.0,583.0,480.0]}} - *

- *

- * Layout with orthogonal components using {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_COMPACT} - *

- *

- * Concept - *

- *

- * {@link yfiles.layout.ComponentLayout} is a {@link yfiles.layout.ILayoutStage} that can wrap another {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. That way, it - * allows handling disconnected graphs for the wrapped {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- *

- * The following steps outline the concept of {@link yfiles.layout.ComponentLayout}: - *

- *
    - *
  1. Determine the connected components of the graph
  2. - *
  3. Hide all graph components
  4. - *
  5. Apply the following steps to each component separately
  6. - *
  7. Unhide all graph components
  8. - *
  9. {@link yfiles.layout.ComponentLayout#componentArrangement Optionally arrange} the components
  10. - *
- *

- * Features - *

- *

- * To arrange the subgraphs of the components, {@link yfiles.layout.ComponentLayout} uses the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. If - * there is no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} specified, it will keep the locations in the subgraph and arrange the components as - * they are. - *

- *

- * Hierarchically grouped graphs are handled in a special way. The contents of a group node will always belong to the same - * component as the group node itself. To change that behavior {@link yfiles.layout.ComponentLayout#considerGrouping grouping} can be disabled. - *

- *

- * By default, the components consist of the connected nodes in a graph. To choose custom subgraphs to form components, - * register a {@link yfiles.algorithms.IDataProvider} with {@link yfiles.layout.ComponentLayout#COMPONENT_ID_DP_KEY} and assign component - * IDs to the nodes. - *

- * @see yfiles.layout.MultiStageLayout - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface ComponentLayout extends yfiles.layout.LayoutStageBase{} - export class ComponentLayout { - /** - * Creates a new {@link yfiles.layout.ComponentLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algortihm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Produces a component graph layout. - *

- * This method is called by {@link yfiles.layout.ComponentLayout#applyLayout} in case {@link yfiles.layout.ComponentLayout#componentArrangement component arrangement} is enabled. It moves - * the graph's components such that their bounding boxes do not overlap. Subclasses may want to override this method to - * introduce custom component arrangement styles. - *

- * @param graph the input graph - * @param nodes the nodes of the components; the i-th list contains the nodes of the i-th component - * @param edges the edges of the components; the i-th list contains the edges of the i-th component - * @param bbox the bounds of the components; the i-th rectangle describes the bounding box of the i-th component - * @param boxes the extended bounds of the components; the i-th rectangle describes the bounding box of the i-th component extended by - * the spacing between components. The method arranges these boxes in such a way that they do not overlap. Then, the i-th - * graph component must be placed inside the i-th box - * @see yfiles.layout.ComponentLayout#arrangeFields - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - * @protected - */ - arrangeComponents(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList[],edges:yfiles.algorithms.EdgeList[],bbox:yfiles.algorithms.YRectangle[],boxes:yfiles.algorithms.Rectangle2D[]):void; - /** - * Arranges the bounding boxes of the components. - *

- * This method is called by {@link yfiles.layout.ComponentLayout#arrangeComponents} if the {@link yfiles.layout.ComponentLayout#style style} is set to - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_RECTANGLE}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE} - * or - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_CIRCLE}. It may be overridden to adjust the component arrangement - * strategy of the mentioned styles. - *

- * @param graph the input graph - * @param nodes the nodes of the components; the i-th list contains the nodes of the i-th component - * @param edges the edges of the components; the i-th list contains the edges of the i-th component - * @param bbox the bounds of the components; the i-th rectangle describes the bounding box of the i-th component - * @param boxes the extended bounds of the components; the i-th rectangle describes the bounding box of the i-th component - * @param circular true if the arrangement should be circular, false if it should be rectangular - * @param fill true if it is allowed to place components in empty spaces inside other - * components, false otherwise - * @param fromSketch true if the initial coordinates should be considered, false otherwise - * @protected - */ - arrangeFields(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList[],edges:yfiles.algorithms.EdgeList[],bbox:yfiles.algorithms.YRectangle[],boxes:yfiles.algorithms.Rectangle2D[],circular:boolean,fill:boolean,fromSketch:boolean):void; - /** - * Calculates the bounding box of a graph component including {@link yfiles.layout.NodeHalo}s. - *

- * This method will be invoked for each component of the graph. Depending on the state of property - * {@link yfiles.layout.ComponentLayout#considerLabels}, the returned bounding box will also include node and edge labels. It may be overridden to extend the bounds to reserve - * space for other elements. - *

- * @param graph the subgraph containing the nodes and edges of a component - * @returns the bounding box of the component - * @see yfiles.layout.ComponentLayout#considerLabels - * @protected - */ - calculateBounds(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.Rectangle2D; - /** - * Determines which nodes belong to the same graph component. - *

- * This implementation uses the graph connectivity to sort the nodes into different components. Nodes that are not - * connected by a path will be in separate components. - *

- *

- * This method is called by {@link yfiles.layout.ComponentLayout#applyLayout}. It may be overridden to choose another approach to - * find components that will be passed to the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. However, most of the layout algorithms cannot handle disconnected graphs. Also, edges between - * custom components will be ignored. - *

- * @param graph the input graph - * @param compNumber a map that will be filled with the zero-based index of the component to which the node belongs - * @returns the number of connected components of this graph - * @see yfiles.algorithms.GraphConnectivity#connectedComponents - * @protected - */ - findGraphComponents(graph:yfiles.layout.LayoutGraph,compNumber:yfiles.algorithms.INodeMap):number; - /** - * Moves the subgraph containing the given nodes and edges to the specified origin. - *

- * This method is called by {@link yfiles.layout.ComponentLayout#arrangeComponents} and {@link yfiles.layout.ComponentLayout#arrangeFields} - * to move the components to overlap-free positions. - *

- * @param graph the input graph - * @param nodes the nodes in the moving subgraph - * @param edges the edges in the moving subgraph - * @param origin the new origin of the graph - * @param rectangle the current bounds of the subgraph - * @protected - */ - setOrigin(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList,edges:yfiles.algorithms.EdgeList,origin:yfiles.algorithms.YPoint,rectangle:yfiles.algorithms.YRectangle):void; - /** - * Data provider key for specifying which nodes should be arranged - *

- * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all components will be laid out by the core layout - * algorithm. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_COMPONENTS_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying custom graph components - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static COMPONENT_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the preferred size of the layout. - *

- * The layout size also defines the desired aspect ratio (width/height). - *

- *

- * The width and height need to be greater than zero. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is negative or zero. - * @type {yfiles.algorithms.YDimension} - */ - preferredSize:yfiles.algorithms.YDimension; - /** - * Gets or sets whether or not to take node and edge labels into account when calculating the bounding box of the graph - * components. - * @see yfiles.layout.ComponentLayout#calculateBounds - * @type {boolean} - */ - considerLabels:boolean; - /** - * Gets or sets whether or not the separately arranged components of the input graph should be arranged relative to each - * other. - *

- * If enabled, the components are arranged using a specific {@link yfiles.layout.ComponentLayout#style style} without producing overlaps between components (except for - * {@link yfiles.layout.ComponentArrangementStyles#NONE}). Otherwise, the layout algorithm will keep the components at their - * location. Then, the components may overlap. - *

- * @type {boolean} - */ - componentArrangement:boolean; - /** - * Gets or sets the current grid spacing. - *

- * Components will be moved by multiples of this value, thus keeping their offset to the grid. That way, components or - * parts of them that were placed on a grid before, will stay on their original grid. The grid spacing also influences the - * distance between the components. - *

- *

- * The spacing needs to be a non-negative value. If the grid spacing is set to 0, the grid won't be considered at all. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets the distance between the bounding boxes of the components. - *

- * The spacing needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative - * @type {number} - */ - componentSpacing:number; - /** - * Gets or sets whether or not grouping information bound to the graph should be considered when determining the graph - * components. - * @type {boolean} - */ - considerGrouping:boolean; - /** - * Gets or sets how the components are arranged. - * @throws {Stubs.Exceptions.ArgumentError} if the specified style is unknown - * @type {yfiles.layout.ComponentArrangementStyles} - */ - style:yfiles.layout.ComponentArrangementStyles; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ComponentLayout; - } - /** - * {@link yfiles.layout.CompositeLayoutStage} allows for combining multiple {@link yfiles.layout.ILayoutStage}s. - *

- * The {@link yfiles.layout.ILayoutStage}s are organized in a pipeline where additional {@link yfiles.layout.ILayoutStage}s can be {@link yfiles.layout.CompositeLayoutStage#prependStage prepended} - * or {@link yfiles.layout.CompositeLayoutStage#appendStage appended}. - *

- *

- * Each {@link yfiles.layout.ILayoutStage} in the pipeline executes its pre-processing code before calling its successor - * {@link yfiles.layout.ILayoutStage}. Then, after all subsequent - * {@link yfiles.layout.ILayoutStage}s have finished, it will execute its post-processing code. - *

- *

- * Note that the pipeline only works when all {@link yfiles.layout.ILayoutStage}s call their core layout algorithm which is the - * next {@link yfiles.layout.ILayoutStage} in the pipeline. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface CompositeLayoutStage extends yfiles.layout.LayoutStageBase{} - export class CompositeLayoutStage { - /** - * Creates a new {@link yfiles.layout.CompositeLayoutStage} instance with two {@link yfiles.layout.ILayoutStage}s in the pipeline. - *

- * The inner {@link yfiles.layout.ILayoutStage} will be wrapped by the outer {@link yfiles.layout.ILayoutStage}. - *

- * @param outerStage the wrapping {@link } - * @param innerStage the wrapped {@link } - */ - constructor(outerStage:yfiles.layout.ILayoutStage,innerStage:yfiles.layout.ILayoutStage); - /** - * Creates a new {@link yfiles.layout.CompositeLayoutStage} instance with an empty pipeline. - */ - constructor(); - /** - * Appends a {@link yfiles.layout.ILayoutStage} to the previously added {@link yfiles.layout.ILayoutStage}s. - *

- * The added {@link yfiles.layout.ILayoutStage} will be invoked just before the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} will be invoked. Its - * pre-processing code will be executed after the already added {@link yfiles.layout.ILayoutStage}s' pre-processing code, while its - * post-processing code will be executed before the post-processing code of all the other {@link yfiles.layout.ILayoutStage}s. - *

- * @param stage the stage to append - */ - appendStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Prepends a {@link yfiles.layout.ILayoutStage} to the previously added {@link yfiles.layout.ILayoutStage}s. - *

- * The added {@link yfiles.layout.ILayoutStage} will be invoked before any other {@link yfiles.layout.ILayoutStage}. Its pre-processing - * code will be executed before the already added {@link yfiles.layout.ILayoutStage}s' pre-processing code, while its - * post-processing code will be executed after the post-processing code of all the other {@link yfiles.layout.ILayoutStage}s. - *

- * @param stage the stage to prepend - */ - prependStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Gets the complete pipeline of {@link yfiles.layout.ILayoutStage}s that were added to this {@link yfiles.layout.CompositeLayoutStage}. - * @type {yfiles.collections.IList.} - */ - layoutStages:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.CompositeLayoutStage; - } - /** - * A {@link yfiles.layout.CopiedLayoutGraph} is a {@link yfiles.layout.LayoutGraph} that serves as a copy of another graph with layout information. - *

- * A {@link yfiles.layout.CopiedLayoutGraph} comes to use if a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} should not run directly on the original graph. - * Using a copy, the calculated layout will not be applied to the original graph before the layout algorithm finished - * successfully. This can prevent inconsistencies in case something goes wrong during layout calculations. - *

- *

- * Concept {@link yfiles.layout.CopiedLayoutGraph} contains corresponding nodes and edges for each node and edge in the original graph and - * copies the labels of the original nodes and edges. It also delegates all - * {@link yfiles.algorithms.IDataProvider}s registered with the original graph. - *

- *

- * To preserve the relations between the original elements and the copied elements in this graph, {@link yfiles.layout.CopiedLayoutGraph} - * updates mappings between those elements. - *

- *

- * If there are structural changes to the original graph, they can be transferred to this copied graph using - * {@link yfiles.layout.CopiedLayoutGraph#syncStructure}. Then the copied graph will be altered, adding and removing elements, - * until it corresponds to the original again. - *

- *

- * Method {@link yfiles.layout.CopiedLayoutGraph#commitLayoutToOriginalGraph} will transfer updated layout information to the - * original graph. The original graph will stay unchanged until this method is called. - *

- * @see yfiles.layout.BufferedLayout - * @class - * @extends {yfiles.layout.LayoutGraph} - */ - export interface CopiedLayoutGraph extends yfiles.layout.LayoutGraph{} - export class CopiedLayoutGraph { - /** - * Creates a new {@link yfiles.layout.CopiedLayoutGraph} instance which is a copy of the given graph. - * @param graph the original graph - */ - constructor(graph:yfiles.layout.LayoutGraph); - /** - * Writes the current layout information of all elements of this copied graph to the original graph. - */ - commitLayoutToOriginalGraph():void; - /** - * Creates an edge in the copied graph that corresponds to the given original edge. - *

- * The edge will connect to the copies of the source and target of the original edge. All labels of the original edge will - * be also copied and assigned to this edge. - *

- *

- * The mappings are updated. Hence, it is possible to look up the newly created edge by using {@link yfiles.layout.CopiedLayoutGraph#getCopiedEdge} - * or the original edge by using {@link yfiles.layout.CopiedLayoutGraph#getOriginalEdge}. - *

- *

- * This method can be used for keeping the {@link yfiles.layout.CopiedLayoutGraph} in sync with the original graph. - *

- * @param originalEdge the original edge - * @returns the copy of the original edge - */ - createCopiedEdge(originalEdge:any):yfiles.algorithms.Edge; - /** - * Creates a node in the copied graph that corresponds to the given original node. - *

- * All labels of the original node will be copied and assigned to this node. - *

- *

- * The mappings are updated. Hence, it is possible to look up the newly created node by using {@link yfiles.layout.CopiedLayoutGraph#getCopiedNode} - * or the original node by using {@link yfiles.layout.CopiedLayoutGraph#getOriginalNode}. - *

- *

- * This method can be used for keeping the {@link yfiles.layout.CopiedLayoutGraph} in sync with the original graph. - *

- * @param originalNode the original node - * @returns the copy of the original node - */ - createCopiedNode(originalNode:any):yfiles.algorithms.Node; - /** - * Returns the copied edge that corresponds to the given original edge. - * @param originalEdge an edge of the original graph whose copy resides in this graph - * @returns an edge in this graph that is the copy of the given original edge - */ - getCopiedEdge(originalEdge:any):yfiles.algorithms.Edge; - /** - * Returns the copied node that corresponds to the given original node. - * @param originalNode a node of the original graph whose copy resides in this graph - * @returns a node in this graph that is the copy of the given original node - */ - getCopiedNode(originalNode:any):yfiles.algorithms.Node; - /** - * Returns the original edge that corresponds to the given copied edge. - * @param copiedEdge the edge in this graph that is a copy of the returned edge - * @returns the edge in the original graph whose copy is the given edge - */ - getOriginalEdge(copiedEdge:yfiles.algorithms.Edge):any; - /** - * Returns the original node that corresponds to the given copied node. - * @param copiedNode the node in this graph that is a copy of the returned node - * @returns the node in the original graph whose copy is the given node - */ - getOriginalNode(copiedNode:yfiles.algorithms.Node):any; - /** - * Synchronizes the structure of the {@link yfiles.layout.CopiedLayoutGraph} with the actual structure of the underlying original - * graph. - */ - syncStructure():void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.CopiedLayoutGraph; - } - /** - * {@link yfiles.layout.CurveFittingLayoutStage} fits a piecewise cubic bezier curve to given arbitrary edge paths. - *

- * Concept - *

- *

- * The {@link yfiles.layout.LayoutGraph#getPath path} of an edge, i.e., its start and end point as well as the intermediate control points, are interpreted as the - * set of input points. A cubic bezier curve is then fitted to these points. - *

- *

- * After the fitting, the points of the processed edges can be interpreted as cubic bezier control points. Each four - * consecutive points form a bezier curve, where the first and last of the four points represent the start and end of the - * curve and the second and third point are the control points defining how the curve looks. The second and third point do - * not necessarily lie on the actual curve. - *

- *

- * There are two exceptions to the stated rules: - *

- *
    - *
  • If an input edge only consists of a source and a target point, it will be ignored by this stage.
  • - *
  • - * Self-loop edges with only one intermediate control point are also ignored. Note that self-loops with more control points - * are, however, handled by this stage. - *
  • - *
- *

- * Features - *

- *

- * The {@link yfiles.layout.CurveFittingLayoutStage#maximumError maximum allowed error} for the fitting process can be selected to control how high the precision should be. A high - * allowed error means that the approximation process has a lot of freedom. Curves are only loosely bound to the original - * edge path. If this is not desired, e.g., because no new intersection with other graph elements should be introduced, - * then a rather low error value should be specified. The lower the error value, the larger the number of bend points of an - * approximated edge will be. - *

- *

- * It is possible to define the set of edges that should be processed by this layout stage. Therefore, only paths of a - * sub-set of edges can be changed. Use a {@link yfiles.algorithms.IDataProvider} registered with the specified {@link yfiles.layout.CurveFittingLayoutStage#affectedEdgesDpKey selection key} to - * mark edges which should be part of the considered sub-set. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface CurveFittingLayoutStage extends yfiles.layout.LayoutStageBase{} - export class CurveFittingLayoutStage { - /** - * Creates a new {@link yfiles.layout.CurveFittingLayoutStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Data provider key for selecting edges for curve fitting - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the maximum allowed error for the fitting process. - *

- * The error is defined as the minimum distance between an original input control point (i.e. bend) of and edge and the - * fitted bezier curve. - *

- *

- * The maximum error must be greater than or equal to zero. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified maximum error is negative - * @type {number} - */ - maximumError:number; - /** - * Gets or sets the ratio that defines the distance between the intermediate control points and the end points of a cubic - * segment which actually represents a straight line, i.e., in case the four points are collinear. - *
    - *
  • 0.33 - the second and third control point are equally distributed between te first and fourth point.
  • - *
  • 0.0 - the first and second control point as well as the third and fourth point are equal.
  • - *
  • 0.5 - the second and third control point are equal and exactly the mid-point between the first and fourth point.
  • - *
- *

- * The control point ratio is defined to be within the interval [0.0, 0.5]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0.0, 0.5] - * @type {number} - */ - straightControlPointRatio:number; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the edges that defines whether or - * not an edge's path should be approximated by a bezier curve. - *

- * If there is a {@link yfiles.algorithms.IDataProvider} registered with the input graph with this key, then only marked edges are - * processed by this layout stage. Otherwise, all edges are processed. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @type {any} - */ - affectedEdgesDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.CurveFittingLayoutStage; - } - /** - * {@link yfiles.layout.DefaultLayoutGraph} is a default implementation of {@link yfiles.layout.LayoutGraph} which holds the complete - * layout information about the graph and its elements. - * @class - * @extends {yfiles.layout.LayoutGraph} - */ - export interface DefaultLayoutGraph extends yfiles.layout.LayoutGraph{} - export class DefaultLayoutGraph { - /** - * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance which is a copy of the given subgraph. - * @param graph the original graph - * @param nodeSubset the nodes that induce a subgraph of the original graph - */ - constructor(graph:yfiles.layout.LayoutGraph,nodeSubset:yfiles.algorithms.ICursor); - /** - * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance which is a copy of the given graph. - * @param argGraph the original graph - */ - constructor(argGraph:yfiles.layout.LayoutGraph); - /** - * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance with default settings. - */ - constructor(); - /** - * Creates a new implementation of {@link yfiles.layout.IEdgeLayout}. - *

- * This method is called by {@link yfiles.layout.DefaultLayoutGraph#getLayout} if there is no layout information assigned to an - * edge, yet. It may be overridden to create custom {@link yfiles.layout.IEdgeLayout}s. - *

- * @returns the layout of an edge - * @protected - */ - createEdgeLayout():yfiles.layout.IEdgeLayout; - /** - * Creates a new implementation of {@link yfiles.layout.INodeLayout}. - *

- * This method is called by {@link yfiles.layout.DefaultLayoutGraph#getLayout} if there is no layout information assigned to a - * node, yet. It may be overridden to create custom {@link yfiles.layout.INodeLayout}s. - *

- * @returns the layout of a node - * @protected - */ - createNodeLayout():yfiles.layout.INodeLayout; - /** - * Specifies the layout information for all associated labels of the given edge. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param edge the edge - * @param layout the layout information for the labels of the edge - */ - setLabelLayout(edge:yfiles.algorithms.Edge,layout:yfiles.layout.IEdgeLabelLayout[]):void; - /** - * Specifies the layout information for all associated labels of the given node. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param node the node - * @param layout the layout information for the labels of the node - */ - setLabelLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLabelLayout[]):void; - /** - * Specifies the layout information for all associated labels of the given node in case there is only one label. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param node the node - * @param layout the layout information for the label of the node - */ - setLabelLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLabelLayout):void; - /** - * Specifies the layout information for the given edge. - *

- * The layout information consists of the locations of the control and end points of the edge. - *

- * @param edge the edge - * @param layout the layout information for the edge - */ - setLayout(edge:yfiles.algorithms.Edge,layout:yfiles.layout.IEdgeLayout):void; - /** - * Specifies the layout information for the given node. - *

- * The layout information consists of the location and size of the node. - *

- * @param node the node - * @param layout the layout information for the node - */ - setLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLayout):void; - /** - * A {@link yfiles.algorithms.INodeMap} associating {@link yfiles.layout.INodeLabelLayout}s with the nodes of this graph. - * @see yfiles.layout.DefaultLayoutGraph#setLabelLayout - * @type {yfiles.algorithms.INodeMap} - */ - nodeLabelMap:yfiles.algorithms.INodeMap; - /** - * An {@link yfiles.algorithms.IEdgeMap} associating {@link yfiles.layout.IEdgeLabelLayout}s with the edges of this graph. - * @see yfiles.layout.DefaultLayoutGraph#setLabelLayout - * @type {yfiles.algorithms.IEdgeMap} - */ - edgeLabelMap:yfiles.algorithms.IEdgeMap; - /** - * A {@link yfiles.collections.IMap.} associating the owner of a node label with the node label itself. - * @type {yfiles.collections.IMap.} - */ - nodeLabelFeatureMap:yfiles.collections.IMap; - /** - * A {@link yfiles.collections.IMap.} associating the owner of an edge label with the edge label itself. - * @type {yfiles.collections.IMap.} - */ - edgeLabelFeatureMap:yfiles.collections.IMap; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DefaultLayoutGraph; - } - /** - * {@link yfiles.layout.Direction} provides four main directions and some methods to work with them. - * @class - * @final - */ - export interface Direction extends yfiles.lang.Object{} - export class Direction { - /** - * Returns the direction encoded as an integer value. - * @returns 0 for direction {@link #UP}, 1 for {@link #RIGHT}, 2 for {@link #DOWN}, and - * 3 for {@link #LEFT} - */ - getDirection():number; - /** - * Decodes the up direction. - * @const - * @static - * @type {yfiles.layout.Direction} - */ - static UP:yfiles.layout.Direction; - /** - * Decodes the right direction. - * @const - * @static - * @type {yfiles.layout.Direction} - */ - static RIGHT:yfiles.layout.Direction; - /** - * Decodes the down direction. - * @const - * @static - * @type {yfiles.layout.Direction} - */ - static DOWN:yfiles.layout.Direction; - /** - * Decodes the left direction. - * @const - * @static - * @type {yfiles.layout.Direction} - */ - static LEFT:yfiles.layout.Direction; - /** - * Gets the direction that follows this direction in clockwise order. - *

- * The new direction is turned 90 degrees in clockwise direction compared to this instance. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid - * @type {yfiles.layout.Direction} - */ - turnCW:yfiles.layout.Direction; - /** - * Gets the direction that follows this direction in counterclockwise order. - *

- * The new direction is turned 90 degrees in counterclockwise direction compared to this instance. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid - * @type {yfiles.layout.Direction} - */ - turnCCW:yfiles.layout.Direction; - /** - * Gets the mirror direction. - *

- * The new direction is turned 180 degrees compared to this instance. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid - * @type {yfiles.layout.Direction} - */ - mirror:yfiles.layout.Direction; - /** - * Gets whether or not this direction is horizontal ({@link yfiles.layout.Direction#RIGHT} or {@link yfiles.layout.Direction#LEFT}). - * @type {boolean} - */ - horizontal:boolean; - /** - * Gets whether or not this direction is vertical ({@link yfiles.layout.Direction#UP} or {@link yfiles.layout.Direction#DOWN}). - * @type {boolean} - */ - vertical:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.Direction; - } - /** - * {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} describes the placement of rotated labels at some predefined positions along - * the edge. - *

- * {@graph {"ann":{"s":[30,30],"d":1,"lblB":1},"n":[[0,0],[200,0]],"e":[[0,1,[],[[35,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[35,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[35,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"]]]],"vp":[0.0,-27.0,230.0,84.0]}} - *

- *

- * The predefined positions in this model - *

- *

- * It's possible to specify a distance value that controls the distance between label and edge. - *

- *

- * Furthermore, there's the possibility to mask out arbitrary edge label candidates. This can either be done by specifying - * predefined candidate masks or combining several label positions with a logical or-operation to a user-defined mask. - *

- * @class - * @implements {yfiles.layout.IEdgeLabelLayoutModel} - */ - export interface DiscreteEdgeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.IEdgeLabelLayoutModel{} - export class DiscreteEdgeLabelLayoutModel { - /** - * Creates a new instance of {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} using the given candidate mask. - *

- * The candidates mask can either describe multiple or single valid positions. - *

- * @param candidateMask the position mask that defines the allowed positions for an edge label - */ - constructor(candidateMask:yfiles.layout.DiscreteEdgeLabelPositions); - /** - * Creates a new instance of {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} with default settings. - */ - constructor(); - /** - * - * @param labelBounds - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @returns - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):any; - /** - * Returns a model parameter that encodes the specified position. - *

- * This model parameter can be passed to {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelPlacement} to determine the - * label's position. - *

- * @param position one of the valid positions - * @returns a model parameter that encodes the specified position - * @throws {Stubs.Exceptions.ArgumentError} if the specified position is unknown - * @static - */ - static createPositionParameter(position:number):any; - /** - * - * @param label - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @returns - */ - getLabelCandidates(label:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @param param - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YOrientedRectangle; - /** - * Returns the oriented box of the label for the given label position. - *

- * This method is called by {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelPlacement} and {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelCandidates} - * to retrieve a valid position. - *

- * @param labelSize the size of the label that should be placed - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @param position the label position that is valid in this model - * @returns the oriented box of the label - * @protected - */ - getLabelPlacementForPosition(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,position:yfiles.layout.DiscreteEdgeLabelPositions):yfiles.algorithms.YOrientedRectangle; - /** - * Returns the position specifier that is encoded by the given model parameter. - * @param parameter the model parameter - * @returns the position specifier - * @throws {Stubs.Exceptions.ArgumentError} if the specified model parameter is not valid for this model - * @static - */ - static getPosition(parameter:any):number; - /** - * Checks whether or not the given model parameter encodes a valid edge label position for this model. - *

- * If the model parameter describes a position that is accepted by the candidate mask, this is a valid parameter. - *

- * @param parameter the model parameter - * @returns true if the label position described by the given model parameter is allowed, false otherwise - */ - isParameterValid(parameter:any):boolean; - /** - * Gets the candidate mask which specifies the valid positions for edge labels. - * @type {yfiles.layout.DiscreteEdgeLabelPositions} - */ - candidateMask:yfiles.layout.DiscreteEdgeLabelPositions; - /** - * Gets or sets whether or not the label position mask should be interpreted relative to the edge segment. - *

- * If this option is disabled, the position mask is interpreted in a geometric sense. - *

- * @type {boolean} - */ - positionRelativeToSegment:boolean; - /** - * Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference - * edge segment. - * @type {boolean} - */ - autoRotationEnabled:boolean; - /** - * Gets or sets whether or not edge labels get flipped if they would be upside down in their current position. - * @type {boolean} - */ - autoFlipping:boolean; - /** - * Gets or sets the angle (measured in radians) of the label model. - *

- * The angle is applied in clockwise direction. - *

- * @type {number} - */ - angle:number; - /** - * Gets or sets the distance between the label's bounding box and the edge path. - *

- * The distance must be a non-negative value. - *

- * @type {number} - */ - distance:number; - /** - * Gets a model parameter that encodes the default position of this model's allowed edge label positions. - *

- * Default positions are (in descending order): - *

- *
    - *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#CENTER}
  • - *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_CENTER}
  • - *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#TAIL}
  • - *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_TAIL}
  • - *
- *

- * Descending order means that whenever two or more of the above default positions are part of the allowed positions, then - * the model parameter encodes the one that is listed first. - *

- * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DiscreteEdgeLabelLayoutModel; - } - /** - * {@link yfiles.layout.DiscreteNodeLabelLayoutModel} allows placing labels at eight positions around a node and at nine positions - * inside the node. - *

- * {@graph {"ann":{"s":[120,80],"d":1,"lblB":1},"n":[[-11.9,13.17,[[31.42,9.17,33.36,18.7,"Label"],[112.1,111.88,33.36,18.7,"Label"],[112.1,62.53,33.36,18.7,"Label"],[31.42,115.88,33.36,18.7,"Label"],[-49.27,111.88,33.36,18.7,"Label"],[-49.27,62.53,33.36,18.7,"Label"],[112.1,13.17,33.36,18.7,"Label"],[-49.27,13.17,33.36,18.7,"Label"],[31.42,62.53,33.36,18.7,"Label"],[-7.9,62.53,33.36,18.7,"Label"],[-7.9,89.17,33.36,18.7,"Label"],[31.42,89.17,33.36,18.7,"Label"],[70.73,89.17,33.36,18.7,"Label"],[-7.9,35.88,33.36,18.7,"Label"],[70.73,62.53,33.36,18.7,"Label"],[70.73,35.88,33.36,18.7,"Label"],[31.42,35.88,33.36,18.7,"Label"]]]],"e":[],"vp":[-50.0,-10.0,196.0,126.0]}} - *

- *

- * The predefined positions in this model - *

- *

- * It's possible to specify an insets value that controls the distance between label and node. - *

- *

- * Furthermore, there's the possibility to mask out arbitrary node label candidates. This can either be done by specifying - * predefined candidate masks or a combination of valid positions of this model using a logical or-operation. - *

- * @class - * @implements {yfiles.layout.INodeLabelLayoutModel} - */ - export interface DiscreteNodeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.INodeLabelLayoutModel{} - export class DiscreteNodeLabelLayoutModel { - /** - * Creates a new instance of {@link yfiles.layout.DiscreteNodeLabelLayoutModel} using the given candidate mask and insets. - *

- * The specified mask can also describe a single position. - *

- * @param candidateMask the position mask that defines the allowed positions for a node label - * @param [inset=4.0] the inset value that defines the internal label distance to the node's border - */ - constructor(candidateMask:yfiles.layout.DiscreteNodeLabelPositions,inset?:number); - /** - * Creates a new instance of {@link yfiles.layout.DiscreteNodeLabelLayoutModel} with default settings. - */ - constructor(); - /** - * - * @param labelBounds - * @param nodeLayout - * @returns - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):any; - /** - * - * @param labelLayout - * @param nodeLayout - * @returns - */ - getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param nodeLayout - * @param parameter - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,parameter:any):yfiles.algorithms.YOrientedRectangle; - /** - * Returns the oriented box of the label for the given label position. - *

- * This method is called by {@link yfiles.layout.DiscreteNodeLabelLayoutModel#getLabelPlacement} and {@link yfiles.layout.DiscreteNodeLabelLayoutModel#getLabelCandidates} - * to retrieve a valid position. - *

- * @param labelSize the size of the label that should be placed - * @param nodeLayout the layout of the node to which the label belongs - * @param position the label position that is valid in this model - * @returns the oriented box of the label - * @protected - */ - getLabelPlacementForPosition(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,position:yfiles.layout.DiscreteNodeLabelPositions):yfiles.algorithms.YOrientedRectangle; - /** - * Checks whether or not the given model parameter encodes a valid node label position for this model. - *

- * If the model parameter describes a position that is accepted by the candidate mask, this is a valid parameter. - *

- * @param parameter the model parameter - * @returns true if the label position described by the given model parameter is allowed, false otherwise - */ - isParameterValid(parameter:any):boolean; - /** - * Gets the candidate mask which specifies the valid positions for node labels. - * @type {yfiles.layout.DiscreteNodeLabelPositions} - */ - candidateMask:yfiles.layout.DiscreteNodeLabelPositions; - /** - * Gets or sets the distance between the label's bounding box and the node. - *

- * The distance must be a non-negative value. - *

- * @type {number} - */ - distance:number; - /** - * Gets a model parameter that encodes the default position of this model's allowed node label positions. - *

- * Default positions are (in descending order): - *

- *
    - *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#CENTER}
  • - *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST}
  • - *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH}
  • - *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#EAST}
  • - *
- *

- * Descending order means that whenever two or more of the above default positions are part of the allowed positions, then - * the model parameter encodes the one that is listed first. - *

- * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DiscreteNodeLabelLayoutModel; - } - /** - * An {@link yfiles.layout.EdgeBundleDescriptor} defines the {@link yfiles.layout.EdgeBundling bundling} settings of an edge. - *

- * The defined settings will be considered by {@link yfiles.layout.ILayoutAlgorithm layout algorithms} which support edge bundling. - *

- *

- * Each {@link yfiles.layout.EdgeBundleDescriptor} can either be specified for a single edge or shared by several edges. It is - * assigned to an edge by registering a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY} - * to the input graph. - *

- * @see yfiles.layout.EdgeBundling - * @see yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY - * @class - */ - export interface EdgeBundleDescriptor extends yfiles.lang.Object{} - export class EdgeBundleDescriptor { - /** - * Creates a new {@link yfiles.layout.EdgeBundleDescriptor} representing a copy of the given other descriptor instance. - * @param descriptor the descriptor to copy - */ - constructor(descriptor:yfiles.layout.EdgeBundleDescriptor); - /** - * Creates a new {@link yfiles.layout.EdgeBundleDescriptor} with default settings. - */ - constructor(); - /** - * Gets or sets whether or not the direction of the edge associated to this descriptor should be considered. - *

- * During the bundling procedure, the edges are bundled based on their direction such that the incoming edges of a node are - * bundled separately from its outgoing edges. If the direction of edges adjacent to a node is not considered, then they - * are not bundled separately. - *

- *

- * If the direction of some edges is taken into consideration while the direction of some others (adjacent to the same - * node) is ignored, the undirected edges are also bundled separately. This is done to distinguish them from the incoming - * and outgoing edges of the particular node. - *

- * @type {boolean} - */ - considerDirection:boolean; - /** - * Gets or sets whether or not an edge associated to this descriptor should be bundled. - * @type {boolean} - */ - bundled:boolean; - /** - * Gets or sets whether or not a bezier curve should be fit to an edge associated to this descriptor. - *

- * If disabled, the edges resemble B-splines where points of the path are actually curve points. Therefore, this - * representation requires a high number of bends to model curves. - *

- *

- * If this feature is enabled, a bezier curve is fitted to the start and end point as well as the intermediate control - * points of the edge. After the fitting, the points of the edge can be interpreted as cubic bezier control points. Each - * four consecutive points form a bezier curve, where the first and last of the four points represent the start and end of - * the curve and the second and third point are the control points defining how the curve looks. The second and third point - * do not necessarily lie on the actual curve. - *

- * @type {boolean} - */ - bezierFitting:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.EdgeBundleDescriptor; - } - /** - * An {@link yfiles.layout.EdgeBundling} instance defines if and how the edges of a graph should be bundled by a - * {@link yfiles.layout.ILayoutAlgorithm layout algorithm}, given that the algorithm supports edge bundling. - *

- * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the - * source and target point, the edges are again clearly split. Edge bundling is useful to increase the readability of graph - * drawings with a high number of edges that connect a comparably small number of nodes. Without bundling, such drawings - * can often contain visual clutter and feature bad readability. - *

- *

- * The bundling {@link yfiles.layout.EdgeBundling#bundlingStrength strength} and {@link yfiles.layout.EdgeBundling#bundlingQuality quality} are global settings for the bundling process. On the other hand, each edge can get - * specific settings by assigning a {@link yfiles.layout.EdgeBundleDescriptor} to it. A {@link yfiles.algorithms.IDataProvider} can be - * registered with the input graph with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY} to assign descriptors - * to edges. This allows, for example, to define which edges should actually be bundled. - *

- * @see yfiles.layout.EdgeBundleDescriptor - * @see yfiles.circular.CircularLayout#edgeBundling - * @class - */ - export interface EdgeBundling extends yfiles.lang.Object{} - export class EdgeBundling { - /** - * Creates a new {@link yfiles.layout.EdgeBundling} instance with the given {@link yfiles.layout.EdgeBundling#bundlingStrength bundling strength} and {@link yfiles.layout.EdgeBundling#bundlingQuality bundling quality}. - * @param bundlingStrength the bundling strength from the interval [0,1] - * @param bundlingQuality the bundling quality from the interval [0,1] - * @throws {Stubs.Exceptions.ArgumentError} if the given bundling strength or quality is not within [0,1] - */ - constructor(bundlingStrength:number,bundlingQuality:number); - /** - * Creates a new {@link yfiles.layout.EdgeBundling} instance with default settings. - */ - constructor(); - /** - * Data provider key for specifying individual bundling settings for edges - *

- * If no {@link yfiles.layout.EdgeBundleDescriptor} is mapped to an edge, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used by the layout algorithm to - * obtain the bundling setup of that edge. - *

- * @see yfiles.layout.EdgeBundling#defaultBundleDescriptor - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_BUNDLE_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the desired quality of the calculated edge bundling. - *

- * Higher quality indicates that the bundling procedure uses more sophisticated methods to compute the actual bundles and - * the routing of the edges. This may lead to a significantly higher running time, especially for large graphs. On the - * other hand, a low quality indicates that run-time is more important than highly optimized bundling results, leading to, - * for example, more crossings between different bundles. - *

- *

- * The quality is defined to lie within [0,1], where higher values stand for higher quality. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given quality value is not within [0,1] - * @type {number} - */ - bundlingQuality:number; - /** - * Gets or sets the strength of the edge bundling. - *

- * The strength controls how tightly the edges are bundled and influences the shape of the curves of bundled edges. Low - * values lead to only slightly bundled edges; results will mostly show individual node-to-node connectivity information. - * High values show the connectivity on a higher level, strongly bundling edges together and generating highly curved edge - * paths. - *

- *

- * The bundling strength is defined as a value from the interval [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given strength is less than 0 or greater than 1 - * @type {number} - */ - bundlingStrength:number; - /** - * Gets or sets the default {@link yfiles.layout.EdgeBundleDescriptor} used for all edges which do not have a specific descriptor - * assigned via a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. - * @throws {Stubs.Exceptions.ArgumentError} if the given descriptor is null - * @see yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.EdgeBundleDescriptor} - */ - defaultBundleDescriptor:yfiles.layout.EdgeBundleDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.EdgeBundling; - } - /** - * An {@link yfiles.layout.EdgeLabelCandidate} describes one valid placement for an edge label considering the label model. - * @class - * @extends {yfiles.layout.LabelCandidate} - */ - export interface EdgeLabelCandidate extends yfiles.layout.LabelCandidate{} - export class EdgeLabelCandidate { - /** - * Creates a new instance of {@link yfiles.layout.EdgeLabelCandidate} described by location, size, model parameter and internal - * flag. - * @param pos the location of the upper left corner of the candidate - * @param size the size of the candidate - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.IEdgeLabelLayout,internal?:boolean); - /** - * Creates a new instance of {@link yfiles.layout.EdgeLabelCandidate} described by its box, model parameter and internal flag. - * @param labelBox the box that specifies the candidate's size and position - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.IEdgeLabelLayout,internal?:boolean); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.EdgeLabelCandidate; - } - /** - * {@link yfiles.layout.EdgeLabelOrientationSupport} provides orientation and mirroring support for {@link yfiles.layout.ILayoutAlgorithm layout algorithms} with - * integrated edge labeling. - *

- * To calculate the position and orientation of edge labels whose placements are defined with the - * {@link yfiles.layout.PreferredPlacementDescriptor}, the {@link yfiles.layout.OrientationLayout} would need the direction of the - * associated edge. Since this direction is not available to the {@link yfiles.layout.OrientationLayout}, because it is a wrapper, - * the calculation must be done in the core layout algorithm itself with the help of the - * {@link yfiles.layout.EdgeLabelOrientationSupport}. - *

- *

- * Important: Since layout algorithms with integrated edge labeling cannot deal with ambiguous preferred placement - * descriptors (combinations of the same setting, e.g., source or target for the {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge}), {@link yfiles.layout.EdgeLabelOrientationSupport#preProcessLabel} - * removes combinations and replaces the original descriptor with a non-ambiguous one during the layout calculation. - *

- * @class - */ - export interface EdgeLabelOrientationSupport extends yfiles.lang.Object{} - export class EdgeLabelOrientationSupport { - /** - * Creates a new {@link yfiles.layout.EdgeLabelOrientationSupport} instance. - * @see yfiles.layout.OrientationLayout#considerEdgeLabels - */ - constructor(); - /** - * Creates and returns a non-ambiguous {@link yfiles.layout.PreferredPlacementDescriptor} of the given potentially ambiguous one. - *

- * The created descriptor will be one without any combinations of settings, e.g., source or target for the {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge}. - *

- * @param ambiguous an ambiguous {@link } - * @returns a non-ambiguous version of the given ambiguous {@link } - * @protected - */ - createNonAmbiguous(ambiguous:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.PreferredPlacementDescriptor; - /** - * Calculates the up vector of an edge label considering the preferred placement of the label as well as the direction of - * the edge segment the label is attached to. - * @param descriptor the data describing the preferred label orientation - * @param segmentDirection the direction the edge segment is pointing to - * @returns the up vector for the edge label that considers the preferred placement of the label as well as the direction of the - * edge segment the label is attached to - * @static - */ - static getEdgeLabelUpVector(descriptor:yfiles.layout.PreferredPlacementDescriptor,segmentDirection:yfiles.layout.Direction):yfiles.algorithms.YVector; - /** - * Calculates the up vector for a label whose right vector is rotated clockwise by the given angle. - *

- * The up vector starts in the lower-left corner of the label and points up. If the label is paraxial it is (0, -1). The - * right vector starts at the same point and points right. In a paraxial label it is (1, 0). - *

- * @param rightVectorAngle the angle in radians the right vector is rotated by - * @returns the up vector for a label whose right vector is rotated clockwise by the given angle - * @static - */ - static getLabelUpVector(rightVectorAngle:number):yfiles.algorithms.YVector; - /** - * Transforms a direction of the layout to the oriented layout direction. - * @param direction direction in the layout - * @param orientation the orientation of the layout - * @param mirrorMask the mask to determine whether or not the orientation is mirrored - * @returns the direction in the oriented layout - * @static - */ - static getOrientedDirection(direction:yfiles.layout.Direction,orientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):yfiles.layout.Direction; - /** - * Returns whether or not the orientation is mirrored. - * @param orientation the orientation of the layout - * @param mirrorMask the mask to determine whether or not the orientation is mirrored - * @returns true if the orientation is mirrored, false otherwise - * @static - */ - static isOrientationMirrored(orientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):boolean; - /** - * Marks the given port label for a non-port placement (fallback). - *

- * The given edge label's {@link yfiles.layout.PreferredPlacementDescriptor} will internally be changed such that its {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along edge} - * is either {@link yfiles.layout.LabelPlacements#AT_SOURCE} or {@link yfiles.layout.LabelPlacements#AT_TARGET}. - *

- *

- * Algorithms that are executed after this call and before {@link yfiles.layout.EdgeLabelOrientationSupport#resetAmbiguousLabelDescriptors} - * will handle port labels like normal source or target labels. - *

- * @param portLabel an edge label that had a {@link #AT_SOURCE_PORT} or {@link #AT_TARGET_PORT} - * placement preference - * @throws {Stubs.Exceptions.InvalidOperationError} if {@link yfiles.layout.EdgeLabelOrientationSupport#replaceAmbiguousLabelDescriptors} was never called for the graph containing - * the given label. - * @see yfiles.layout.LabelPlacements#AT_SOURCE_PORT - * @see yfiles.layout.LabelPlacements#AT_TARGET_PORT - */ - markPortLabelForFallbackPlacement(portLabel:yfiles.layout.LabelLayoutData):void; - /** - * Restores the original preferred placement and updates the label rotation according to the layout orientation. - *

- * The original {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor} that has been replaced in {@link yfiles.layout.EdgeLabelOrientationSupport#preProcessLabel} gets restored. Then it - * moves and rotates the {@link yfiles.layout.LabelLayoutData#bounds label box} in respect of the orientation. - *

- *

- * This method is called by the core layout algorithm with the integrated edge labeling for each edge label after the - * location of the label is determined. - *

- * @param graph the graph to get the orientation information from - * @param label the information about the edge label whose location is determined - */ - postProcessLabel(graph:yfiles.algorithms.Graph,label:yfiles.layout.LabelLayoutData):void; - /** - * Prepares the label for the core layout algorithm. - *

- * First, the {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor preferred placement} of the edge label is replaced by a non-ambiguous {@link yfiles.layout.PreferredPlacementDescriptor} - * that has only relative references. This descriptor is orientation independent and can be used in the core layout - * algorithm. Second, the method rotates the {@link yfiles.layout.LabelLayoutData#bounds label box} in respect of its {@link yfiles.layout.PreferredPlacementDescriptor} and the - * direction of the segment to which it belongs. After that call, the core layout algorithm can use the geometry ({@link yfiles.layout.LabelLayoutData#width} and - * {@link yfiles.layout.LabelLayoutData#height}) of the label to calculate its location. - *

- *

- * This method is called by the core layout algorithm with the integrated edge labeling for each edge label before the - * layout algorithm uses the geometry of labels. It should be called as soon as the direction of the segment the label - * belongs to is determined. - *

- * @param graph the graph to get the orientation information from - * @param label the information about the edge label whose segment direction is determined - * @param segmentDirection the direction of the segment the edge label belongs to - */ - preProcessLabel(graph:yfiles.algorithms.Graph,label:yfiles.layout.LabelLayoutData,segmentDirection:yfiles.layout.Direction):void; - /** - * Replaces the - * {@link yfiles.layout.PreferredPlacementDescriptor}s of all edge labels in the given graph with non-ambiguous descriptors. - *

- * The non-ambiguous descriptors are retrieved from the original descriptors. They describe only one of the possible - * placements. - *

- *

- * This method should be called by a layout algorithm at the beginning of the layout calculation to assure that the label's - * placement is handled consistently. - *

- * @param graph the input graph - */ - replaceAmbiguousLabelDescriptors(graph:yfiles.algorithms.Graph):void; - /** - * Restores the - * {@link yfiles.layout.PreferredPlacementDescriptor}s of all edge labels in the given graph with their original descriptors. - *

- * This method should be called by a layout algorithm at the end of the layout calculation to assure that the original - * state of the graph is not corrupted. - *

- * @param graph the input graph - */ - resetAmbiguousLabelDescriptors(graph:yfiles.algorithms.Graph):void; - /** - * Calculates and sets the up vector of an edge label considering the preferred placement of the label as well as the - * direction of the edge segment the label is attached to. - * @param label the data that describes the label orientation and is used for setting the new up vector - * @param segmentDirection the direction the edge segment is pointing to - * @see yfiles.layout.EdgeLabelOrientationSupport#getEdgeLabelUpVector - * @static - */ - static updateLabelOrientation(label:yfiles.layout.LabelLayoutData,segmentDirection:yfiles.layout.Direction):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.EdgeLabelOrientationSupport; - } - /** - * {@link yfiles.layout.FixNodeLayoutStage} fixes the initial position of either a single node or the alignment of the bounding box of - * several nodes (but not the positions of the individual nodes). - *

- * The absolute coordinates of the {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint fix point} are the same before and after invoking the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. However, the - * relative coordinates of the nodes are altered by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface FixNodeLayoutStage extends yfiles.layout.LayoutStageBase{} - export class FixNodeLayoutStage { - /** - * Creates a new {@link yfiles.layout.FixNodeLayoutStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Calculates the bounding box of the specified nodes. - *

- * The calculated bounds may contain {@link yfiles.layout.FixNodeLayoutStage#includingEdges edges} and/or {@link yfiles.layout.FixNodeLayoutStage#includingLabels labels}. - *

- *

- * This method is called by {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint} and may be overridden to customize the size - * of the bounds. - *

- * @param graph the graph associated with the specified nodes - * @param fixed the list of nodes for which to determine the bounding box - * @returns the bounding box of the specified nodes - * @see yfiles.layout.FixNodeLayoutStage#includingEdges - * @see yfiles.layout.FixNodeLayoutStage#includingLabels - * @see yfiles.layout.FixNodeLayoutStage#calculateFixPoint - * @protected - */ - calculateBounds(graph:yfiles.layout.LayoutGraph,fixed:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; - /** - * Calculates the fix point for the specified nodes in the specified graph. - *

- * The default implementation calls {@link yfiles.layout.FixNodeLayoutStage#calculateBounds} and - * {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint}. - *

- *

- * This method is called by {@link yfiles.layout.FixNodeLayoutStage#applyLayout} to determine the point that will have the same - * coordinates before and after invoking the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to introduce a custom policy for retrieving the fix point. - *

- * @param graph the graph associated with the specified nodes - * @param fixed the list of nodes for which a fix point has to be determined - * @returns the fix point for the specified nodes in the specified graph - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - * @see yfiles.layout.FixNodeLayoutStage#calculateBounds - * @see yfiles.layout.FixNodeLayoutStage#calculateFixPoint - * @protected - */ - calculateFixPoint(graph:yfiles.layout.LayoutGraph,fixed:yfiles.algorithms.NodeList):yfiles.algorithms.YPoint; - /** - * Calculates the fix point of the specified rectangle according to the policy returned by {@link yfiles.layout.FixNodeLayoutStage#fixPointPolicy}. - *

- * If the specified rectangle is null or the rectangle has negative width or negative height then null will be returned. - *

- *

- * This method is called by - * {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint}. It may be overridden to introduce a custom policy for retrieving the - * fix point. - *

- * @param bounds the rectangle for which to determine the fix point - * @returns the fix point of the specified rectangle or null if nothing should be fixed - * @throws {Stubs.Exceptions.ArgumentError} if the current fix point policy is invalid - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - * @protected - */ - calculateFixPoint(bounds:yfiles.algorithms.Rectangle2D):yfiles.algorithms.YPoint; - /** - * Data provider key for determining the nodes that should be considered fixed - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the fix point calculation policy used in {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint} to determine - * which point in the corresponding rectangle should be considered fixed. - * @throws {Stubs.Exceptions.ArgumentError} if the specified policy is unknown - * @type {yfiles.layout.FixPointPolicy} - */ - fixPointPolicy:yfiles.layout.FixPointPolicy; - /** - * Gets or sets whether or not subgraph edges are taken into account when calculating the bounding box of the fixed nodes. - * @see yfiles.layout.FixNodeLayoutStage#calculateBounds - * @type {boolean} - */ - includingEdges:boolean; - /** - * Gets or sets whether or not label geometries are taken into account when calculating the bounding box of the fixed - * nodes. - * @see yfiles.layout.FixNodeLayoutStage#calculateBounds - * @type {boolean} - */ - includingLabels:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixNodeLayoutStage; - } - /** - * {@link yfiles.layout.FixPortLocationStage} ensures that layout algorithms that cannot handle port constraints keep the ports of - * edges with strong {@link yfiles.layout.PortConstraint}s. - *

- * Without this stage, the port locations get lost. - *

- *

- * For each edge with strong {@link yfiles.layout.PortConstraint}s, this stage simply stores the original port and restores it - * after applying the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. Therefore, it either replaces the source/target port by the original port or - * adds the original port to the edge path calculated by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} (see method {@link yfiles.layout.FixPortLocationStage#keepCalculatedPorts}). - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface FixPortLocationStage extends yfiles.layout.LayoutStageBase{} - export class FixPortLocationStage { - /** - * Creates a new {@link yfiles.layout.FixPortLocationStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets whether or not the final edge routes should contain the ports calculated by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * If this option is disabled, this stage simply replaces the current source/target ports (calculated by the core layout - * algorithm) by the original ports (for strong ports only). Otherwise, the calculated ports are still contained in the - * edge paths. - *

- * @type {boolean} - */ - keepCalculatedPorts:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixPortLocationStage; - } - /** - * This model parameter encodes a label position within {@link yfiles.layout.FreeEdgeLabelLayoutModel}. - *

- * It represents every possible location in relation to the source point of the edge. The radius describes the distance of - * the label center from the source point. There is an angle theta which defines the location on the circle with the given - * radius. It is the angle between the first segment of the underlying edge and the imaginary line to the center of the - * label. Finally, there is a second angle that describes the rotation of the label box. - *

- * @see yfiles.layout.FreeEdgeLabelLayoutModelParameter#setPoint - * @see yfiles.layout.FreeEdgeLabelLayoutModelParameter#angle - * @class - */ - export interface FreeEdgeLabelLayoutModelParameter extends yfiles.lang.Object{} - export class FreeEdgeLabelLayoutModelParameter { - /** - * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModelParameter} with the given radius, angle and rotation - * angle. - * @param radius the distance of the label from the source node of the underlying edge - * @param theta the angle in radians between the first segment of the underlying edge and the imaginary line to the center of the label - * @param [angle=0] the rotation angle of the label - */ - constructor(radius:number,theta:number,angle?:number); - /** - * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModelParameter} with radius 50 and angle 0. - */ - constructor(); - /** - * Specifies a point that represents the location of the label's center in relation to the source point of the edge. - *

- * The x-coordinate corresponds to the radius which describes the distance of the label to the source point. The - * y-coordinate corresponds to the angle between the first segment of the underlying edge and the imaginary line to the - * center of the label. - *

- * @param radius the distance to the source point - * @param theta the location on the radius - */ - setPoint(radius:number,theta:number):void; - /** - * Gets or sets the rotation angle of the label that is placed using this model parameter. - * @type {number} - */ - angle:number; - /** - * Gets a point that represents the location of the label's center in relation to the source point of the edge. - *

- * The x-coordinate corresponds to the radius which describes the distance of the label to the source point. The - * y-coordinate corresponds to the angle between the first segment of the underlying edge and the imaginary line to the - * center of the label. - *

- * @type {yfiles.algorithms.YPoint} - */ - point:yfiles.algorithms.YPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FreeEdgeLabelLayoutModelParameter; - } - /** - * {@link yfiles.layout.FreeEdgeLabelLayoutModel} allows placing edge labels at any location. - * @class - * @implements {yfiles.layout.IEdgeLabelLayoutModel} - */ - export interface FreeEdgeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.IEdgeLabelLayoutModel{} - export class FreeEdgeLabelLayoutModel { - /** - * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModel}. - */ - constructor(); - /** - * Creates a model parameter that represents the given edge label position within this model. - *

- * The created model parameter represents the current location of the given label. - *

- *

- * This parameter can be passed to {@link yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement} to retrieve the current label - * box. - *

- * @param labelBounds the oriented box of the label the parameter represents - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns the model parameter representing the given label location - * @throws {Stubs.Exceptions.ArgumentError} if one or more of the given bounds' values are invalid, i.e., NaN - * @see yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):any; - /** - * Returns the {@link yfiles.layout.EdgeLabelCandidate} that describes the current label position. - * @param labelLayout the label for which candidates should be generated - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns a list of {@link } instances - */ - getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @param param - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets the model parameter that encodes the default position of {@link yfiles.layout.FreeEdgeLabelLayoutModel}. - *

- * The distance of the label to the edge's source point will be 20. The angle between the line to the center of the label - * and the first segment is 20 radians. The label is not rotated. - *

- *

- * This parameter can be passed to {@link yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FreeEdgeLabelLayoutModel; - } - /** - * The model parameter that encodes a label position within {@link yfiles.layout.FreeNodeLabelLayoutModel}. - *

- * It represents every possible location in relation to the node. The point describes the offset of the label's center to - * the upper-left corner of the node. - *

- * @see yfiles.layout.FreeNodeLabelLayoutModelParameter#setPoint - * @class - */ - export interface FreeNodeLabelLayoutModelParameter extends yfiles.lang.Object{} - export class FreeNodeLabelLayoutModelParameter { - /** - * Creates a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModelParameter} with the given offset. - * @param dx the horizontal offset - * @param dy the vertical offset - */ - constructor(dx:number,dy:number); - /** - * Creates a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModelParameter}. - *

- * It has no offset, i.e., the upper-left corners of both node label and node are at the same location. - *

- */ - constructor(); - /** - * Specifies the offset of the label's center to the upper-left corner of the node. - * @param dx the horizontal offset - * @param dy the vertical offset - */ - setPoint(dx:number,dy:number):void; - /** - * Gets the offset of the label's center to the upper-left corner of the node. - * @type {yfiles.algorithms.YPoint} - */ - point:yfiles.algorithms.YPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FreeNodeLabelLayoutModelParameter; - } - /** - * {@link yfiles.layout.FreeNodeLabelLayoutModel} allows placing node labels at any desired position. - *

- * The location of the label does not need to satisfy any constraints. The {@link yfiles.layout.FreeNodeLabelLayoutModel#createModelParameter model parameter} describes a fixed offset between - * the upper-left corner of the node and the center of the label. - *

- * @class - * @implements {yfiles.layout.INodeLabelLayoutModel} - */ - export interface FreeNodeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.INodeLabelLayoutModel{} - export class FreeNodeLabelLayoutModel { - /** - * Returns a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModel}. - */ - constructor(); - /** - * Creates a model parameter that represents the given node label position within this model. - *

- * The created model parameter represents the current location of the given label. - *

- *

- * This parameter can be passed to {@link yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement} to retrieve the current label - * box. - *

- * @param labelBounds the bounds of the label the parameter represents - * @param nodeLayout the layout of the node to which the label belongs - * @returns the model parameter - * @throws {Stubs.Exceptions.ArgumentError} if one or more of the given bounds' values are invalid, i.e., NaN - * @see yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):any; - /** - * Returns the {@link yfiles.layout.NodeLabelCandidate} that describes the current label position. - * @param labelLayout the label for which candidates should be generated - * @param nodeLayout the layout of the node to which the label belongs - * @returns a list of {@link } instances - */ - getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param nodeLayout - * @param param - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets a model parameter that encodes the default position of {@link yfiles.layout.INodeLabelLayoutModel}. - *

- * The node label's upper-left corner is placed 20 pixels to the left and 20 pixels above the node. - *

- *

- * This parameter can be passed to {@link yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FreeNodeLabelLayoutModel; - } - export enum ComponentArrangementStyles{ - /** - * Style specifier describing no special component arrangement at all. Components will be centered at the same position - * they resided at before the layout started. If combined with the style modifier - * {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_NO_OVERLAP}, components might get moved so that they don't overlap - * after the layout. - * @see yfiles.layout.ComponentLayout#style - */ - NONE, - /** - * Style specifier describing a component arrangement strategy that places components in multiple rows so that the overall - * aspect ratio of the whole graph gets as close to the aspect ratio of the preferred layout size as possible. - * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - ROWS, - /** - * Style specifier describing a component arrangement strategy that places all components next to each other in a single - * row. If combined with the style modifier - * {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_AS_IS}, components will be placed in the same order as they were placed - * before the layout. - * @see yfiles.layout.ComponentLayout#style - */ - SINGLE_ROW, - /** - * Style specifier describing a component arrangement strategy that places components above each other in a single column. - * If combined with the style modifier - * {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_AS_IS}, components will be placed in the same order as they were placed - * before the layout. - * @see yfiles.layout.ComponentLayout#style - */ - SINGLE_COLUMN, - /** - * Style specifier describing a component arrangement strategy that places components in a rectangular cloud around the - * biggest component. Entities of different components will not overlap, however the bounding boxes of the components may - * overlap. - *

- * The aspect ratio of the rectangle is defined by the {@link yfiles.layout.ComponentLayout#preferredSize preferred size} of the graph. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - PACKED_RECTANGLE, - /** - * Style specifier describing a component arrangement strategy that places components in a rectangular cloud around the - * biggest component. Entities of different components will not overlap, however the bounding boxes of the components may - * overlap. - *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, components might even be placed in empty spaces inside other - * components. - *

- *

- * The aspect ratio of the rectangle is defined by the {@link yfiles.layout.ComponentLayout#preferredSize preferred size} of the graph. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - PACKED_COMPACT_RECTANGLE, - /** - * Style specifier describing a component arrangement strategy that places components in a circular cloud around the - * biggest component. Entities of different components will not overlap, however the bounding boxes of the components may - * overlap. - * @see yfiles.layout.ComponentLayout#style - */ - PACKED_CIRCLE, - /** - * Style specifier describing a component arrangement strategy that places components in a circular compact cloud around - * the biggest component. Entities of different components will not overlap, however the bounding boxes of the components - * may overlap. - *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE}, components might even be placed in empty spaces inside other - * components. - *

- * @see yfiles.layout.ComponentLayout#style - */ - PACKED_COMPACT_CIRCLE, - /** - * Style specifier describing a component arrangement strategy that places components in multiple rows. - *

- * The strategy tries to arrange the components such that the aspect ratio of the final component placement gets as close - * as possible to the aspect ratio of the preferred layout size, configurable using {@link yfiles.layout.ComponentLayout#preferredSize}. - *

- *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#ROWS}, each row may also be divided into further sub-rows, which is especially - * useful if there are few very large components and many significantly smaller ones. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS, - /** - * Style specifier describing a component arrangement strategy that places components in multiple rows. - *

- * The strategy tries to arrange the components such that the aspect ratio of the final component placement gets close to - * the aspect ratio of the preferred layout size, configurable using {@link yfiles.layout.ComponentLayout#preferredSize}. But in contrast to - * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS}, this strategy does not always try to come as close to the preferred - * view ratio, if a ratio close to the preferred ratio only induces a lot of unused view space. This unused space will be - * minimized. - *

- *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#ROWS}, each row may also be divided into further sub-rows, which is especially - * useful if there are few very large components and many significantly smaller ones. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_COMPACT, - /** - * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} - * with a restricted height. The resulting height does not exceed the preferred height ({@link yfiles.layout.ComponentLayout#preferredSize}). - *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT_COMPACT}, the result will be an arrangement which - * uses as much height as possible, even if that means that all components will be arranged in one single column. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_HEIGHT_CONSTRAINT, - /** - * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} - * with a restricted height and as compact as possible. The resulting height does not exceed the preferred height ({@link yfiles.layout.ComponentLayout#preferredSize}). - *

- * In comparison with - * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT}, the result will be compacted, which means that an - * arrangement with the minimum width such that the height constraint is still fulfilled will be realized. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_HEIGHT_CONSTRAINT_COMPACT, - /** - * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} - * with a restricted width. The resulting width does not exceed the preferred width ({@link yfiles.layout.ComponentLayout#preferredSize}). - *

- * In contrast to {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_WIDTH_CONSTRAINT_COMPACT} the result will be an - * arrangement which uses as much space in width as possible, even if that means that all components will be arranged in a - * single row. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_WIDTH_CONSTRAINT, - /** - * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} - * with a restricted width and as compact as possible. The resulting width does not exceed the preferred width ({@link yfiles.layout.ComponentLayout#preferredSize}). - *

- * In comparison with {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT} the result will be compacted, - * in order to minimize unused view space induced by components that are large in height. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_WIDTH_CONSTRAINT_COMPACT, - /** - * A constant for masking actual style constants from style modifiers. - * @see yfiles.layout.ComponentLayout#style - */ - MASK, - /** - * A modifier that can be added to normal style specifiers to indicate that the arrangement strategy should take the - * initial positions of the components into account. - *

- * Combining this modifier is supported with the following styles: {@link yfiles.layout.ComponentArrangementStyles#SINGLE_ROW}, - * {@link yfiles.layout.ComponentArrangementStyles#SINGLE_COLUMN}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_RECTANGLE}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE} - * and {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_CIRCLE}. - *

- * @see yfiles.layout.ComponentLayout#style - */ - MODIFIER_AS_IS, - /** - * A modifier that can be added to normal style specifiers to indicate that the arrangement strategy should produce a - * non-overlapping component layout. - *

- * Combining this modifier is not supported with {@link yfiles.layout.ComponentArrangementStyles#NONE}. - *

- * @see yfiles.layout.ComponentLayout#style - */ - MODIFIER_NO_OVERLAP - } - export enum DiscreteEdgeLabelPositions{ - /** - * Position specifier that describes a label placement near the source, left/above the edge's path. - */ - SOURCE_HEAD, - /** - * Position specifier that describes a label placement near the middle of the edge, left/above the edge's path. - */ - HEAD, - /** - * Position specifier that describes a label placement near the target, left/above the edge's path. - */ - TARGET_HEAD, - /** - * Position specifier that describes a label placement near the source, right/below the edge's path. - */ - SOURCE_TAIL, - /** - * Position specifier that describes a label placement near the middle of the edge, right/below the edge's path. - */ - TAIL, - /** - * Position specifier that describes a label placement near the target, right/below the edge's path. - */ - TARGET_TAIL, - /** - * Position specifier that describes a label placement near the source, directly on the edge's path. - */ - SOURCE_CENTER, - /** - * Position specifier that describes a label placement near the middle of the edge, directly on the edge's path. - */ - CENTER, - /** - * Position specifier that describes a label placement near the target, directly on the edge's path. - */ - TARGET_CENTER, - /** - * Position mask that constrains the allowed positions to the two locations near the middle of the edge beside the edge's - * path. - * @see yfiles.layout.DiscreteEdgeLabelPositions#HEAD - * @see yfiles.layout.DiscreteEdgeLabelPositions#TAIL - */ - TWO_POS, - /** - * Position mask that constrains the allowed positions to the {@link yfiles.layout.DiscreteEdgeLabelPositions#CENTER} of the edge's - * path. - * @see yfiles.layout.DiscreteEdgeLabelPositions#CENTER - */ - CENTERED, - /** - * Position mask that constrains the allowed positions to a set of six positions beside the edge path. - *

- * Two of the positions are near the source and two others are near the target. The remaining positions are in the middle - * of the edge. - *

- * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_HEAD - * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_TAIL - * @see yfiles.layout.DiscreteEdgeLabelPositions#HEAD - * @see yfiles.layout.DiscreteEdgeLabelPositions#TAIL - * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_HEAD - * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_TAIL - */ - SIX_POS, - /** - * Position mask that constrains the allowed positions to a set of three positions directly on the edge's path. - * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_CENTER - * @see yfiles.layout.DiscreteEdgeLabelPositions#CENTER - * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_CENTER - */ - THREE_CENTER - } - export enum DiscreteNodeLabelPositions{ - /** - * Position specifier that describes a label placement north of the node. - */ - NORTH, - /** - * Position specifier that describes a label placement north-west of the node. - */ - NORTH_WEST, - /** - * Position specifier that describes a label placement north-east of the node. - */ - NORTH_EAST, - /** - * Position specifier that describes a label placement east of the node. - */ - EAST, - /** - * Position specifier that describes a label placement west of the node. - */ - WEST, - /** - * Position specifier that describes a label placement south of the node. - */ - SOUTH, - /** - * Position specifier that describes a label placement south-west of the node. - */ - SOUTH_WEST, - /** - * Position specifier that describes a label placement south-east of the node. - */ - SOUTH_EAST, - /** - * Position specifier that describes a label placement at the center of the node. - */ - CENTER, - /** - * Position specifier that describes a label placement at the bottom inside the node. - */ - BOTTOM, - /** - * Position specifier that describes a label placement at the top inside the node. - */ - TOP, - /** - * Position specifier that describes a label placement at the left inside the node. - */ - LEFT, - /** - * Position specifier that describes a label placement at the right inside the node. - */ - RIGHT, - /** - * Position specifier that describes a label placement at the top-left inside the node. - */ - TOP_LEFT, - /** - * Position specifier that describes a label placement at the top-right inside the node. - */ - TOP_RIGHT, - /** - * Position specifier that describes a label placement at the bottom-left inside the node. - */ - BOTTOM_LEFT, - /** - * Position specifier that describes a label placement at the bottom-right inside the node. - */ - BOTTOM_RIGHT, - /** - * Position mask that constrains the positions to {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH above} and {@link yfiles.layout.DiscreteNodeLabelPositions#SOUTH below} the node. - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH - */ - SANDWICH_MASK, - /** - * Position mask that constrains the positions to the nine node-internal positions. - * @see yfiles.layout.DiscreteNodeLabelPositions#CENTER - * @see yfiles.layout.DiscreteNodeLabelPositions#TOP - * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM - * @see yfiles.layout.DiscreteNodeLabelPositions#LEFT - * @see yfiles.layout.DiscreteNodeLabelPositions#RIGHT - * @see yfiles.layout.DiscreteNodeLabelPositions#TOP_LEFT - * @see yfiles.layout.DiscreteNodeLabelPositions#TOP_RIGHT - * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM_LEFT - * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM_RIGHT - */ - INTERNAL_MASK, - /** - * Position mask that constrains the positions to the node's four sides. - * @see yfiles.layout.DiscreteNodeLabelPositions#EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#WEST - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH - */ - SIDES_MASK, - /** - * Position mask that constrains the positions to the corners outside the node. - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_WEST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_WEST - */ - CORNER_MASK, - /** - * Position mask that constraints the positions to the eight node-external positions. - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH - * @see yfiles.layout.DiscreteNodeLabelPositions#EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH - * @see yfiles.layout.DiscreteNodeLabelPositions#WEST - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_WEST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_WEST - */ - EIGHT_POS_MASK - } - export enum FixPointPolicy{ - /** - * Fix point calculation policy specifying that the center of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - CENTER, - /** - * Fix point calculation policy specifying that the upper left corner of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - UPPER_LEFT, - /** - * Fix point calculation policy specifying that the upper right corner of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - UPPER_RIGHT, - /** - * Fix point calculation policy specifying that the lower right corner of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - LOWER_RIGHT, - /** - * Fix point calculation policy specifying that the lower left corner of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - LOWER_LEFT - } - export enum LabelPlacements{ - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed near the source node of an - * edge. - */ - AT_SOURCE, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed near the target node of an - * edge. - */ - AT_TARGET, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed near the center of the - * edge path. - */ - AT_CENTER, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed directly at the source - * port of the edge. - */ - AT_SOURCE_PORT, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed directly at the target - * port of the edge. - */ - AT_TARGET_PORT, - /** - * Placement specifier mask that masks all placement specifiers that describe the placement along the edge. - */ - ALONG_EDGE_MASK, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed on the path of the edge. - */ - ON_EDGE, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed on the left hand side of - * the edge path. - *

- * The side is interpreted relative to the direction of the edge, if no different {@link yfiles.layout.PreferredPlacementDescriptor#sideReference side reference} is defined. - *

- */ - LEFT_OF_EDGE, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed on the right hand side of - * the edge path. - *

- * The side is interpreted relative to the direction of the edge, if no different {@link yfiles.layout.PreferredPlacementDescriptor#sideReference side reference} is defined. - *

- */ - RIGHT_OF_EDGE, - /** - * Placement specifier mask that masks all placement specifiers that describe the side of the edge. - */ - ON_SIDE_OF_EDGE_MASK, - /** - * Preferred placement specifier for edge labels which expresses that the label can be placed anywhere along the edge or on - * any side of the edge. - */ - ANYWHERE - } - export enum LayoutOrientation{ - /** - * Orientation specifier which defines that the main layout orientation is from top to bottom. This is the default for all - * layout algorithms. - */ - TOP_TO_BOTTOM, - /** - * Orientation specifier which defines that the main layout orientation is from left to right. The layout will be rotated - * by 90 degrees counterclockwise. - */ - LEFT_TO_RIGHT, - /** - * Orientation specifier which defines that the main layout orientation is from right to left. The layout will be rotated - * by 90 degrees clockwise. - */ - RIGHT_TO_LEFT, - /** - * Orientation specifier which defines that the main layout orientation is from bottom to top. The layout will be flipped - * along the x-axis. - */ - BOTTOM_TO_TOP - } - export enum RowAlignment{ - /** - * Row alignment specifier which defines that each row will be aligned with its left border. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - */ - LEADING, - /** - * Row alignment specifier which defines that each row will be aligned with its right border. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - */ - TRAILING, - /** - * Row alignment specifier which defines that each row will be aligned with its left border and its right border. - *

- * Rectangles in smaller rows will be distributed over the row, so that the row aligns with both sides. - *

- * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - */ - JUSTIFIED, - /** - * Row alignment specifier which defines that each row will be aligned with its center. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - */ - CENTER - } - export enum MultiRowConstraint{ - /** - * Constraint specifier for a multi-row rectangle arrangement that is unconstrained. Both, height and width, are not - * limited in size. The rectangles will be arranged in a way that the view ratio defined by the preferred height and width - * will be achieved. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - */ - NONE, - /** - * Constraint specifier for a multi-row rectangle arrangement that constrains the height of the layout. Limits the height - * of the arrangement to the given preferred height value. If some rectangles are higher than allowed, then they are placed - * nevertheless, but the constraint will still be considered for the rest and not weakened to the height of the higher - * rectangles. Having one rectangle being higher than the constraint does always result in arrangements consisting only of - * a single top-level row. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - */ - HEIGHT, - /** - * Constraint specifier for a multi-row rectangle arrangement that constrains the width of the layout. Limits the width of - * the arrangement to the given preferred width value. If a rectangle is wider than allowed, then it will nevertheless be - * placed (in a row containing the rectangle alone), but the constraint will be still considered for other rows and not - * weakened. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - */ - WIDTH - } - export enum EdgeFlow{ - /** - * Edge flow specifier which defines that the flow direction of most edges is up. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - UP, - /** - * Edge flow specifier which defines that the flow direction of most edges is down. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - DOWN, - /** - * Edge flow specifier which defines that the flow direction of most edges is left. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - LEFT, - /** - * Edge flow specifier which defines that the flow direction of most edges is right. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - RIGHT, - /** - * Edge flow specifier that defines that there is no main flow direction. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - NONE - } - export enum NodeAlignment{ - /** - * Node alignment policy that results in top-aligned nodes for vertical alignment and left-aligned nodes for horizontal - * alignments. - * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts - */ - LEADING, - /** - * Node alignment policy that results in center-aligned nodes. - * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts - */ - CENTERED, - /** - * Node alignment policy that results in bottom-aligned nodes for vertical alignment and right-aligned nodes for horizontal - * alignments. - * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts - */ - TRAILING, - /** - * Node alignment policy that results in vertically or horizontally distributed nodes. In this context, distributed means that the - * vertical (or horizontal) extensions of nodes do not overlap, independent of their horizontal (or vertical) position. - * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts - */ - DISTRIBUTED - } - export enum MirrorModes{ - /** - * Mirroring specifier that can be used for preventing any mirroring of layout orientations. - * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - NONE, - /** - * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} will be - * mirrored. - *

- * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their - * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. - *

- * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - TOP_TO_BOTTOM, - /** - * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT} will be - * mirrored. - *

- * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their - * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. - *

- * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - RIGHT_TO_LEFT, - /** - * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#BOTTOM_TO_TOP} will be - * mirrored. - *

- * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their - * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. - *

- * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - BOTTOM_TO_TOP, - /** - * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} will be - * mirrored. - *

- * This specifier can be used to create a mirror mask that defines which layout orientations shall be mirrored at their - * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. - *

- * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - LEFT_TO_RIGHT - } - export enum PortDirections{ - /** - * A port direction specifier indicating a port on the north (i.e., top) side of a node. - */ - NORTH, - /** - * A port direction specifier indicating a port on the east (i.e., right) side of a node. - */ - EAST, - /** - * A port direction specifier indicating a port on the west (i.e., left) side of a node. - */ - WEST, - /** - * A port direction specifier indicating a port on the south (i.e., bottom) side of a node. - */ - SOUTH, - /** - * A port direction specifier indicating a port lying in the direction of the main flow of the edge or of the overall - * layout. - *

- * The exact direction is domain-specific. - *

- */ - WITH_THE_FLOW, - /** - * A port direction specifier indicating a port lying in the opposite direction of the main flow of the edge or of the - * overall layout. - *

- * The exact direction is domain-specific. - *

- */ - AGAINST_THE_FLOW, - /** - * A port direction specifier indicating a port lying left of the direction of the main flow of the edge or of the overall - * layout. - *

- * The exact direction is domain-specific. - *

- */ - LEFT_IN_FLOW, - /** - * A port direction specifier indicating a port lying right of the direction of the main flow of the edge or of the overall - * layout. - *

- * The exact direction is domain-specific. - *

- */ - RIGHT_IN_FLOW, - /** - * A combination of all possible direction specifiers indicating that edges can connect to any side of a node. - */ - ANY - } - export enum PortSide{ - /** - * A weak constraint indicating that edges can connect to any side of a node. - * @see yfiles.layout.PortConstraint#create - */ - ANY, - /** - * A weak constraint indicating that edges can connect to the north side (i.e. top side) of a node. - * @see yfiles.layout.PortConstraint#create - */ - NORTH, - /** - * A weak constraint indicating that edges can connect to the south side (i.e. bottom side) of a node. - * @see yfiles.layout.PortConstraint#create - */ - SOUTH, - /** - * A weak constraint indicating that edges can connect to the east side (i.e. right side) of a node. - * @see yfiles.layout.PortConstraint#create - */ - EAST, - /** - * A weak constraint indicating that edges can connect to the west side (i.e. left side) of a node. - * @see yfiles.layout.PortConstraint#create - */ - WEST - } - export enum LabelSideReferences{ - /** - * Side placement specifier for edge labels which expresses that the preferred side of the edge is interpreted relative to - * the edge flow. - * @see yfiles.layout.PreferredPlacementDescriptor#sideReference - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - RELATIVE_TO_EDGE_FLOW, - /** - * Side placement specifier for edge labels which defines that the preferred side for the label is interpreted - * independently of the edge direction placing {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left labels} above horizontal segments. - *

- * For vertical segments the label is placed {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left} or {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE right} of the edge. In case the segment is horizontal, the label is - * placed above the segment if it should be left of the edge, otherwise below the segment. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#sideReference - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - ABSOLUTE_WITH_LEFT_IN_NORTH, - /** - * Side placement specifier for edge labels which defines that the preferred side for the label is interpreted - * independently of the edge direction placing {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE left labels} above horizontal segments. - *

- * For vertical segments the label is placed {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left} or {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE right} of the edge. In case the segment is horizontal, the label is - * placed above the segment if it should be right of the edge, otherwise below the segment. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#sideReference - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - ABSOLUTE_WITH_RIGHT_IN_NORTH - } - export enum LabelAngleReferences{ - /** - * Angle interpretation specifier for edge labels which expresses that the rotation angle should be interpreted absolute - * and not relative to the edge slope. - * @see yfiles.layout.PreferredPlacementDescriptor#angleReference - * @see yfiles.layout.PreferredPlacementDescriptor#angle - */ - ABSOLUTE, - /** - * Angle interpretation specifier for edge labels which expresses that the rotation angle should be interpreted relative to - * the edge slope. - * @see yfiles.layout.PreferredPlacementDescriptor#angleReference - * @see yfiles.layout.PreferredPlacementDescriptor#angle - */ - RELATIVE_TO_EDGE_FLOW - } - export enum LabelAngleOnRightSideRotations{ - /** - * Angle interpretation specifier which expresses that the rotation angle should be interpreted clockwise. - *

- * Therefore, edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} will be co-rotating with the angle of labels that are placed left of or - * centered on the edge. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angle - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - CLOCKWISE, - /** - * Angle interpretation specifier which expresses that the rotation angle should be interpreted counter-clockwise. - *

- * Therefore, edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} will be counter-rotating with the angle of labels that are placed left of or - * centered on the edge. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angle - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - COUNTER_CLOCKWISE - } - export enum LabelAngleOnRightSideOffsets{ - /** - * Angle offset specifier for edge labels which expresses that no additional offset should be added to the angle. - * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angle - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - NONE, - /** - * Angle offset specifier for edge labels which expresses that an additional offset of 180 degrees should be added to the - * angle. That way, point-symmetric label placements left and right of the edge can be attained. - * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angle - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - SEMI - } - export enum SliderMode{ - /** - * Slider mode specifier which describes continuous label positions directly on the edge path. - * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - */ - CENTER, - /** - * Slider mode specifier which describes continuous label positions along the sides of the edge path. - * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - */ - SIDE, - /** - * Slider mode specifier which describes continuous label positions along one side of the edge path. - * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - */ - SINGLE_SIDE - } - export enum SelfLoopStyle{ - /** - * Self-loop style specifier which defines that the routes of self-loops are orthogonal. - *

- * The routes consist of an alternating sequence of horizontal and vertical line segments. - *

- * @see yfiles.layout.SelfLoopRouter#layoutStyle - */ - ORTHOGONAL, - /** - * Self-loop style specifier which defines that the routes of self-loops are rounded. - *

- * The {@link yfiles.layout.SelfLoopRouter#lineDistance distance between incident self-loops} and {@link yfiles.layout.SelfLoopRouter#cornerApproximationPointsCount rounding of the corners} can be customized for rounded self-loops. - *

- * @see yfiles.layout.SelfLoopRouter#layoutStyle - * @see yfiles.layout.SelfLoopRouter#lineDistance - * @see yfiles.layout.SelfLoopRouter#cornerApproximationPointsCount - */ - ROUNDED - } - export enum SwimlanesMode{ - /** - * Swimlane ordering mode specifier defining that node grouping is ignored during the swimlane ordering optimization. - * @see yfiles.layout.Swimlanes#arrangeSwimlanes - */ - IGNORE_GROUPS, - /** - * Swimlane ordering mode specifier defining that only node grouping is considered during the swimlane ordering - * optimization. - * @see yfiles.layout.Swimlanes#arrangeSwimlanes - */ - ONLY_GROUPS, - /** - * Swimlane ordering mode specifier defining that both node grouping and edge length are considered during the swimlane - * ordering optimization. - * @see yfiles.layout.Swimlanes#arrangeSwimlanes - */ - MIXED - } - /** - * {@link yfiles.layout.GraphLayoutLineWrapper} can line-wrap or column-wrap a graph layout. - *

- * This {@link yfiles.layout.ILayoutStage} supports both wrapping a layout at a given width (height) and wrapping a layout - * automatically at some width (height) such that the resulting overall aspect ratio is close to a desired {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio target ratio}. - *

- *

- * The {@link yfiles.layout.GraphLayoutLineWrapper} can be used on an existing graph layout or on the result of the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface GraphLayoutLineWrapper extends yfiles.layout.LayoutStageBase{} - export class GraphLayoutLineWrapper { - /** - * Creates a new {@link yfiles.layout.GraphLayoutLineWrapper} instance with default settings. - */ - constructor(); - /** - * Gets or sets the space that should be kept between edges. - *

- * The spacing must be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is a negative value - * @type {number} - */ - edgeSpacing:number; - /** - * Gets or sets whether this {@link yfiles.layout.ILayoutStage} wraps lines/rows or columns. - *

- * If this mode is enabled, the layout is wrapped vertically and new columns are appended to the right of the first column. - * Otherwise, the layout is wrapped horizontally and new rows are appended below the first row. - *

- *

- * Also, the {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth} property will be interpreted as a fixed height if this mode is enabled. - *

- * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidth - * @type {boolean} - */ - columnMode:boolean; - /** - * Gets or sets the space between adjacent lines of the wrapped graph layout. - *

- * If the {@link yfiles.layout.GraphLayoutLineWrapper#columnMode column mode} is enabled, this spacing defines the distance between adjacent columns. - *

- *

- * The spacing should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative - * @type {number} - */ - spacing:number; - /** - * Gets or sets whether or not every other line is mirrored. - *

- * When breaking a line and placing the remaining line below, this remainder can be rotated by 180 degrees. Then, the edges - * connecting both lines - * stay short. In case the remainder is not rotated, the edges are routed between the two lines to connect to the front of the - * non-mirrored line. - *

- * @type {boolean} - */ - mirror:boolean; - /** - * Gets or sets whether the algorithm should use the {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth fixed width} or {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio target aspect ratio} to determine line breaks. - * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidth - * @see yfiles.layout.GraphLayoutLineWrapper#targetRatio - * @type {boolean} - */ - fixedWidthLineBreaks:boolean; - /** - * Gets or sets the desired target aspect ratio for the layout. - *

- * The aspect ratio needs to be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the target ratio is 0 or less - * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks - * @type {number} - */ - targetRatio:number; - /** - * Gets or sets the desired width of the lines. - *

- * The {@link yfiles.layout.GraphLayoutLineWrapper} breaks the lines at the specified width. - *

- *

- * In {@link yfiles.layout.GraphLayoutLineWrapper#columnMode column mode}, the fixed width is interpreted as fixed height for a column. - *

- * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks - * @see yfiles.layout.GraphLayoutLineWrapper#columnMode - * @type {number} - */ - fixedWidth:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.GraphLayoutLineWrapper; - } - /** - * This class represents a column of a {@link yfiles.layout.PartitionGrid partition grid} structure. - *

- * The results of the calculation of the geometry of the column will be placed into the instances of this class after the - * layout. - *

- * @see yfiles.layout.PartitionGrid - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface ColumnDescriptor extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class ColumnDescriptor { - /** - * Compares this {@link yfiles.layout.ColumnDescriptor} instance with a given other {@link yfiles.layout.ColumnDescriptor} instance based - * on the indices of the two instances. - * @param o the {@link } to compare to - * @returns -1, 0 or 1 if this {@link } is less than, equal to, or greater than the given other - * {@link } - */ - compareTo(o:any):number; - /** - * Gets the index of the column within the {@link yfiles.layout.PartitionGrid partition grid}. - * @type {number} - */ - index:number; - /** - * Gets or sets the minimum width of the column. - *

- * The minimum width is defined to be at least 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum width is negative - * @type {number} - */ - minimumWidth:number; - /** - * Gets or sets the left column inset in which no element will lie in the resulting layout. - *

- * The column inset must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the left inset is negative - * @type {number} - */ - leftInset:number; - /** - * Gets or sets the right column inset in which no element will lie in the resulting layout. - *

- * The column inset must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the right inset is negative - * @type {number} - */ - rightInset:number; - /** - * Gets or sets the computed width of the column after the layout has been calculated. - *

- * The computed width needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the computed width is negative - * @type {number} - */ - computedWidth:number; - /** - * Gets or sets the original width of the column. - *

- * The original width should be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the original width is negative - * @type {number} - */ - originalWidth:number; - /** - * Gets or sets the original position (smallest x-coordinate) of the column. - * @type {number} - */ - originalPosition:number; - /** - * Gets or sets the computed position (smallest x-coordinate) of the column after the layout has been calculated. - * @type {number} - */ - computedPosition:number; - /** - * Gets or sets the tightness factor of this column. - *

- * This value must lie within the interval [0,1]. - *

- *

- * The larger the value, the more the column will be forced to obtain its minimum width: - *

- *
    - *
  • a value of 0.0d will disable the compression of the column.
  • - *
  • a value of 1.0d will try to force the column to obtain its specified {@link yfiles.layout.ColumnDescriptor#minimumWidth minimum width}.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside the interval [0,1] - * @type {number} - */ - tightness:number; - /** - * Gets or sets whether the index of the column is fixed or it should be chosen automatically in order to minimize edge - * lengths. - *

- * For all columns where this property is enabled, the relative ordering given by the indices is preserved. The remaining - * columns may be sorted again so that the overall edge lengths are minimized. - *

- * @type {boolean} - */ - indexFixed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ColumnDescriptor; - } - /** - * This class represents a single partition cell, i.e., a pair consisting of a row and a column. - * @class - * @implements {yfiles.lang.IComparable} - * @final - */ - export interface PartitionCellIdEntry extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class PartitionCellIdEntry { - /** - * Compares this {@link yfiles.layout.PartitionCellIdEntry} instance with a given other {@link yfiles.layout.PartitionCellIdEntry} - * instance. - *

- * The comparison is based on the indices of the {@link yfiles.layout.PartitionCellIdEntry#row rows} and {@link yfiles.layout.PartitionCellIdEntry#column columns} of the two pairs. A {@link yfiles.layout.PartitionCellIdEntry} is - * considered to be smaller than another pair if its {@link yfiles.layout.RowDescriptor#index row index} is smaller than the row index of the other pair. If the row - * indices are equal, the {@link yfiles.layout.PartitionCellIdEntry} with the smaller {@link yfiles.layout.ColumnDescriptor#index column index} is said to be smaller. Hence, - * two {@link yfiles.layout.PartitionCellIdEntry} instances are equal, if the row and column indices are equal. - *

- * @param o the {@link } to be compared - * @returns -1, 0 or 1 if this {@link } is smaller than, equal to, or greater than the given other {@link } - * instance - */ - compareTo(o:any):number; - /** - * Gets the {@link yfiles.layout.RowDescriptor} associated with this {@link yfiles.layout.PartitionCellId partition cell}. - * @type {yfiles.layout.RowDescriptor} - */ - row:yfiles.layout.RowDescriptor; - /** - * Gets the {@link yfiles.layout.ColumnDescriptor} associated with this {@link yfiles.layout.PartitionCellId partition cell}. - * @type {yfiles.layout.ColumnDescriptor} - */ - column:yfiles.layout.ColumnDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionCellIdEntry; - } - /** - * {@link yfiles.layout.PartitionCellId} represents an identifier for partition cells of a {@link yfiles.layout.PartitionGrid partition grid} structure. - * @see yfiles.layout.PartitionGrid - * @class - */ - export interface PartitionCellId extends yfiles.lang.Object{} - export class PartitionCellId { - /** - * Gets a {@link yfiles.collections.ICollection. collection} of elements of type {@link yfiles.layout.PartitionCellIdEntry}. - *

- * Each pair consists of a {@link yfiles.layout.ColumnDescriptor column} and a {@link yfiles.layout.RowDescriptor row} defining a single {@link yfiles.layout.PartitionCellId partition cell}. - *

- * @type {yfiles.collections.IEnumerable.} - */ - cells:yfiles.collections.IEnumerable; - /** - * Gets whether or not this {@link yfiles.layout.PartitionCellId} represents a multi-cell, i.e., a cell spanning multiple - * rows/columns. - *

- * This means that it was created using {@link yfiles.layout.PartitionGrid#createCellSpanId}, - * {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createColumnSpanId} - * or {@link yfiles.layout.PartitionGrid#createRowSpanId}. - *

- * @type {boolean} - */ - isSpanning:boolean; - /** - * Gets the first {@link yfiles.layout.RowDescriptor row} associated with this {@link yfiles.layout.PartitionCellId partition cell} identifier. - * @type {yfiles.layout.RowDescriptor} - */ - row:yfiles.layout.RowDescriptor; - /** - * Gets the first {@link yfiles.layout.ColumnDescriptor column} associated with this {@link yfiles.layout.PartitionCellId partition cell} identifier. - * @type {yfiles.layout.ColumnDescriptor} - */ - column:yfiles.layout.ColumnDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionCellId; - } - /** - * This class represents a partition grid that partitions the drawing area into rectangular partition cells. - *

- * Such a structure allows, for example, to model vertical/horizontal swimlanes which are often used in flow diagrams to - * separate logical units. - *

- *

- * The grid consists of rows and columns that are created using the corresponding constructors of this class or methods {@link yfiles.layout.PartitionGrid#addRow} - * and {@link yfiles.layout.PartitionGrid#addColumn}. The {@link yfiles.layout.PartitionGrid} object has to be registered with the graph - * using the {@link yfiles.algorithms.IDataProvider} key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. - *

- *

- * Each node can be assigned to a {@link yfiles.layout.PartitionCellId} which represents a set of partition cells. The mapping has - * to be registered with the graph using {@link yfiles.algorithms.IDataProvider} key - * {@link yfiles.layout.PartitionGrid#PARTITION_CELL_ID_DP_KEY}. Simple partition cell identifiers which represent a single - * partition cell, i.e., a row/column pair, can be created using method {@link yfiles.layout.PartitionGrid#createCellId} or - * {@link yfiles.layout.PartitionGrid#createCellId}. - *

- *

- * Nodes can also be mapped to a partition cell identifier that represents a multi-cell, i.e., a cell spanning multiple - * columns and rows. Please note, however, that multi-cells are not allowed to overlap each other. This means that the user - * has to ensure that each partition cell (row/column pair) is associated with at most one partition cell identifier. The - * multi-cell identifier can be created using methods {@link yfiles.layout.PartitionGrid#createCellSpanId}, - * {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createCellSpanId}, - * {@link yfiles.layout.PartitionGrid#createColumnSpanId}, and {@link yfiles.layout.PartitionGrid#createRowSpanId}. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1, "lblB" : 1, "lblFont" : "16px sans-serif"},"n":[[265,290,230,142,2,[[265,313.6,230,23.6,5,"Column 0"]]],[311.5,386.5,[[336.16,410.85,10.67,18.7]]],[411.5,346.5,[[436.16,370.85,10.67,18.7]]],[505,289,299,144,2,[[505,312.6,299,23.6,5,"Column 1"]]],[631.5,366.5,[[656.16,390.85,10.67,18.7]]],[731.5,326.5,[[756.16,350.85,10.67,18.7]]],[531.5,326.5,[[556.16,350.85,10.67,18.7]]],[819,290,250,140,2,[[819,313.6,250,23.6,5,"Column 2"]]],[831.5,326.5,[[856.16,350.85,10.67,18.7]]],[265,449,230,123,2],[411.5,466.5,[[436.16,490.85,10.67,18.7]]],[411.5,526.5,[[436.16,550.85,10.67,18.7]]],[505,449,299,123,2],[819,449,250,123,2],[931.5,466.5,[[956.16,490.85,10.67,18.7]]],[505,589,299,104,2],[819,589,250,104,2],[531.5,606.5,[[552.83,630.85,17.35,18.7]]],[265,589,230,104,2],[411.5,606.5,[[432.83,630.85,17.35,18.7]]],[831.5,606.5,[[852.83,630.85,17.35,18.7]]],[105,348.2,150,23.6,2,[[105,371.8,150,23.6,5,"Row 0"]]],[105,488.2,150,23.6,2,[[105,511.8,150,23.6,5,"Row 1"]]],[105,628.2,150,23.6,2,[[105,651.8,150,23.6,5,"Row 2"]]]],"e":[[1,2,30,-10,-30,-0,[381.5,391.5,381.5,361.5]],[1,4,30,-0,-30,10,[581.5,401.5,581.5,391.5]],[2,4,30,7.5,-30,-0,[481.5,369,481.5,381.5]],[4,5,30,-0,-30,7.5,[701.5,381.5,701.5,349]],[2,6,30,-7.5,-30,-0,[481.5,354,481.5,341.5]],[6,4,30,7.5,-30,-10,[601.5,349,601.5,371.5]],[6,5,30,-7.5,-30,-7.5,[621.5,334,621.5,341.5,681.5,341.5,681.5,334]],[5,8,30,-0,-30,-0],[8,14,30,-0,-30,-7.5,[901.5,341.5,901.5,474]],[10,14,30,-0,-30,7.5,[881.5,481.5,881.5,489]],[1,17,30,10,-30,10,[381.5,411.5,381.5,661.5,481.5,661.5,481.5,631.5]],[11,17,30,-0,-30,-10,[481.5,541.5,481.5,611.5]],[19,17,30,-0,-30,-0],[17,20,30,-0,-30,-0]],"vp":[105.0,289.0,964.0,404.0]}} Sample output of a layout algorithm with a partition grid - *

- * @class - */ - export interface PartitionGrid extends yfiles.lang.Object{} - export class PartitionGrid { - /** - * Creates an instance of {@link yfiles.layout.PartitionGrid} with the given number of rows and columns as well as with given - * insets and minimum sizes. - * @param rowCount the number of rows - * @param columnCount the number of columns - * @param rowInsets the top and bottom insets of the rows - * @param columnInsets the left and right insets of the columns - * @param minRowSize the minimum row height - * @param minColumnSize the minimum column width - */ - constructor(rowCount:number,columnCount:number,rowInsets:number,columnInsets:number,minRowSize:number,minColumnSize:number); - /** - * Creates an instance of {@link yfiles.layout.PartitionGrid} with the given number of rows and columns. - * @param rowCount the number of rows - * @param columnCount the number of columns - */ - constructor(rowCount:number,columnCount:number); - /** - * Creates a new empty instance of {@link yfiles.layout.PartitionGrid}. - */ - constructor(); - /** - * Adds a new {@link yfiles.layout.ColumnDescriptor column} to the {@link yfiles.layout.PartitionGrid} instance. - *

- * The index of the column (as returned by {@link yfiles.layout.ColumnDescriptor#index}) is equal to the size of the list returned by {@link yfiles.layout.PartitionGrid#columns}. - *

- * @returns a new {@link } instance - */ - addColumn():yfiles.layout.ColumnDescriptor; - /** - * Adds a new {@link yfiles.layout.RowDescriptor row} to the {@link yfiles.layout.PartitionGrid} instance. - *

- * The index of the row (as returned by {@link yfiles.layout.RowDescriptor#index}) is equal to the size of the list returned by {@link yfiles.layout.PartitionGrid#rows}. - *

- * @returns a new {@link } instance - */ - addRow():yfiles.layout.RowDescriptor; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents the cell defined by the given column and row index. - * @param rowIndex the row index of the row defining the cell - * @param columnIndex the column index of the column defining the cell - * @returns a {@link } instance - * @throws {Stubs.Exceptions.ArgumentError} if the given column/row index is not valid - */ - createCellId(rowIndex:number,columnIndex:number):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents the cell defined by the given {@link yfiles.layout.ColumnDescriptor column} and {@link yfiles.layout.RowDescriptor row}. - * @param rd the row defining the cell - * @param cd the column defining the cell - * @returns a {@link } instance - * @throws {Stubs.Exceptions.ArgumentError} if the given column/row is null - */ - createCellId(rd:yfiles.layout.RowDescriptor,cd:yfiles.layout.ColumnDescriptor):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a multi-cell spanning multiple columns and rows. - *

- * The partition cell identifier represents all cells defined by a row between fromRow and toRow (both including) and a - * column between fromRow and toCol (both including). - *

- *

- * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the - * smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not - * depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be - * manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered - * during the layout. - *

- * @param fromRow the topmost row defining the cell - * @param fromCol the leftmost column defining the cell - * @param toRow the bottommost row defining the cell - * @param toCol the rightmost column defining the cell - * @returns a {@link } instance - */ - createCellSpanId(fromRow:yfiles.layout.RowDescriptor,fromCol:yfiles.layout.ColumnDescriptor,toRow:yfiles.layout.RowDescriptor,toCol:yfiles.layout.ColumnDescriptor):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a multi-cell spanning multiple columns and rows. - *

- * The partition cell identifier represents all cells defined by a row with index between fromRowIndex and toRowIndex (both - * including) and a column with index between fromColIndex and toColIndex (both including). - *

- *

- * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the - * smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not - * depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be - * manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered - * during the layout. - *

- * @param fromRowIndex the row index of the topmost row defining the cell - * @param fromColIndex the column index of the leftmost column defining the cell - * @param toRowIndex the row index of the bottommost row defining the cell - * @param toColIndex the column index of the rightmost column defining the cell - * @returns a {@link } instance - */ - createCellSpanId(fromRowIndex:number,fromColIndex:number,toRowIndex:number,toColIndex:number):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a multi-cell spanning multiple columns and rows. - *

- * The partition cell identifier represents all cells spanned by the columns of columnList and rows of rowList. - *

- *

- * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the - * smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not - * depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be - * manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered - * during the layout. - *

- * @param rowList the {@link rows} defining the cell - * @param columnList the {@link columns} defining the cell - * @returns a {@link } instance - */ - createCellSpanId(rowList:yfiles.collections.ICollection,columnList:yfiles.collections.ICollection):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a cell spanning a whole column. - *

- * A group node mapped to such a partition cell identifier represents the column, i.e., its enclosing boundary corresponds - * to that of the column. The boundary does not depend on the partition cells associated with the group's descendants. - * Hence, each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident - * to such a group node are not considered during the layout. - *

- * @param columnIndex the column index of the column defining the cell - * @returns a {@link } instance - */ - createColumnSpanId(columnIndex:number):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a cell spanning a whole row. - *

- * A group node mapped to such a partition cell identifier represents the row, i.e., its enclosing boundary corresponds to - * that of the row. The boundary does not depend on the partition cells associated with the group's descendants. Hence, - * each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident to such - * a group node are not considered during the layout. - *

- * @param rowIndex the row index of the row defining the cell - * @returns a {@link } instance - */ - createRowSpanId(rowIndex:number):yfiles.layout.PartitionCellId; - /** - * Finalizes the orientation changes and is called at the end of the {@link yfiles.layout.OrientationLayout} stage. - *

- * Points are transferred to their final positions through {@link yfiles.layout.OrientationLayout#completeTransform}. - *

- * @param orientationLayouter an {@link } instance - * @see yfiles.layout.OrientationLayout - */ - finalizeOrientationChange(orientationLayouter:yfiles.layout.OrientationLayout):void; - /** - * Returns the {@link yfiles.layout.ColumnDescriptor column} with the given index. - * @param index the index of the column to be returned - * @returns the {@link column} with the given index or null if no such column exists - */ - getColumn(index:number):yfiles.layout.ColumnDescriptor; - /** - * Returns the {@link yfiles.layout.PartitionGrid} instance associated with the given graph. - * @param graph the given graph - * @returns the {@link } of the graph or null if the graph has no associated partition grid - * @static - */ - static getPartitionGrid(graph:yfiles.algorithms.Graph):yfiles.layout.PartitionGrid; - /** - * Returns the {@link yfiles.layout.RowDescriptor row} with the given index. - * @param index the index of the row to be returned - * @returns the {@link row} with the given index or null if no such row exists - */ - getRow(index:number):yfiles.layout.RowDescriptor; - static hasAtLeastTwoNonEmptyRows(graph:yfiles.algorithms.Graph):boolean; - /** - * Prepares for the orientation changes and is called at the beginning of the {@link yfiles.layout.OrientationLayout} stage. - *

- * Original points are transferred to their temporary positions through {@link yfiles.layout.OrientationLayout#prepareTransform}. - *

- * @param orientationLayouter an {@link } instance - * @see yfiles.layout.OrientationLayout - */ - prepareOrientationChange(orientationLayouter:yfiles.layout.OrientationLayout):void; - /** - * Data provider key for storing the partition grid structure - *

- * If the {@link yfiles.algorithms.IDataProvider} contains a partition grid structure, this structure will be considered during - * layout (provided that the layout algorithm supports such constraints). - *

- * @const - * @static - * @type {yfiles.algorithms.GraphDpKey.} - */ - static PARTITION_GRID_DP_KEY:yfiles.algorithms.GraphDpKey; - /** - * Data provider key for storing a set of partition cells for each node - *

- * Each node is placed inside the columns/rows defined by the corresponding {@link yfiles.layout.PartitionCellId} identifier. - * Instances can be shared among multiple nodes, but don't have to be shared. - *

- * @see yfiles.layout.PartitionCellId - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PARTITION_CELL_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets whether or not the order of the columns should be chosen automatically to minimize edge lengths. - *

- * For all columns where {@link yfiles.layout.ColumnDescriptor#indexFixed} is set to - * true, the relative ordering given by the indices is preserved. The remaining columns may be sorted again so that the - * overall edge lengths are minimized. - *

- * @type {boolean} - */ - optimizeColumnOrder:boolean; - /** - * Gets or sets whether or not the order of the rows should be chosen automatically to minimize edge lengths. - *

- * For all rows where {@link yfiles.layout.RowDescriptor#indexFixed} is set to - * true, the relative ordering given by the indices is preserved. The remaining rows may be sorted again so that the - * overall edge lengths are minimized. - *

- * @type {boolean} - */ - optimizeRowOrder:boolean; - /** - * Gets the list of rows of the {@link yfiles.layout.PartitionGrid partition grid}. - * @type {yfiles.algorithms.YList} - */ - rows:yfiles.algorithms.YList; - /** - * Gets the columns of the {@link yfiles.layout.PartitionGrid partition grid}. - * @type {yfiles.algorithms.YList} - */ - columns:yfiles.algorithms.YList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionGrid; - } - /** - * This class represents a row of a {@link yfiles.layout.PartitionGrid partition grid} structure. - *

- * The results of the calculation of the geometry of the row will be placed into the instances of this class after the - * layout. - *

- * @see yfiles.layout.PartitionGrid - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface RowDescriptor extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class RowDescriptor { - /** - * Compares this {@link yfiles.layout.RowDescriptor} instance with a given other {@link yfiles.layout.RowDescriptor} instance based on the - * indices of the two instances. - * @param o the {@link } to compare to - * @returns -1, 0 or 1 if this {@link } is less than, equal to, or greater than the given other - * {@link } - */ - compareTo(o:any):number; - /** - * Gets the index of the row within the {@link yfiles.layout.PartitionGrid partition grid}. - * @type {number} - */ - index:number; - /** - * Gets or sets the minimum height of the row. - *

- * The minimum height is defined to be at least 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum height is negative - * @type {number} - */ - minimumHeight:number; - /** - * Gets or sets the top inset in which no element will lie in the resulting layout. - *

- * The inset value needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given top inset is negative - * @type {number} - */ - topInset:number; - /** - * Gets or sets the bottom inset in which no element will lie in the resulting layout. - *

- * The inset value needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given bottom inset is negative - * @type {number} - */ - bottomInset:number; - /** - * Gets or sets the computed height of the row after the layout has been calculated. - *

- * The computed height needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the computed height is negative - * @type {number} - */ - computedHeight:number; - /** - * Gets or sets the original position (smallest y-coordinate) of the row. - * @type {number} - */ - originalPosition:number; - /** - * Gets or sets the original height of the row. - *

- * The original height needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the original height is negative - * @type {number} - */ - originalHeight:number; - /** - * Gets or sets the computed position (smallest y-coordinate) of the row after the layout has been calculated. - * @type {number} - */ - computedPosition:number; - /** - * Gets or sets the tightness factor of this row. - *

- * This value must lie within the interval [0,1]. - *

- *

- * The larger the value, the more the row will be forced to obtain its minimum height: - *

- *
    - *
  • a value of 0.0d will disable the compression of the row.
  • - *
  • a value of 1.0d will try to force the row to obtain its specified {@link yfiles.layout.RowDescriptor#minimumHeight minimum height}.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside the interval [0,1] - * @type {number} - */ - tightness:number; - /** - * Gets or sets whether the index of the row is fixed or it should be chosen automatically in order to minimize edge - * lengths. - *

- * For all rows where this property is enabled, the relative ordering given by the indices is preserved. The remaining rows - * may be sorted again so that the overall edge lengths are minimized. - *

- * @type {boolean} - */ - indexFixed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.RowDescriptor; - } - export enum InterEdgeRoutingStyle{ - /** - * An inter-edge routing style based on which the edge layout of inter-edges will be adopted from the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle - */ - ADOPT, - /** - * An inter-edge routing style based on which inter-edges are routed in an orthogonal style. - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRouter - */ - ORTHOGONAL, - /** - * An inter-edge routing style based on which inter-edges are routed as straight lines. - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRouter - */ - STRAIGHTLINE - } - /** - * This interface defines {@link yfiles.algorithms.IDataProvider} keys for those layout algorithms that can handle hierarchically - * grouped graphs. - *

- * There are two groups of {@link yfiles.algorithms.IDataProvider} keys. {@link yfiles.algorithms.IDataProvider}s registered with - * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY} and {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} - * define the relationship of nodes within the hierarchy. A parent node is defined for each node in the graph. This parent - * is the containing group node. For top-level nodes, this parent is null. - *

- *

- * {@link yfiles.layout.GroupingKeys#GROUP_NODE_INSETS_DP_KEY} and {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY} are used for - * registering - * {@link yfiles.algorithms.IDataProvider}s that add layout information to group nodes such as the insets and the minimum size - * respectively. - *

- * @see yfiles.layout.GroupingSupport - * @class - * @static - */ - export interface GroupingKeys extends yfiles.lang.Object{} - export class GroupingKeys { - /** - * Data provider key for assigning a unique ID for each node - *

- * The IDs of the nodes need to differ based on {@link any#hashCode} and {@link any#equals}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for describing the hierarchy of nodes in the graph - * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PARENT_NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for distinguishing normal nodes from group nodes - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static GROUP_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning insets for group nodes - *

- * Insets reserve space around the contents of a group node. Labels and other visual decorations may be placed inside this - * space. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static GROUP_NODE_INSETS_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning minimum sizes for group nodes - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static MINIMUM_NODE_SIZE_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.GroupingKeys; - } - /** - * This class provides convenient and efficient access to the hierarchic graph structure. - *

- * The grouping information is provided through {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys - * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} and - * {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}. It describes the hierarchy as a tree where a group node is the parent of the - * nodes that it contains. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[444,-37.38,62,82.38,2,[[444,-15,62,22.38,"9"]]],[460,0,[[469.66,24.35,10.67,18.7,"5"]]],[536,0,[[545.66,24.35,10.67,18.7,"6"]]],[384,0,[[393.66,24.35,10.67,18.7,"4"]]],[596,-10,50,50,2,[[596,12.38,50,22.38,"7"]]],[140,-74.75,214,134.75,2,[[140,-52.38,214,22.38,"10"]]],[156,0,[[165.66,24.35,10.67,18.7,"1"]]],[216,-37.38,122,82.38,2,[[216,-15,122,22.38,"8"]]],[232,0,[[241.66,24.35,10.67,18.7,"2"]]],[292,0,[[301.66,24.35,10.67,18.7,"3"]]]],"e":[],"vp":[140.0,-75.0,506.0,135.0]}} This is an example graph that contains group nodes. {@graph {"ann":{"s":[30,30],"d":1},"n":[[34.5,70,42,52.38,2,[[34.5,92.38,42,22.38,"10"]]],[200,162.38,42,52.38,2,[[200,184.75,42,22.38,"9"]]],[150,277.13,[[159.66,301.48,10.67,18.7,"4"]]],[179.25,0,[[160.9,22.7,66.7,18.7,"Virtual Root"]]],[0,277.13,[[9.66,301.48,10.67,18.7,"1"]]],[206,277.13,[[215.66,301.48,10.67,18.7,"5"]]],[69,162.38,42,52.38,2,[[69,184.75,42,22.38,"8"]]],[50,277.13,[[59.66,301.48,10.67,18.7,"2"]]],[100,277.13,[[109.66,301.48,10.67,18.7,"3"]]],[312,254.75,42,52.38,2,[[312,277.13,42,22.38,"7"]]],[262,277.13,[[271.66,301.48,10.67,18.7,"6"]]]],"e":[[3,0,[194.25,50,55.5,50]],[3,2,[194.25,50,165,50]],[3,1,[194.25,50,221,50]],[0,4,[55.5,142.38,15,142.38]],[1,5],[0,6,[55.5,142.38,90,142.38]],[6,7,[90,234.75,65,234.75]],[6,8,[90,234.75,115,234.75]],[3,9,[194.25,50,333,50]],[3,10,[194.25,50,277,50]]],"vp":[0.0,0.0,354.0,308.0]}} The hierarchy tree of the grouped graph reveals the relationship - * among the nodes. The corresponding nodes have the same labels as in the grouped graph. Group nodes are considered as the - * parents of their content which can consist of group nodes and/or normal nodes. Top-level nodes are children of a - * {@link yfiles.layout.GroupingSupport#root virtual root}. Leaf nodes can either be normal nodes or empty groups. - *

- * @class - */ - export interface GroupingSupport extends yfiles.lang.Object{} - export class GroupingSupport { - /** - * Creates a new {@link yfiles.layout.GroupingSupport} instance that represents the hierarchy of the graph. - *

- * The hierarchy information is cached during the constructor call. Later modifications to the graph are not considered and - * may lead to errors when using this {@link yfiles.layout.GroupingSupport} instance. - *

- * @param graph the graph instance from which the hierarchy information is obtained - */ - constructor(graph:yfiles.algorithms.Graph); - /** - * Creates a {@link yfiles.algorithms.INodeMap} to store hierarchy information for each node. - *

- * This method is called in {@link yfiles.layout.GroupingSupport#init} and may be overridden to customize how the {@link yfiles.algorithms.INodeMap} - * is created. - *

- * @param graph the current graph - * @returns the new instance of {@link } - * @see yfiles.layout.GroupingSupport#init - * @see yfiles.layout.GroupingSupport#disposeInfoMap - * @protected - */ - createInfoMap(graph:yfiles.algorithms.Graph):yfiles.algorithms.INodeMap; - /** - * Disposes of all internal data structures held by this {@link yfiles.layout.GroupingSupport instance}. - *

- * {@link yfiles.layout.GroupingSupport} should be disposed of when it is not needed anymore, or if the state of the graph changes - * (e.g. new nodes are added). - *

- */ - dispose():void; - /** - * Disposes of the {@link yfiles.algorithms.INodeMap} created to store hierarchy information for each node. - *

- * This method is called in {@link yfiles.layout.GroupingSupport#dispose} and may be overridden to revert changes from - * {@link yfiles.layout.GroupingSupport#createInfoMap}. - *

- * @param graph the current graph - * @param infoMap the {@link } which contains the hierarchy information for each node - * @see yfiles.layout.GroupingSupport#dispose - * @see yfiles.layout.GroupingSupport#createInfoMap - * @protected - */ - disposeInfoMap(graph:yfiles.algorithms.Graph,infoMap:yfiles.algorithms.INodeMap):void; - /** - * Returns the direct children of the given group node. - *

- * If the {@link yfiles.layout.GroupingSupport#root virtual root of the hierarchy tree} is passed, all top-level nodes are returned. - *

- * @param parent the group node - * @returns a set of child nodes of the given parent node - * @see yfiles.layout.GroupingSupport#root - * @see yfiles.layout.GroupingSupport#getParent - * @see yfiles.layout.GroupingSupport#getDescendants - */ - getChildren(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns all descendants of the given group node. - *

- * All nodes in the subtree rooted at this group node are collected recursively. - *

- *

- * If the {@link yfiles.layout.GroupingSupport#root virtual root of the hierarchy tree} is passed, all nodes in the graph are returned. - *

- * @param parent the group node - * @returns a set of nodes that belong to a subtree of the hierarchy tree rooted at the given parent - * @see yfiles.layout.GroupingSupport#root - * @see yfiles.layout.GroupingSupport#getParent - * @see yfiles.layout.GroupingSupport#getChildren - */ - getDescendants(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns all edges crossing the bounds of the given group node such that their targets are inside the group node while - * their sources lie outside the group node. - * @param group the group node whose bounds are crossed - * @returns a set of edges that cross the bounds of the group node starting outside the group node - * @see yfiles.layout.GroupingSupport#getEdgesGoingOut - * @see yfiles.layout.GroupingSupport#isNormalEdge - */ - getEdgesGoingIn(group:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; - /** - * Returns all edges crossing the bounds of the given group node such that their sources are inside the group node while - * their targets lie outside the group node. - * @param group the group node whose bounds are crossed - * @returns a set of edges that cross the bounds of the group node starting inside the group node - * @see yfiles.layout.GroupingSupport#getEdgesGoingIn - * @see yfiles.layout.GroupingSupport#isNormalEdge - */ - getEdgesGoingOut(group:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; - /** - * Returns the nearest common ancestor of the given nodes in the hierarchy structure. - *

- * The nearest common ancestor is the local root of the smallest subtree in the hierarchy tree that contains both nodes. - * This group is the first node that contains these two nodes. If no such node exists, the {@link yfiles.layout.GroupingSupport#root virtual root} is returned. - *

- *

- * Common ancestors in special cases: - *

- *
    - *
  • node1 == node2: the parent of node1/node2
  • - *
  • node1 is parent of node2: the parent of node1
  • - *
  • node2 is parent of node1: the parent of node2
  • - *
- * @param node1 one of the two nodes whose common ancestor is determined - * @param node2 one of the two nodes whose common ancestor is determined - * @returns the nearest common ancestor node or {@link #root} - */ - getNearestCommonAncestor(node1:yfiles.algorithms.Node,node2:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Returns the parent for the given node. - *

- * The parent is the containing group node. - *

- * @param node the node for which the parent is determined - * @returns the parent of the given node or null for a top-level node - * @throws {Stubs.Exceptions.ArgumentError} if the given node is null - * @see yfiles.layout.GroupingSupport#getChildren - * @see yfiles.layout.GroupingSupport#getDescendants - * @see yfiles.layout.GroupingSupport#getNearestCommonAncestor - */ - getParent(node:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Returns an immediate child of the group node that represents the given node. - *

- * If this node is already a child of the group node, the group node will be its representative. In case the node is - * located further down in the hierarchy, the child of the group node, which is also an ancestor of the node, is used. - * There is no representative if the node is not a descendant of the group. - *

- * @param node the node for which a representative is searched - * @param group the group node to which the representative should belong - * @returns the representative or null if the node is not a descendant of the group - * @throws {Stubs.Exceptions.ArgumentError} if the given node is null - */ - getRepresentative(node:yfiles.algorithms.Node,group:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Determines whether or not the given node is a group node with children. - *

- * Normal nodes never have children. - *

- * @param node the potential parent - * @returns true if the given node has children, false otherwise - * @see yfiles.layout.GroupingSupport#getChildren - * @see yfiles.layout.GroupingSupport#isGroupNode - */ - hasChildren(node:yfiles.algorithms.Node):boolean; - /** - * Initializes internal data structures. - *

- * This method is called from {@link yfiles.layout.GroupingSupport} and retrieves the state of the hierarchic graph at the moment - * of invocation. It may be overridden to append additional information used for group handling. - *

- * @see yfiles.layout.GroupingSupport#dispose - * @protected - */ - init():void; - /** - * Returns whether or not the given graph is flat. - *

- * A graph is considered to be flat if there exist no group nodes or there exist group nodes but none of them has children. - *

- * @param graph the input graph - * @returns true if there are no groups or only empty groups in the graph, false otherwise - * @see yfiles.layout.GroupingSupport#isGrouped - * @static - */ - static isFlat(graph:yfiles.algorithms.Graph):boolean; - /** - * Returns whether or not the given graph is grouped. - *

- * A graph is considered to be grouped if there are {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys - * {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}, {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY} and - * {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY}. - *

- * @param graph the input graph - * @returns true if the graph contains hierarchic information, false otherwise - * @see yfiles.layout.GroupingSupport#isFlat - * @static - */ - static isGrouped(graph:yfiles.algorithms.Graph):boolean; - /** - * Determines whether or not the given node is a group node. - *

- * While group nodes may have children, normal nodes never have children. - *

- * @param node the potential group node - * @returns true if the given node is a group node, false otherwise - * @see yfiles.layout.GroupingSupport#hasChildren - */ - isGroupNode(node:yfiles.algorithms.Node):boolean; - /** - * Determines whether or not the given edge is a normal edge as opposed to an edge that crosses any group node bounds. - *

- * Source and target of a normal edge are part of the same hierarchy level and share the same parent node. - *

- * @param edge the edge to check - * @returns true if the given edge is normal, false otherwise - * @see yfiles.layout.GroupingSupport#getEdgesGoingIn - * @see yfiles.layout.GroupingSupport#getEdgesGoingOut - */ - isNormalEdge(edge:yfiles.algorithms.Edge):boolean; - /** - * Gets the {@link yfiles.algorithms.Graph} instance for which this {@link yfiles.layout.GroupingSupport} object provides hierarchy - * information. - * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - /** - * Gets a {@link yfiles.algorithms.Node} instance associated with the virtual root of the hierarchy tree. - *

- * This instance can be given to the {@link yfiles.layout.GroupingSupport#getChildren} to obtain the nodes of the top level of the - * hierarchy. - *

- * @see yfiles.layout.GroupingSupport#getChildren - * @type {yfiles.algorithms.Node} - */ - root:yfiles.algorithms.Node; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.GroupingSupport; - } - /** - * A {@link yfiles.layout.ILayoutStage layout stage} that hides the group nodes of hierarchically grouped graphs. - *

- * This stage removes all group nodes and adjacent edges from the graph before passing it to the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. After the core layout algorithm has arranged the graph, the hidden elements will be reinserted. - *

- *

- * This stage is used by layout algorithms that cannot handle grouped graphs (e.g. {@link yfiles.circular.CircularLayout}). - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface HideGroupsStage extends yfiles.layout.LayoutStageBase{} - export class HideGroupsStage { - /** - * Creates an instance of {@link yfiles.layout.HideGroupsStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Hides the group nodes and their incident edges of the input graph. - *

- * Furthermore, this method removes all grouping-related {@link yfiles.algorithms.IDataProvider}s from the input graph. - *

- * @param graph the input graph - * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY - * @see yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY - * @see yfiles.layout.GroupingKeys#GROUP_DP_KEY - * @see yfiles.layout.HideGroupsStage#unhideGroupNodes - */ - hideGroupNodes(graph:yfiles.layout.LayoutGraph):void; - /** - * Un-hides the group nodes and their incident edges of the input graph that were previously hidden using method - * {@link yfiles.layout.HideGroupsStage#hideGroupNodes}. - *

- * Furthermore, this method restores all previously removed grouping related - * {@link yfiles.algorithms.IDataProvider}s on the input graph. - *

- * @param graph the given graph - * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY - * @see yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY - * @see yfiles.layout.GroupingKeys#GROUP_DP_KEY - * @see yfiles.layout.HideGroupsStage#hideGroupNodes - */ - unhideGroupNodes(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets whether or not empty group nodes, i.e., group nodes without children, will be hidden by this stage. - * @type {boolean} - */ - hidingEmptyGroupNodes:boolean; - /** - * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance for calculating the sizes of group nodes. - *

- * For every group which is in its open state, the {@link yfiles.layout.IGroupBoundsCalculator} will be asked to calculate the - * bounds for the group's child nodes. The resulting size will be used during the ongoing layout calculation. - *

- * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.HideGroupsStage; - } - /** - * A {@link yfiles.layout.IGroupBoundsCalculator} is responsible for calculating the bounds of a group node during a layout - * process. - * @interface - */ - export interface IGroupBoundsCalculator extends yfiles.lang.Object{ - /** - * Calculates the bounds of the given group node that contains the given list of child nodes. - *

- * This method is called during the layout process. - *

- * @param graph the input graph - * @param groupNode the group node whose bounds will be calculated - * @param children a {@link } containing the nodes that reside inside the group node - * @returns a {@link } instance that describes the bounds of the group node - * @abstract - */ - calculateBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; - } - var IGroupBoundsCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IGroupBoundsCalculator; - }; - /** - * This {@link yfiles.layout.IGroupBoundsCalculator} calculates the bounds of group nodes and allows to specify custom insets for - * each group node. - *

- * {@link yfiles.algorithms.Insets Insets} are provided by a {@link yfiles.algorithms.IDataProvider} that must have been registered with the graph using the - * specified {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key} prior to the invocation of the layout algorithm. - *

- * @class - * @implements {yfiles.layout.IGroupBoundsCalculator} - */ - export interface InsetsGroupBoundsCalculator extends yfiles.lang.Object,yfiles.layout.IGroupBoundsCalculator{} - export class InsetsGroupBoundsCalculator { - /** - * Constructs an instance of {@link yfiles.layout.InsetsGroupBoundsCalculator} using the given {@link yfiles.algorithms.IDataProvider} key - * as {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey group node insets key} and the given insets as {@link yfiles.layout.InsetsGroupBoundsCalculator#defaultInsets default insets}. - * @param [groupNodeInsetsDPKey=null] the {@link } key to use as {@link #groupNodeInsetsDpKey insets key} - * @param [defaultInsets=null] the insets to use as {@link #defaultInsets default insets} - */ - constructor(groupNodeInsetsDPKey?:any,defaultInsets?:yfiles.algorithms.Insets); - /** - * Constructs an instance of {@link yfiles.layout.InsetsGroupBoundsCalculator} using the given {@link yfiles.algorithms.IDataProvider} key - * as {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey group node insets key} and the given insets as {@link yfiles.layout.InsetsGroupBoundsCalculator#defaultInsets default insets}. - * @param {Object} options The parameters to pass. - * @param [options.groupNodeInsetsDPKey=null] the {@link } key to use as {@link #groupNodeInsetsDpKey insets key} - * @param [options.defaultInsets=null] the insets to use as {@link #defaultInsets default insets} - */ - constructor(options:{groupNodeInsetsDPKey?:Object,defaultInsets?:yfiles.algorithms.Insets}); - /** - * Calculates the bounds of the given group node and enlarges the bounds by the insets associated with the group node. - *

- * The {@link yfiles.algorithms.Insets insets} associated with the group node will be retrieved from a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with the current {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key}. - *

- * @param graph the input graph - * @param groupNode the group node whose bounds will be calculated - * @param children a {@link } containing the nodes that reside inside the group node - * @returns a {@link } instance that describes the bounds of the group node - */ - calculateBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; - /** - * Enlarges the given graph bounds by the insets associated with the given group node. - *

- * The {@link yfiles.algorithms.Insets insets} associated with the group node will be retrieved from a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with the current {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key}. - *

- *

- * This method is called while {@link yfiles.layout.InsetsGroupBoundsCalculator#calculateBounds calculating the group bounds} to realize the support for custom insets. It may be overridden - * to change the way specific insets influence the group node bounds. - *

- * @param graph the input graph - * @param groupNode the group node whose bounds should be enlarged - * @param children the list of nodes that the given group node contains - * @param bounds a {@link } instance representing the bounds of the given group node - * @returns a {@link } instance representing the enlarged bounds of the given group node - */ - createEnlargedBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList,bounds:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Gets or sets whether or not the labels of nodes contained in a group are considered while calculating the bounds of the - * group node. - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not the labels of edges contained in a group are considered while calculating the bounds of the - * group node. - * @type {boolean} - */ - considerEdgeLabels:boolean; - /** - * Gets or sets whether or not the calculation of the bounds of a group node considers the {@link yfiles.layout.NodeHalo NodeHalos} associated with the - * group's child nodes. - * @type {boolean} - */ - considerNodeHalos:boolean; - /** - * Gets or sets the default insets that will be used if the {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key} - * does not contain a mapping for a specific node. - * @type {yfiles.algorithms.Insets} - */ - defaultInsets:yfiles.algorithms.Insets; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used to access the insets for the group - * nodes. - *

- * The {@link yfiles.algorithms.IDataProvider} registered with this key must provide a mapping from each group node to a {@link yfiles.algorithms.Insets} - * (or {@link yfiles.algorithms.Insets}) instance. - *

- * @type {any} - */ - groupNodeInsetsDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.InsetsGroupBoundsCalculator; - } - /** - * A special {@link yfiles.layout.ComponentLayout} implementation that allows to lay out isolated subgraphs within a group as - * separate components. - *

- * {@link yfiles.orthogonal.OrthogonalLayout OrthogonalLayout} uses this layout stage to arrange components. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[-5,16,210,336.38,2],[10,110,1],[10,35,1],[85,35,1],[160,35,1],[160,110,1],[10,285],[85,285],[85,210]],"e":[[1,2,0,-15,0,15],[2,3,15,0,-15,0],[3,4,15,0,-15,0],[4,5,0,15,0,-15],[5,1,-15,0,15,0],[6,8,0,-15,-15,0,[25,225]],[8,7,0,15,0,-15],[7,6,-15,0,15,0]],"vp":[-5.0,16.0,210.0,337.0]}} Example of a hierarchically grouped graph with two components that are laid out by {@link yfiles.orthogonal.OrthogonalLayout OrthogonalLayout} as separate - * components. - *

- * @class - * @extends {yfiles.layout.ComponentLayout} - */ - export interface IsolatedGroupComponentLayout extends yfiles.layout.ComponentLayout{} - export class IsolatedGroupComponentLayout { - /** - * Creates an instance of {@link yfiles.layout.IsolatedGroupComponentLayout} with the given layout algorithm as - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] the core layout algorithm that will be invoked for each component of the graph - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Determines the nodes that belong to the same graph component. - *

- * Unlike - * {@link yfiles.layout.ComponentLayout}, this implementation additionally identifies isolated subgraphs within a group as separate - * components. - *

- * @param graph the input graph - * @param compNumber the {@link } that will be filled by the layout algorithm, such that it contains the zero-based index - * of the component number to which each node belongs - * @returns the number of separate components - * @protected - */ - findIsolatedGraphComponents(graph:yfiles.layout.LayoutGraph,compNumber:yfiles.algorithms.INodeMap):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.IsolatedGroupComponentLayout; - } - /** - * This {@link yfiles.layout.IGroupBoundsCalculator} allows custom insets for group nodes and guarantees that their provided - * minimum sizes will be maintained. - *

- * As a subclass of {@link yfiles.layout.InsetsGroupBoundsCalculator}, this class supports custom insets for each group node. - * Furthermore, it guarantees that a desired minimum size is maintained. The minimum sizes are provided by a {@link yfiles.algorithms.IDataProvider} - * registered with the graph using the specified {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum node size key}. - *

- * @class - * @extends {yfiles.layout.InsetsGroupBoundsCalculator} - */ - export interface MinimumSizeGroupBoundsCalculator extends yfiles.layout.InsetsGroupBoundsCalculator{} - export class MinimumSizeGroupBoundsCalculator { - /** - * Creates a new instance of {@link yfiles.layout.MinimumSizeGroupBoundsCalculator} with the given key as {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum node size key}. - * @param minSizeDataProviderKey the {@link } key to use as {@link #minimumNodeSizeDpKey minimum size key} - */ - constructor(minSizeDataProviderKey:any); - /** - * Creates a new instance of {@link yfiles.layout.MinimumSizeGroupBoundsCalculator} with default settings. - */ - constructor(); - /** - * Gets or sets how the nodes are resized horizontally if the calculated width is smaller than the preferred minimum width - * of a group node. - *

- * The alignment is defined to be a value between 0 and 1, such that: - *

- *
    - *
  • A value of 0 means that the nodes grow to the right while the left border remains unchanged.
  • - *
  • A value of 1 means that the nodes grow to the left while the right border remains unchanged.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the given value does not lie within [0,1] - * @type {number} - */ - xAlignment:number; - /** - * Gets or sets how the nodes are resized vertically if the calculated height is smaller than the preferred minimum height - * of a group node. - *

- * The alignment is defined to be a value between 0 and 1, such that: - *

- *
    - *
  • A value of 0 means that the nodes grow downwards while the top border remains unchanged.
  • - *
  • A value of 1 means that the nodes grow upwards while the bottom border remains unchanged.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the given value does not lie within [0,1] - * @type {number} - */ - yAlignment:number; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used to access the minimum sizes for the - * group nodes. - *

- * The {@link yfiles.algorithms.IDataProvider} registered with this key must provide a mapping from each group node to a {@link yfiles.algorithms.YDimension} - * object defining the minimum width and height of the group node. - *

- * @see yfiles.layout.MinimumSizeGroupBoundsCalculator#defaultMinimumNodeSize - * @type {any} - */ - minimumNodeSizeDpKey:any; - /** - * Gets or sets the default minimum size (width and height) for group nodes. - *

- * The default minimum size is used if the {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum size key} does not - * contain a mapping for a group node. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.algorithms.YDimension} is null - * @see yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey - * @type {yfiles.algorithms.YDimension} - */ - defaultMinimumNodeSize:yfiles.algorithms.YDimension; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.MinimumSizeGroupBoundsCalculator; - } - /** - * This layout algorithm recursively traverses a hierarchically organized graph in a bottom-up fashion and applies a - * specified layout algorithm to the contents (direct children) of each group node. - *

- * Layout Style The way a graph is arranged depends on the {@link yfiles.layout.ILayoutAlgorithm layout algorithms} which are applied to the different group nodes. {@link yfiles.layout.RecursiveGroupLayout} - * is able to produce different layout styles for the content of each group node. - *

- *

- * This layout algorithm can be either applied if a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} cannot handle grouped graphs by itself or if the - * content of (some) group nodes should be arranged differently. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[-17.5,755,335,340,2],[166.25,770],[247.5,840],[85,840],[172.5,910],[272.5,910],[72.5,910],[272.5,980],[222.5,910],[97.5,980],[47.5,980],[-2.5,910],[147.5,980],[122.5,1050],[172.5,1050],[197.5,980],[-2.5,980],[-2.5,1050],[929.97,593,673.03,664,2],[1028.43,230.79,493.13,238.42,2],[1451.74,249.79,54.83,54.83],[1043.43,336.11,54.83,54.83],[1376.74,346.07],[1143.26,334.82],[1223.95,267.93,37.09,37.09],[1223.95,335.02,37.09,37.09],[1223.95,402.12,37.09,37.09],[1306.05,338.57],[351.41,46.3,547.17,607.39,2],[392.91,738,464.18,374,2],[600.69,849.79,44.43,44.43],[803.73,927.82,38.37,38.37],[600.69,1024.79,44.43,44.43],[707.91,932],[707.91,1032],[507.91,757],[503.73,852.82,38.37,38.37],[407.91,857],[1329,1038,6],[1269,795,6],[1472,612,6],[1411,1025,6],[1427,744,6],[1355,779,6],[1157,888,6],[1108,838,6],[1230,723,6],[1351,946,6],[1185,810,6],[1387,847,6],[1185,956,6],[1221,1212,6],[1311,715,6],[962,988,6],[1558,700,6],[1053,639,6],[1264,993,6],[1509,1121,6],[1143,742,6],[1453,871,6],[1248,1077,6],[1430,943,6],[1093,947,6],[1173,1025,6],[1249.93,858.93,83.14,83.14,6],[406.42,266.45,6],[535.29,224.58,6],[407.4,568.81,54.23,54.23,6],[366.41,92.7,54.23,54.23,6],[464.05,443.83,6],[450.74,65.3,54.23,54.23,6],[464.05,224.58,6],[592.93,401.96,6],[714.87,571.77,41.35,41.35,6],[842.24,530.39,41.35,41.35,6],[793.59,463.42,41.35,41.35,6],[793.59,597.35,41.35,41.35,6],[614.94,334.2,6],[535.29,443.83,6],[714.87,489,41.35,41.35,6],[406.42,401.96,6],[592.93,266.45,6],[384.4,334.2,6],[595.06,86,54.23,54.23,6],[668.28,135.99,54.23,54.23,6],[720.4,207.72,54.23,54.23,6],[745.32,292.81,54.23,54.23,6]],"e":[[1,2],[1,3],[3,4],[2,5],[3,6],[5,7],[2,8],[6,9],[6,10],[3,11],[4,12],[12,13],[12,14],[4,15],[11,16],[16,17],[0,19,0,-170,0,-119.21,[150,0,1275,0]],[21,22,27.41,13.71,-15,7.5,[1108.26,377.23,1158.26,454.21,1336.05,454.21,1361.74,368.57]],[22,20,15,-0,-27.41,18.28,[1416.74,361.07,1436.74,295.48]],[21,23,27.41,-13.71,-15,-0],[23,20,15,-11.25,-27.41,-18.28,[1183.26,338.57,1208.95,252.93,1391.74,252.93,1436.74,258.93]],[23,24,15,-3.75,-18.55,-0,[1183.26,346.07,1208.95,286.48]],[24,20,18.55,-9.27,-27.41,-0],[23,25,15,3.75,-18.55,-0],[23,26,15,11.25,-18.55,-0,[1183.26,361.07,1208.95,420.66]],[25,27,18.55,-0,-15,-0],[24,27,18.55,9.27,-15,-10,[1271.05,295.75,1291.05,343.57]],[26,27,18.55,-0,-15,10,[1271.05,420.66,1291.05,363.57]],[27,22,15,-0,-15,-7.5],[29,28,0,-187,0,303.7],[31,30,0,-19.18,22.21,0,[822.91,872]],[31,32,0,19.18,0,22.21,[822.91,1097,622.91,1097]],[2,32],[32,30,0,-22.21,0,22.21],[31,33,-19.18,0,15,0],[33,32,-15,0,12.5,-22.21,[635.41,947]],[33,34,0,15,0,-15],[34,32,-15,0,22.21,0],[34,31,15,0,-12.5,19.18,[810.41,1047]],[35,30,15,0,0,-22.21,[622.91,772]],[35,36,0,15,0,-19.18],[32,36,-22.21,-12.5,0,19.18,[522.91,1034.5]],[36,30,19.18,0,-22.21,0],[36,37,-19.18,0,15,0],[32,37,-22.21,0,0,15,[422.91,1047]],[37,35,0,-15,-15,0,[422.91,772]],[42,40],[42,54],[41,57],[58,55],[60,51],[62,53],[64,38],[64,39],[64,41,[1330.6,964.06,1337.99,974.52,1346.6,984.13,1356.64,992.4]],[64,42,[1301.28,892.93,1380.34,828.69,1390.42,819.61,1400.14,810]],[64,43],[64,44],[64,45],[64,46,[1257.8,823.49,1254.58,812.63,1252.57,801.6]],[64,47],[64,48],[64,49],[64,50],[64,52,[1313.2,816.82,1315.29,805.72]],[64,56],[64,58,[1227.75,807.43,1218.48,798.12,1198.26,783.57]],[64,59,[1401.91,896.21,1413.4,895.03]],[64,60,[1249.83,992.24,1246.96,1005.02,1247.3,1018.2]],[64,61],[64,62],[64,63],[40,19],[69,67],[65,71],[66,71],[71,70],[71,69],[71,68],[72,21],[73,74],[75,74],[73,76],[74,76],[77,72],[77,71],[71,78],[78,72],[78,69],[72,79],[79,75],[79,73],[69,80],[72,80],[66,81],[81,77],[65,82],[82,81],[82,80],[82,77],[83,81],[84,81],[85,81],[86,81],[51,33]],"vp":[-18.0,0.0,1621.0,1257.0]}}Concept - *

- *

- * {@link yfiles.layout.RecursiveGroupLayout} uses a hierarchy tree representation of the grouped graph in which the content nodes - * are the children of their containing group node. That way, it can traverse the tree recursively while arranging only the - * direct children of each group node. The layout algorithm starts by arranging the leaves in the hierarchy tree, then - * works its way up to the root computing the layout for each group node in the tree. - *

- *

- * All nodes other than the direct children are temporarily hidden. The layout algorithm performs two steps for each group - * node. - *

- *
    - *
  1. - * It arranges the direct children using either the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} or a special layout algorithm retrieved from a {@link yfiles.algorithms.IDataProvider} - * registered with - * {@link yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY}. The content of group nodes among the children is already - * arranged at this time and will be ignored. These group nodes are handled like normal nodes with a size that encloses the - * content. - *
  2. - *
  3. - * Then {@link yfiles.layout.RecursiveGroupLayout} computes the final size of the group node using an implementation of - * {@link yfiles.layout.IGroupBoundsCalculator}. Customized {@link yfiles.layout.IGroupBoundsCalculator}s can be specified using - * {@link yfiles.layout.RecursiveGroupLayout#groupBoundsCalculator}. Aside from the resulting layout, this size is used in the following iteration. - *
  4. - *
- *

- * After a layout is applied to all group nodes, the layout algorithm computes routes for the edges whose source node is - * located at a different hierarchy level than its target node. The edge routing algorithm for these so-called inter-edges - * can be {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter customized}. - *

- *

- * Note that {@link yfiles.layout.RecursiveGroupLayout} can run without a - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. In this case no layout is calculated, instead the group node bounds are merely adjusted to fit - * their respective contents. - *

- *

- * Features There are two alternatives for applying different layout styles to the contents of group nodes: - *

- *
    - *
  1. - * Mapping each group node to a corresponding {@link yfiles.layout.ILayoutAlgorithm layout algorithm} by registering a {@link yfiles.algorithms.IDataProvider} with key - * {@link yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY}. The content of the hierarchy root is arranged with the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *
  2. - *
  3. Using {@link yfiles.layout.LayoutMultiplexer} as {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}.
  4. - *
- *

- * Since {@link yfiles.layout.RecursiveGroupLayout} delegates the actual arrangement of the graph to other layout algorithms, it - * will support the same features as the currently used layout algorithm. - *

- *

- * The improvement of the routing of inter-edges is based on the {@link yfiles.layout.RecursiveGroupLayout#autoAssignPortCandidates insertion} of {@link yfiles.layout.PortCandidate}s or the {@link yfiles.layout.RecursiveGroupLayout#replacePortConstraints conversion} - * of {@link yfiles.layout.PortConstraint}s into {@link yfiles.layout.PortCandidate}s. Hence, they only work well if the applied layout - * algorithm supports {@link yfiles.layout.PortCandidate}s. - *

- *

- * This algorithm also provides a {@link yfiles.layout.RecursiveGroupLayout#fromSketchMode From Sketch mode} that should be activated if the applied layout algorithm runs in From - * Sketch mode, too. Otherwise, the initial coordinates may not be considered correctly. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface RecursiveGroupLayout extends yfiles.layout.LayoutStageBase{} - export class RecursiveGroupLayout { - /** - * Creates a new instance of {@link yfiles.layout.RecursiveGroupLayout} with default settings using the given {@link yfiles.layout.ILayoutAlgorithm layout algorithm} and - * {@link yfiles.layout.IGroupBoundsCalculator} implementation. - * @param core the layout algorithm that is applied in each step of the recursion - * @param gbc the {@link } for calculating group sizes - */ - constructor(core:yfiles.layout.ILayoutAlgorithm,gbc:yfiles.layout.IGroupBoundsCalculator); - /** - * Creates a new instance of {@link yfiles.layout.RecursiveGroupLayout} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The layout algorithm that is applied in each recursion step. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Reroutes the given inter-edges using the current {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter edge routing algorithm}. - *

- * This method is called after calculating the overall layout when the positions of all nodes and normal edges are fixed. - *

- *

- * If no {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter inter-edge router} is specified, this method {@link yfiles.layout.LayoutGraphUtilities#resetPath resets the path} of all inter-edges that don't connect to the proper - * location within the group. This may happen for inter-edges without - * {@link yfiles.layout.PortCandidate}s or if the applied layout algorithm doesn't support such constraints. - *

- * @param graph the input graph - * @param interEdges the edges which traverse the boundary of a group node - * @see yfiles.layout.RecursiveGroupLayout#autoAssignPortCandidates - * @see yfiles.layout.RecursiveGroupLayout#replacePortConstraints - * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter - * @protected - */ - routeInterEdges(graph:yfiles.layout.LayoutGraph,interEdges:yfiles.algorithms.EdgeList):void; - /** - * Data provider key for arranging the content of each group node with an individual layout algorithm - *

- * The specified layouter instance is applied to the content of the group node. To arrange the top level elements the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} - * is used. - *

- * @see yfiles.layout.RecursiveGroupLayout#NULL_LAYOUT - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static GROUP_NODE_LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning source split ids to edges connecting to group nodes - *

- * The edges will be aligned with edges that connect to the same group node and have the same split id at their source - * (preferably) or target. - *

- * @see yfiles.layout.RecursiveGroupLayout#TARGET_SPLIT_ID_DP_KEY - * @see yfiles.hierarchic.HierarchicLayout - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_SPLIT_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning target split ids to edges connecting to group nodes - *

- * The edges will be aligned with edges that connect to the same group node and have the same split id at their source or - * target (preferably). - *

- * @see yfiles.layout.RecursiveGroupLayout#SOURCE_SPLIT_ID_DP_KEY - * @see yfiles.hierarchic.HierarchicLayout - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_SPLIT_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * A constant that represents a {@link yfiles.layout.ILayoutAlgorithm} implementation that does nothing. - *

- * This implementation can be assigned to group nodes to keep their content unchanged. The layout algorithm will still - * calculate the sizes of the group nodes. - *

- * @const - * @static - * @type {yfiles.layout.ILayoutAlgorithm} - */ - static NULL_LAYOUT:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets whether or not to consider the initial coordinates of the graph elements. - *

- * When using the initial coordinates, {@link yfiles.layout.RecursiveGroupLayout} sets the coordinates of the nodes to their - * initial position before the corresponding {@link yfiles.layout.ILayoutAlgorithm layout algorithm} is called. - *

- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Gets or sets whether or not temporary {@link yfiles.layout.PortCandidate}s are inserted to improve the routing of inter-edges. - *

- * If enabled, {@link yfiles.layout.RecursiveGroupLayout} will insert {@link yfiles.layout.PortCandidate}s for all inter-edges that cross a - * group node border. Those {@link yfiles.layout.PortCandidate}s are located at the relative position of the real source/target - * node. Inter-edges that connect to such {@link yfiles.layout.PortCandidate}s will be routed when the layout of the containing - * group node is calculated and will not be {@link yfiles.layout.RecursiveGroupLayout#routeInterEdges rerouted} later. This may produce more suitable edge routes but cannot prevent - * edges from crossing nodes. - *

- *

- * Without temporary or user specified {@link yfiles.layout.PortCandidate}s, inter-edges will always end at the border/center of - * the corresponding group node. Thus, they are rerouted afterwards using an {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter edge routing algorithm}. - *

- * @see yfiles.layout.RecursiveGroupLayout#routeInterEdges - * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter - * @see yfiles.layout.PortCandidate - * @type {boolean} - */ - autoAssignPortCandidates:boolean; - /** - * Gets or sets whether or not {@link yfiles.layout.PortConstraint}s of inter-edges are temporarily replaced by - * {@link yfiles.layout.PortCandidate}s. - *

- * If disabled, inter-edges will always end at the border/center of the corresponding group node, even if those edges have - * port constraints. Thus, they are {@link yfiles.layout.RecursiveGroupLayout#routeInterEdges rerouted} later without considering the constraint. Enabling this settings may produce - * more suitable edge routes but cannot prevent edges from crossing nodes. - *

- *

- * Port candidates are automatically redirected to their original location. Hence, enabling this option may produce more - * suitable edge routes if the layout algorithm applied to the content of a group node can handle port candidates. - *

- * @see yfiles.layout.RecursiveGroupLayout#routeInterEdges - * @see yfiles.layout.PortCandidate - * @type {boolean} - */ - replacePortConstraints:boolean; - /** - * Gets or sets whether empty group nodes are handled like group nodes with content or like normal nodes. - *

- * If they are handled like other group nodes, {@link yfiles.layout.RecursiveGroupLayout} will resize them according to their - * (non-existing) content. This results in small empty group nodes. Handled like normal nodes, empty group nodes will keep - * their initial size. - *

- * @type {boolean} - */ - considerEmptyGroups:boolean; - /** - * Gets or sets the current edge routing algorithm for handling inter-edges. - *

- * During layout, edges that connect from outside a group node to the content inside (inter-edges) are temporarily - * connected to the group node itself. Hence, these edges have to be routed after restoring the original graph structure - * using this edge routing algorithm. - *

- *

- * It is required that a suitable {@link yfiles.layout.RecursiveGroupLayout#interEdgesDpKey selection key} is specified. The same selection key must be used for setting the sphere of - * action for the edge router. - *

- * @see yfiles.layout.RecursiveGroupLayout#interEdgesDpKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - interEdgeRouter:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key for marking the inter-edges to be routed. - *

- * The key should be used by the specified {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter inter-edge routing algorithm} to obtain the edges to be routed. This layouter - * automatically marks these edges and registers the {@link yfiles.algorithms.IDataProvider} using the specified key. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter - * @type {any} - */ - interEdgesDpKey:any; - /** - * Gets or sets a {@link yfiles.layout.IGroupBoundsCalculator} which computes the sizes of all group nodes. - *

- * This {@link yfiles.layout.IGroupBoundsCalculator} is used each time after calculating the layout for a content graph. - *

- * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.RecursiveGroupLayout; - } - /** - * A {@link yfiles.layout.ILayoutStage} that temporarily removes all nodes and edges with NaN-coordinates. - *

- * This layout stage may be necessary when a {@link yfiles.layout.ILayoutAlgorithm} takes the initial coordinates into account. In - * this case initial coordinates containing NaN-values, can cause exceptions or strange results. - *

- *

- * Layouters that consider initial coordinates: - *

- *
    - *
  • {@link yfiles.hierarchic.HierarchicLayout} in incremental mode
  • - *
  • {@link yfiles.orthogonal.OrthogonalLayout} with activated from sketch drawing
  • - *
  • {@link yfiles.organic.OrganicLayout} for a subset of nodes
  • - *
  • {@link yfiles.tree.TreeLayout} when using a from sketch comparator.
  • - *
  • {@link yfiles.tree.BalloonLayout} in incremental mode
  • - *
  • {@link yfiles.partial.PartialLayout}
  • - *
  • - * all edge routing algorithms: {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter}, {@link yfiles.router.BusRouter}, - * {@link yfiles.router.OrganicEdgeRouter} - *
  • - *
- *

- * Since this stage only hides the invalid graph elements and doesn't apply any new coordinates, it is not defined where - * those nodes and edges will be placed within the calculated layout. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface HandleNaNCoordinatesStage extends yfiles.layout.LayoutStageBase{} - export class HandleNaNCoordinatesStage { - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.HandleNaNCoordinatesStage; - } - /** - * {@link yfiles.layout.IEdgeLabelLayout} defines the properties of one edge label from the perspective of a labeling algorithm. - *

- * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding - * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. - *

- * @interface - * @implements {yfiles.layout.ILabelLayout} - */ - export interface IEdgeLabelLayout extends yfiles.lang.Object,yfiles.layout.ILabelLayout{ - /** - * Gets the label model that describes the valid locations for this label. - * @abstract - * @type {yfiles.layout.IEdgeLabelLayoutModel} - */ - labelModel:yfiles.layout.IEdgeLabelLayoutModel; - /** - * Gets the preferred placement for this edge label, which can be considered by {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - * @abstract - * @type {yfiles.layout.PreferredPlacementDescriptor} - */ - preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; - } - var IEdgeLabelLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IEdgeLabelLayout; - }; - /** - * This interface defines the properties of the model associated with an {@link yfiles.layout.IEdgeLabelLayout}. - *

- * An {@link yfiles.layout.IEdgeLabelLayoutModel} provides a set of possible candidates for the placement of an edge label. It also defines a - * parameter that describes the current location of the label. - *

- *

- * It is important that all state information is encapsulated in the {@link yfiles.layout.IEdgeLabelLayoutModel#createModelParameter model parameter}. {@link yfiles.layout.IEdgeLabelLayoutModel} - * instances may be shared between multiple edge labels but produce different parameters for labels with different - * locations. - *

- * @interface - */ - export interface IEdgeLabelLayoutModel extends yfiles.lang.Object{ - /** - * Creates a model parameter that represents the given edge label position within this model. - *

- * The created model parameter is the closest parameter representation of the given label location that can be achieved - * within this model. - *

- *

- * This parameter can be passed to {@link yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement} to retrieve the current label - * box. - *

- *

- * A model parameter can be an arbitrary {@link any}. However it must contain all information to allow restoring of the encoded - * location with this {@link yfiles.layout.IEdgeLabelLayoutModel}. - *

- * @param labelBounds the oriented box of the label, encoding the label location for which the parameter should be created - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns the model parameter representing the given label location - * @see yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement - * @abstract - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):any; - /** - * Returns all {@link yfiles.layout.EdgeLabelCandidate}s that describe valid label positions within this model. - *

- * In case the implementing {@link yfiles.layout.IEdgeLabelLayoutModel} allows every possible location, this method always returns - * the current location as a {@link yfiles.layout.LabelCandidate}. - *

- * @param labelLayout the label for which candidates should be generated - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns a list of {@link } instances - * @abstract - */ - getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * Returns the oriented box of the label for the position encoded by the given model parameter. - * @param labelSize the width and height of the label - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @param parameter the model parameter that describes the abstract position of the label within this model - * @returns the oriented bounds of the label - * @abstract - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,parameter:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets a model parameter that encodes the default position of this model's allowed edge label positions. - *

- * This parameter can be passed to {@link yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- * @abstract - * @type {any} - */ - defaultParameter:any; - } - var IEdgeLabelLayoutModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IEdgeLabelLayoutModel; - }; - /** - * An {@link yfiles.layout.IEdgeLayout} encapsulates the layout information for an edge. - *

- * The layout information consists of the two end points of the edge layout and a sequence of control points that determine - * the visual path of the edge. - *

- * @interface - */ - export interface IEdgeLayout extends yfiles.lang.Object{ - /** - * Adds a control point to the end of the control point sequence. - * @param x the absolute x-coordinate of the new control point - * @param y the absolute y-coordinate of the new control point - * @abstract - */ - addPoint(x:number,y:number):void; - /** - * Removes all control points from this edge layout. - *

- * The {@link yfiles.layout.IEdgeLayout} still keeps the {@link yfiles.layout.IEdgeLayout#sourcePoint source point} and the {@link yfiles.layout.IEdgeLayout#targetPoint target point}. - *

- * @abstract - */ - clearPoints():void; - /** - * Returns the control point at the given position in the sequence of control points. - *

- * The first control point in the sequence has index 0 and the last control point has index {@link yfiles.layout.IEdgeLayout#pointCount} - * -1. - *

- * @param index the position of the control point in the control point sequence - * @returns the absolute coordinates of the control point at the given index - * @see yfiles.layout.IEdgeLayout#setPoint - * @abstract - */ - getPoint(index:number):yfiles.algorithms.YPoint; - /** - * Returns the number of control points of the edge. - *

- * The source and target points are not included in the point count. - *

- * @returns the number of control points - * @abstract - */ - pointCount():number; - /** - * Sets the absolute coordinates of the control point at the given position in the sequence of control points. - *

- * The first control point in the sequence has index 0 and the last control point has index {@link yfiles.layout.IEdgeLayout#pointCount} - * -1. - *

- * @param index the position of the changing control point in the sequence - * @param x the new absolute x-coordinate of the control point at the given index - * @param y the new absolute y-coordinate of the control point at the given index - * @abstract - */ - setPoint(index:number,x:number,y:number):void; - /** - * Gets or sets the relative coordinates of the first end point of this layout. - *

- * These coordinates are relative to the center location of the edge's source node. To obtain the absolute coordinates of - * the end point, the relative coordinates have to be added to the center coordinates of the source - * {@link yfiles.layout.INodeLayout}. - *

- * @see yfiles.layout.LayoutGraph#getCenterX - * @see yfiles.layout.LayoutGraph#getCenterY - * @see yfiles.layout.INodeLayout#x - * @see yfiles.layout.INodeLayout#y - * @abstract - * @type {yfiles.algorithms.YPoint} - */ - sourcePoint:yfiles.algorithms.YPoint; - /** - * Gets or sets the relative coordinates of the second end point of this layout. - *

- * These coordinates are relative to the center location of the edge's target node. To obtain the absolute coordinates of - * the end point, the relative coordinates have to be added to the center coordinates of the target - * {@link yfiles.layout.INodeLayout}. - *

- * @see yfiles.layout.LayoutGraph#getCenterX - * @see yfiles.layout.LayoutGraph#getCenterY - * @see yfiles.layout.INodeLayout#x - * @see yfiles.layout.INodeLayout#y - * @abstract - * @type {yfiles.algorithms.YPoint} - */ - targetPoint:yfiles.algorithms.YPoint; - } - var IEdgeLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IEdgeLayout; - }; - /** - * An {@link yfiles.layout.IIntersectionCalculator} is responsible for calculating the intersection point between an edge and the - * visual representation of its source or target node. - *

- * This interface is especially useful in conjunction with {@link yfiles.layout.PortCalculator} when adjusting the final port - * locations after the layout is calculated. - *

- * @see yfiles.layout.PortCalculator - * @interface - */ - export interface IIntersectionCalculator extends yfiles.lang.Object{ - /** - * Calculates an intersection point between the edge and the given {@link yfiles.layout.INodeLayout}. - *

- * Implementing classes use a point on the connecting edge segment (specified with an offset to the node's center) along - * with a direction pointing to the node and calculate the intersection between this line and the node. - *

- * @param nodeLayout the layout information of the node - * @param xOffset the x-coordinate of a point on the last line segment relative to the node's center - * @param yOffset the y-coordinate of a point on the last line segment relative to the node's center - * @param dx the x-component of the normalized direction vector indicating the direction of the segment pointing towards the node - * @param dy the y-component of the normalized direction vector indicating the direction of the segment pointing towards the node - * @returns the intersection coordinates relative to the node's center or null if no such intersection was found - * @abstract - */ - calculateIntersectionPoint(nodeLayout:yfiles.layout.INodeLayout,xOffset:number,yOffset:number,dx:number,dy:number):yfiles.algorithms.YPoint; - } - var IIntersectionCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IIntersectionCalculator; - }; - /** - * Helper class that declares several keys for {@link yfiles.algorithms.IDataProvider} that provide - * {@link yfiles.layout.IIntersectionCalculator}. - * @class - * @static - */ - export interface IntersectionCalculatorKeys extends yfiles.lang.Object{} - export class IntersectionCalculatorKeys { - /** - * Data provider key for providing an individual intersection calculation for each edge source in the graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_INTERSECTION_CALCULATOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for providing an individual intersection calculation for each edge target in the graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_INTERSECTION_CALCULATOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.IntersectionCalculatorKeys; - } - /** - * {@link yfiles.layout.ILabelLayout} defines the properties of a label from the perspective of a labeling algorithm. - *

- * Both node and edge labels need to implement this interface. It describes the size and position of a label. - *

- *

- * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding - * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. - *

- * @interface - */ - export interface ILabelLayout extends yfiles.lang.Object{ - /** - * Gets the bounding box of the label. - *

- * The bounding box is the smallest, paraxial rectangle that contains the whole label. - *

- * @abstract - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - /** - * Gets the box of the label. - *

- * This box matches the area that is covered by the label. The {@link yfiles.algorithms.YOrientedRectangle#setUpVector up vector} of the rectangle encodes the orientation of the - * label. - *

- * @abstract - * @type {yfiles.algorithms.YOrientedRectangle} - */ - orientedBox:yfiles.algorithms.YOrientedRectangle; - /** - * Gets or sets the label model parameter that describes the position of this label. - *

- * The model parameter must fit the according label model. - *

- * @abstract - * @type {any} - */ - modelParameter:any; - } - var ILabelLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.ILabelLayout; - }; - /** - * {@link yfiles.layout.ILabelLayoutFactory} provides methods to create, add and remove node/edge labels for - * {@link yfiles.layout.LayoutGraph}s. - *

- * It can be used, e.g., to temporarily add labels during layout calculation. - *

- *

- * Note that original labels which are removed during a layout calculation have to be re-added when the layout calculation - * is done. - *

- *

- * An instance of this factory can be obtained with method {@link yfiles.layout.LayoutGraphUtilities#getLabelFactory}. This method - * uses the {@link yfiles.layout.LayoutGraph#createLabelFactory} method to create the factory. - *

- *

- * Note that each factory instance is bound to a specific graph instance, i.e., you can only create, add and remove labels - * for the graph which was given to method {@link yfiles.layout.LayoutGraphUtilities#getLabelFactory}. - *

- * @interface - */ - export interface ILabelLayoutFactory extends yfiles.lang.Object{ - /** - * Adds the given {@link yfiles.layout.IEdgeLabelLayout} to the given edge. - *

- * The given {@link yfiles.layout.ILabelLayout} has to be created with method {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout} - * or {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout}. - *

- * @param edge the edge - * @param labelLayout the edge label layout that should be added to the given edge - * @throws {Stubs.Exceptions.ArgumentError} if the given label layout has already been added to the graph - * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout - * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout - * @abstract - */ - addLabelLayout(edge:yfiles.algorithms.Edge,labelLayout:yfiles.layout.IEdgeLabelLayout):void; - /** - * Adds the given node label layout to the given node. - *

- * The given label layout has to be created with method {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout} or - * {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout}. - *

- * @param node the node - * @param labelLayout the node label layout that should be added to the given node - * @throws {Stubs.Exceptions.ArgumentError} if the given label layout has already been added to the graph - * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout - * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout - * @abstract - */ - addLabelLayout(node:yfiles.algorithms.Node,labelLayout:yfiles.layout.INodeLabelLayout):void; - /** - * Creates a new {@link yfiles.layout.ILabelLayout} for the given edge. - * @param edge the edge - * @param orientedBox the box specifying the size and location of the label - * @param model specifies the model of the created edge label - * @param descriptor specifies the preferred placement descriptor of the created label. If this value is - * null, the default descriptor is used - * @returns a new edge label layout - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - createLabelLayout(edge:yfiles.algorithms.Edge,orientedBox:yfiles.algorithms.YOrientedRectangle,model:yfiles.layout.IEdgeLabelLayoutModel,descriptor:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.IEdgeLabelLayout; - /** - * Creates a new {@link yfiles.layout.ILabelLayout} for the given node. - * @param node the node - * @param orientedBox the box specifying the size and location of the label - * @param model specifies the model of the created node label - * @returns a new node label layout - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - createLabelLayout(node:yfiles.algorithms.Node,orientedBox:yfiles.algorithms.YOrientedRectangle,model:yfiles.layout.INodeLabelLayoutModel):yfiles.layout.INodeLabelLayout; - /** - * Creates a new {@link yfiles.layout.ILabelLayout} for the given edge. - *

- * This method should create a {@link yfiles.layout.ILabelLayout} with an {@link yfiles.layout.IEdgeLabelLayoutModel} that supports the - * desired oriented label box exactly as given. - *

- * @param edge the edge - * @param orientedBox the box specifying the size and location of the label - * @returns a new edge label layout - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - createLabelLayout(edge:yfiles.algorithms.Edge,orientedBox:yfiles.algorithms.YOrientedRectangle):yfiles.layout.IEdgeLabelLayout; - /** - * Creates a new {@link yfiles.layout.ILabelLayout} for the given node. - *

- * This method should create a {@link yfiles.layout.ILabelLayout} with a {@link yfiles.layout.INodeLabelLayoutModel} that supports the - * desired oriented label box exactly as given. - *

- * @param node the node - * @param orientedBox the box specifying the size and location of the label - * @returns a new node label layout - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - createLabelLayout(node:yfiles.algorithms.Node,orientedBox:yfiles.algorithms.YOrientedRectangle):yfiles.layout.INodeLabelLayout; - /** - * Removes the given {@link yfiles.layout.IEdgeLabelLayout} from the given edge. - * @param edge the edge - * @param labelLayout the label layout that should be removed from the given edge - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - removeLabelLayout(edge:yfiles.algorithms.Edge,labelLayout:yfiles.layout.IEdgeLabelLayout):void; - /** - * Removes the given node label layout from the given node. - * @param node the node - * @param labelLayout the label layout that should be removed from the given node - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - removeLabelLayout(node:yfiles.algorithms.Node,labelLayout:yfiles.layout.INodeLabelLayout):void; - /** - * Gets the graph associated with this label factory instance. - * @abstract - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - } - var ILabelLayoutFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.ILabelLayoutFactory; - }; - /** - * {@link yfiles.layout.ILayoutAlgorithm} describes the general interface for algorithms that perform a layout process on a - * {@link yfiles.layout.LayoutGraph}. - *

- * The main method for invoking the layout calculation is - * {@link yfiles.layout.ILayoutAlgorithm#applyLayout}. Implementing classes will arrange the graph there. - *

- *

- * This class also provides keys to register {@link yfiles.algorithms.IDataProvider}s with the graph that contain information about - * the nodes and edges in the graph. {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.layout.LayoutKeys#NODE_ID_DP_KEY} - * and {@link yfiles.layout.LayoutKeys#EDGE_ID_DP_KEY} contain unique identifiers for both nodes and edges. These identifiers allow - * for ensuring consistent results even if the order of nodes and edges was changed between two layout runs. - *
- * The selection state of nodes and edges is stored in {@link yfiles.algorithms.IDataProvider}s registered with the keys {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} - * and - * {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. Based on this information, the layout algorithm may reduce its - * calculations to the selected subset of nodes or edges. - *

- * @interface - */ - export interface ILayoutAlgorithm extends yfiles.lang.Object{ - /** - * Main layout routine that assigns new layout information to the given graph. - *

- * The call to this routine will only succeed if the layout algorithm can handle the input graph. - *

- * @param graph the input graph - * @abstract - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - } - var ILayoutAlgorithm:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.ILayoutAlgorithm; - }; - /** - * Helper class that provides unique identifiers for some general purpose {@link yfiles.algorithms.IDataProvider data providers}. - * @class - * @static - */ - export interface LayoutKeys extends yfiles.lang.Object{} - export class LayoutKeys { - /** - * Data provider key for looking up a unique identifier for each node in a graph - *

- * Layout algorithms may use this information to provide consistent layouts for multiple runs. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for looking up a unique identifier for each edge in a graph - *

- * Layout algorithms may use this information to provide consistent layouts for multiple runs. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for looking up the selected state of the nodes in the graph - *

- * A layout algorithm can retrieve a {@link yfiles.algorithms.IDataProvider} registered with this key to apply a special handling - * to the selected nodes. For example, the layout algorithm may restrict its scope, i.e., it only arranges the selected - * nodes. - *

- *

- * However, it is often more convenient to use a specific {@link yfiles.algorithms.IDataProvider} key for this purpose, e.g., if - * you want to combine two layout algorithms of the same kind which have to operate on different subsets of the graph. - * Thus, these algorithms may provide a method like setSubgraphNodesDpKey(Object) that customizes the {@link yfiles.algorithms.IDataProvider} - * key allowing to specify different sets of selected nodes for nested layout algorithms. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for looking up the selected state of the edges in the graph - *

- * A layout algorithm can retrieve a {@link yfiles.algorithms.IDataProvider} registered with this key to apply a special handling - * to the selected edges. For example, the layout algorithm may restrict its scope, i.e., it only routes the selected - * edges. - *

- *

- * However, it is often more convenient to use a specific {@link yfiles.algorithms.IDataProvider} key for this purpose, e.g., if - * you want to combine two layout algorithms of the same kind which have to operate on different subsets of the graph. - * Thus, these algorithms may provide a method like setSubgraphEdgesDpKey(Object) that customizes the {@link yfiles.algorithms.IDataProvider} - * key allowing to specify different sets of selected edges for nested layout algorithms. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutKeys; - } - /** - * A {@link yfiles.layout.ILayoutStage} is a layout algorithm that represents a stage of a larger layout process. - *

- * It delegates the core layout process to another {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. Implementing classes may perform pre-processing steps - * before the {@link yfiles.layout.ILayoutStage#coreLayout core layout algorithm} gets called and post-processing steps afterwards. - *

- * @see yfiles.layout.MultiStageLayout - * @interface - * @implements {yfiles.layout.ILayoutAlgorithm} - */ - export interface ILayoutStage extends yfiles.lang.Object,yfiles.layout.ILayoutAlgorithm{ - /** - * Gets or sets the core layout algorithm. - *

- * This algorithm is wrapped by this stage. It is invoked in {@link yfiles.layout.ILayoutAlgorithm#applyLayout}. The {@link yfiles.layout.ILayoutStage} - * may add pre- and post-processing steps before and after calling the core layout algorithm. - *

- * @abstract - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - } - var ILayoutStage:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.ILayoutStage; - }; - /** - * {@link yfiles.layout.INodeLabelLayout} defines the properties of one node label from the perspective of a labeling algorithm. - *

- * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding - * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. - *

- * @interface - * @implements {yfiles.layout.ILabelLayout} - */ - export interface INodeLabelLayout extends yfiles.lang.Object,yfiles.layout.ILabelLayout{ - /** - * Gets the label model that describes the valid locations for this label. - * @abstract - * @type {yfiles.layout.INodeLabelLayoutModel} - */ - labelModel:yfiles.layout.INodeLabelLayoutModel; - } - var INodeLabelLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.INodeLabelLayout; - }; - /** - * {@link yfiles.layout.INodeLabelLayoutModel} defines the properties of the model associated with a - * {@link yfiles.layout.INodeLabelLayout}. - *

- * A {@link yfiles.layout.INodeLabelLayoutModel} provides a set of possible candidates for the placement of a node label. It also defines a parameter - * that describes the current location of the label. - *

- *

- * It is important that all state information is encapsulated in the {@link yfiles.layout.INodeLabelLayoutModel#createModelParameter model parameter}. {@link yfiles.layout.INodeLabelLayoutModel} - * instances may be shared between multiple node labels but produce different parameters for labels with different - * locations. - *

- * @interface - */ - export interface INodeLabelLayoutModel extends yfiles.lang.Object{ - /** - * Creates a model parameter that represents the given node label position within this model. - *

- * The created model parameter is the closest parameter representation of the given label location that can be achieved - * within this model. - *

- *

- * This parameter can be passed to {@link yfiles.layout.INodeLabelLayoutModel#getLabelPlacement} to retrieve the current label - * box. - *

- *

- * A model parameter can be an arbitrary {@link any}. However it must contain all information to allow restoring of the encoded - * location with this {@link yfiles.layout.INodeLabelLayoutModel}. - *

- * @param labelBounds the box of the label, encoding the label location for which the parameter should be created - * @param nodeLayout the layout of the node to which the label belongs - * @returns the model parameter representing the given label location - * @see yfiles.layout.INodeLabelLayoutModel#getLabelPlacement - * @abstract - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):any; - /** - * Returns all {@link yfiles.layout.NodeLabelCandidate}s that describe valid label positions within this model. - *

- * In case the implementing {@link yfiles.layout.INodeLabelLayoutModel} allows every possible location, this method always returns - * the current location as a {@link yfiles.layout.LabelCandidate}. - *

- * @param labelLayout the label for which candidates should be generated - * @param nodeLayout the layout of the node to which the label belongs - * @returns a list of {@link } instances - * @abstract - */ - getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * Returns the bounds of the label for the position encoded by the given model parameter. - * @param labelSize the width and height of the label - * @param nodeLayout the layout of the node to which the label belongs - * @param param the model parameter that describes the abstract position of the label within this model - * @returns the oriented box of the label - * @abstract - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets a model parameter that encodes the default position of this model's allowed node label positions. - *

- * This parameter can be passed to {@link yfiles.layout.INodeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- * @abstract - * @type {any} - */ - defaultParameter:any; - } - var INodeLabelLayoutModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.INodeLabelLayoutModel; - }; - /** - * A {@link yfiles.layout.INodeLayout} encapsulates the layout information for a node. - *

- * The layout information consists of the size and position of the node. - *

- * @interface - */ - export interface INodeLayout extends yfiles.lang.Object{ - /** - * Sets the coordinates of the upper-left corner of the node. - * @param x the new x-coordinate of the node - * @param y the new y-coordinate of the node - * @abstract - */ - setLocation(x:number,y:number):void; - /** - * Sets the size of the node. - * @param width the new width of the node - * @param height the new height of the node - * @abstract - */ - setSize(width:number,height:number):void; - /** - * Gets the x-coordinate of the upper-left corner of the node. - *

- * The location of the node is described by the coordinates of the upper-left corner of the node. - *

- * @abstract - * @type {number} - */ - x:number; - /** - * Gets the y-coordinate of the upper-left corner of the node. - *

- * The location of the node is described by the coordinates of the upper-left corner of the node. - *

- * @abstract - * @type {number} - */ - y:number; - /** - * Gets the width of the node. - *

- * The width of the node is the horizontal distance the node spans. - *

- * @abstract - * @type {number} - */ - width:number; - /** - * Gets the height of the node. - *

- * The height of the node is the vertical distance the node spans. - *

- * @abstract - * @type {number} - */ - height:number; - } - var INodeLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.INodeLayout; - }; - /** - * An {@link yfiles.layout.IPartitionInterEdgeRouter} is responsible for routing inter-edges. - *

- * An inter-edge is an edge that connects nodes that belong to different partitions. - *

- * @interface - */ - export interface IPartitionInterEdgeRouter extends yfiles.lang.Object{ - /** - * Routes inter-edges of the partitioned graph. - * @param graph the input graph - * @param partitionIDDP the partition ID for each node in the graph - * @param interEdgeDP the map that marks inter-edges - * @abstract - */ - routeInterEdges(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; - /** - * Gets or sets whether or not to route inter-edges only. - *

- * Inter-edges are edges that connect nodes from different partitions. If this feature is disabled, all edges are routed by - * this routing algorithm. - *

- * @abstract - * @type {boolean} - */ - routeInterEdgesOnly:boolean; - } - var IPartitionInterEdgeRouter:{ - /** - * Routes inter-edges using {@link yfiles.router.ChannelEdgeRouter}. - * @param [router=null] The router instance to use for the edge routing. If not specified, a internal instance is used. - * @returns - * @static - */ - createChannelInterEdgeRouter?(router?:yfiles.router.ChannelEdgeRouter):yfiles.layout.IPartitionInterEdgeRouter; - /** - * Routes inter-edges using {@link yfiles.router.EdgeRouter}. - * @param [router=null] The router instance to use for the edge routing. If not specified, a internal instance is used. - * @returns - * @static - */ - createPolylineInterEdgeRouter?(router?:yfiles.router.EdgeRouter):yfiles.layout.IPartitionInterEdgeRouter; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPartitionInterEdgeRouter; - }; - /** - * A {@link yfiles.layout.IProfitModel} ranks - * {@link yfiles.layout.LabelCandidate}s used for prioritizing certain label locations over others. - *

- * Generic labeling algorithm {@link yfiles.labeling.GenericLabeling} will use the ranking to decide which - * {@link yfiles.layout.LabelCandidate}s to eliminate. - *

- *

- * {@link yfiles.layout.LabelCandidate}s with a high profit will be preferred over - * {@link yfiles.layout.LabelCandidate}s with a low profit. - *

- * @interface - */ - export interface IProfitModel extends yfiles.lang.Object{ - /** - * Returns the profit for placing a label using the given {@link yfiles.layout.LabelCandidate}. - *

- * Higher profit means better candidates. Hence, there is a higher probability that the candidate is chosen by a labeling - * algorithm. - *

- *

- * Profits need to have a value between 0 and 1. - *

- * @param candidate the candidate - * @returns the profit of the candidate - * @abstract - */ - getProfit(candidate:yfiles.layout.LabelCandidate):number; - } - var IProfitModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IProfitModel; - }; - /** - * A {@link yfiles.layout.LabelCandidate} describes one valid placement for a label considering the label model. - *

- * Generic labeling algorithms place labels according to their label model. To get valid locations for the label, the label - * model generates various - * {@link yfiles.layout.LabelCandidate}s. One of these candidates will be chosen to provide the actual placement of the label. - *

- * @see yfiles.layout.INodeLabelLayoutModel - * @see yfiles.layout.IEdgeLabelLayoutModel - * @see yfiles.labeling.GenericLabeling - * @class - * @implements {yfiles.algorithms.IPlaneObject} - */ - export interface LabelCandidate extends yfiles.lang.Object,yfiles.algorithms.IPlaneObject{} - export class LabelCandidate { - /** - * Creates a new instance of {@link yfiles.layout.LabelCandidate} described by location, size, model parameter and internal flag. - * @param pos the location of the upper left corner of the candidate - * @param size the size of the candidate - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.ILabelLayout,internal?:boolean); - /** - * Creates a new instance of {@link yfiles.layout.LabelCandidate} described by its box, model parameter and internal flag. - * @param labelBox the box that specifies the candidate's size and position - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.ILabelLayout,internal?:boolean); - /** - * Replaces the model parameter and box of the owner with the model parameter and box of this candidate. - *

- * When this candidate is chosen to provide the placement of the label, this method transfers the model parameter and the - * candidate box to the {@link yfiles.layout.ILabelLayout}. - *

- * @see yfiles.layout.LabelCandidate#owner - * @see yfiles.layout.LabelCandidate#modelParameter - * @see yfiles.layout.LabelCandidate#box - */ - propagate():void; - /** - * Gets or sets the custom profit for this candidate. - *

- * The profit describes the priority of this candidate with respect to other candidates. Labeling algorithms will use the - * profit to decide which candidate to choose. - *

- *

- * The value is restricted to the interval [0,1], where 1 specifies the highest possible profit. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value lies outside of [0,1] - * @type {number} - */ - customProfit:number; - /** - * Gets the model parameter that was used by the underlying model to generate this label candidate. - * @type {any} - */ - modelParameter:any; - /** - * Gets the coordinates of the upper-left corner of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#boundingBox - * @type {yfiles.algorithms.YPoint} - */ - location:yfiles.algorithms.YPoint; - /** - * Gets the width and height of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#boundingBox - * @type {yfiles.algorithms.YDimension} - */ - size:yfiles.algorithms.YDimension; - /** - * Gets the minimum x-coordinate of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#location - * @see yfiles.layout.LabelCandidate#boundingBox - * @type {number} - */ - x:number; - /** - * Gets the minimum y-coordinate of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#location - * @see yfiles.layout.LabelCandidate#boundingBox - * @type {number} - */ - y:number; - /** - * Gets the width of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#size - * @see yfiles.layout.LabelCandidate#boundingBox - * @type {number} - */ - width:number; - /** - * Gets the height of the candidate's bounding box. - *

- * The bounding box is the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#size - * @see yfiles.layout.LabelCandidate#boundingBox - * @type {number} - */ - height:number; - /** - * Gets the bounding box of this candidate. - *

- * The bounding box describes the smallest paraxial box that contains the candidate. - *

- * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - /** - * Gets the oriented box of this candidate. - *

- * If the label is rotated, this box will be oriented accordingly. - *

- * @type {yfiles.algorithms.YOrientedRectangle} - */ - box:yfiles.algorithms.YOrientedRectangle; - /** - * Gets the {@link yfiles.layout.ILabelLayout} for which this candidate was created. - * @type {yfiles.layout.ILabelLayout} - */ - owner:yfiles.layout.ILabelLayout; - /** - * Gets whether or not this candidate describes an internal label. - *

- * Internal labels reside inside the boundaries of a node. - *

- * @type {boolean} - */ - internal:boolean; - /** - * Gets or sets a penalty for a candidate position that overlaps the box of a node. - *

- * The penalty should be a factor between 0 and 1, where 0 means that an overlap is considered unimportant and 1 means that - * an overlap is considered severe. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified penalty is outside [0,1] - * @type {number} - */ - nodeOverlapPenalty:number; - /** - * Gets or sets a penalty for a candidate position that overlaps the path of an edge. - *

- * The penalty should be a factor between 0 and 1, where 0 means that an overlap is considered unimportant and 1 means that - * an overlap is considered severe. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified penalty is outside [0,1] - * @type {number} - */ - edgeOverlapPenalty:number; - /** - * Gets the sum of node overlap penalty and edge overlap penalty. - * @see yfiles.layout.LabelCandidate#edgeOverlapPenalty - * @see yfiles.layout.LabelCandidate#nodeOverlapPenalty - * @type {number} - */ - overlapPenalty:number; - /** - * Gets whether or not this candidate's box had already been chosen by the labeling algorithm. - *

- * If this candidate is propagated, its model parameter and box were transferred to the {@link yfiles.layout.LabelCandidate#owner label}. - *

- * @see yfiles.layout.LabelCandidate#propagate - * @type {boolean} - */ - propagated:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelCandidate; - } - /** - * {@link yfiles.layout.LabelLayoutBase} is the default implementation of the {@link yfiles.layout.ILabelLayout} interface. - * @class - * @implements {yfiles.layout.ILabelLayout} - */ - export interface LabelLayoutBase extends yfiles.lang.Object,yfiles.layout.ILabelLayout{} - export class LabelLayoutBase { - /** - * Creates a new {@link yfiles.layout.LabelLayoutBase} instance. - */ - constructor(); - /** - * Sets the box of the label. - *

- * This box matches the area that is covered by the label. The {@link yfiles.algorithms.YOrientedRectangle#setUpVector up vector} of the rectangle encodes the orientation of the - * label. - *

- * @type {yfiles.algorithms.YOrientedRectangle} - */ - orientedBox:yfiles.algorithms.YOrientedRectangle; - /** - * Sets the bounding box of the label. - *

- * The bounding box is the smallest, paraxial rectangle that contains the whole label. - *

- * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - /** - * - * @type {any} - */ - modelParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelLayoutBase; - } - /** - * {@link yfiles.layout.LabelLayoutData} encapsulates layout information for a label. - *

- * The information is used by clients to inform label-aware {@link yfiles.layout.ILayoutAlgorithm layout algorithms} about labeling constraints like label size - * and preferred placement. - *

- *

- * Label-aware algorithms like {@link yfiles.hierarchic.HierarchicLayout} return the calculated label positions by assigning the - * corresponding box to the provided {@link yfiles.layout.LabelLayoutData} instances. - *

- *

- * {@link yfiles.algorithms.IDataProvider DataProviders} are used for associating an array of {@link yfiles.layout.LabelLayoutData} instances with either the nodes or the - * edges of a {@link yfiles.layout.LayoutGraph}. The {@link yfiles.algorithms.IDataProvider DataProviders} must be registered with the input graph using one of the keys - * defined in {@link yfiles.layout.LabelLayoutKeys}. - *

- * @class - */ - export interface LabelLayoutData extends yfiles.lang.Object{} - export class LabelLayoutData { - /** - * Creates a new instance of {@link yfiles.layout.LabelLayoutData} for a label with the given width and height. - * @param width the width of the label - * @param height the height of the label - */ - constructor(width:number,height:number); - /** - * Creates a new instance of {@link yfiles.layout.LabelLayoutData} for a label with the given oriented box and preferred placement - * descriptor. - * @param bounds the box of the label - * @param [preferredPlacement=null] a preferred placement descriptor - * @throws {Stubs.Exceptions.ArgumentError} if the specified descriptor is null - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LabelLayoutData#preferredPlacementDescriptor - */ - constructor(bounds:yfiles.algorithms.YOrientedRectangle,preferredPlacement?:yfiles.layout.PreferredPlacementDescriptor); - /** - * Specifies the coordinates of the upper-left corner of the bounding box of the label. - * @param x the new x-coordinate of the upper-left corner - * @param y the new y-coordinate of the upper-left corner - * @see yfiles.layout.LabelLayoutData#x - * @see yfiles.layout.LabelLayoutData#y - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - */ - setLocation(x:number,y:number):void; - /** - * Specifies the width and height of the {@link yfiles.layout.LabelLayoutData#bounds oriented box} of this label. - * @param width the width of the oriented box - * @param height the height of the oriented box - * @see yfiles.layout.LabelLayoutData#bounds - */ - setSize(width:number,height:number):void; - /** - * Gets or sets the {@link yfiles.algorithms.YOrientedRectangle oriented box} of the label. - * @type {yfiles.algorithms.YOrientedRectangle} - */ - bounds:yfiles.algorithms.YOrientedRectangle; - /** - * Gets the width of the label's bounding box. - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @type {number} - */ - width:number; - /** - * Gets the height of the label's bounding box. - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @type {number} - */ - height:number; - /** - * Gets the x-coordinate of the upper-left corner of the label's bounding box. - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @type {number} - */ - x:number; - /** - * Gets the y-coordinate of the upper-left corner of the label's bounding box. - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @type {number} - */ - y:number; - /** - * Gets or sets the preferred placement of this label. - * @throws {Stubs.Exceptions.ArgumentError} if the specified descriptor is null - * @type {yfiles.layout.PreferredPlacementDescriptor} - */ - preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelLayoutData; - } - /** - * {@link yfiles.layout.LabelLayoutKeys} are used for associating - * {@link yfiles.algorithms.IDataProvider}s that contain label-specific information for edge and node labels. - *

- * Label-aware layout algorithms like {@link yfiles.hierarchic.HierarchicLayout} may look for such {@link yfiles.algorithms.IDataProvider}s - * that contain {@link yfiles.layout.LabelLayoutData} for each edge. - *

- *

- * Instead of setting up {@link yfiles.layout.LabelLayoutData} and {@link yfiles.algorithms.IDataProvider}s one can also use {@link yfiles.layout.LabelLayoutTranslator} - * to automatically translate information provided by the standard label layout classes {@link yfiles.layout.IEdgeLabelLayout} and - * {@link yfiles.layout.INodeLabelLayout} to layout data accessible through the keys defined below. - *

- * @class - * @static - */ - export interface LabelLayoutKeys extends yfiles.lang.Object{} - export class LabelLayoutKeys { - /** - * Data provider key for accessing label information of each edge in the input graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LABEL_LAYOUT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for accessing label information of each node in the input graph - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_LABEL_LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking labels that should be ignored by the layout algorithm - *

- * A label is ignored if there is a {@link yfiles.algorithms.IDataProvider} registered with this key which returns true for the - * given {@link yfiles.layout.ILabelLayout}. - *

- *

- * The {@link yfiles.layout.LabelLayoutTranslator} only translates labels that should not be ignored. - *

- * @const - * @static - * @type {yfiles.algorithms.ILabelLayoutDpKey.} - */ - static IGNORED_LABELS_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelLayoutKeys; - } - /** - * {@link yfiles.layout.LabelLayoutTranslator} automatically translates label layout information provided by the standard label - * layout classes {@link yfiles.layout.IEdgeLabelLayout} and {@link yfiles.layout.INodeLabelLayout} to layout data of type {@link yfiles.layout.LabelLayoutData} - * that is accessible by the keys defined in class {@link yfiles.layout.LabelLayoutKeys}. - *

- * One can use this {@link yfiles.layout.ILayoutStage} as label layout algorithm of a label-aware layout algorithm like - * {@link yfiles.hierarchic.HierarchicLayout}. This can be done by assigning the stage by an appropriate call to {@link yfiles.layout.MultiStageLayout#labeling setLabelLayouter}. - *

- *

- * When writing the {@link yfiles.layout.LabelLayoutData}, the {@link yfiles.layout.LabelLayoutData#bounds boxes} are set relative. In case of a node label, the box's {@link yfiles.algorithms.YOrientedRectangle#anchor anchor} is - * relative to the center of the owning node. In case of an edge label the box's anchor is relative to the center of the - * source node of the owning edge. - *

- *

- * If {@link yfiles.layout.LabelLayoutTranslator#writeBackNodeLabels writing back node labels} and/or {@link yfiles.layout.LabelLayoutTranslator#writeBackEdgeLabels writing back edge labels} is enabled, the {@link yfiles.layout.LabelLayoutData} is transferred - * back to the {@link yfiles.layout.INodeLabelLayout}s and/or {@link yfiles.layout.IEdgeLabelLayout}s. - *

- *

- * By default, the {@link yfiles.layout.LabelLayoutData#bounds boxes} are now interpreted absolute but by activating {@link yfiles.layout.LabelLayoutTranslator#writeBackRelativeNodeLabelLocation} and/or {@link yfiles.layout.LabelLayoutTranslator#writeBackRelativeEdgeLabelLocation} this can be changed to interpret them - * relative as explained above. - *

- *

- * Note that care must be taken on the choice of the label model that is used by the classes {@link yfiles.layout.IEdgeLabelLayout} - * and {@link yfiles.layout.INodeLabelLayout}. The calculated label positions must be consistent with the label positions allowed - * by the label model. The best label layout results are achieved by choosing {@link yfiles.layout.FreeEdgeLabelLayoutModel} for - * edge layouts and {@link yfiles.layout.FreeNodeLabelLayoutModel} for node layouts. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface LabelLayoutTranslator extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class LabelLayoutTranslator { - /** - * Creates a new {@link yfiles.layout.LabelLayoutTranslator} instance with default settings. - */ - constructor(); - /** - * Translates traditional {@link yfiles.layout.ILabelLayout} information to {@link yfiles.algorithms.IDataProvider}-based - * {@link yfiles.layout.LabelLayoutData}. - *

- * Afterwards, the calculated layout data will be written back to the original label layout. - *

- * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets the core layout algorithm that is wrapped by this {@link yfiles.layout.ILayoutStage}. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets whether or not this stage should automatically flip edge label content depending on the label's rotation - * angle. - *

- * More precisely, if this option is enabled and the up vector of the {@link yfiles.algorithms.YOrientedRectangle} associated with - * an {@link yfiles.layout.IEdgeLabelLayout} points downwards ({@link yfiles.algorithms.YOrientedRectangle#upY upY} > 0), this {@link yfiles.layout.ILayoutStage} automatically flips the - * label. It rotates the label by 180 degrees without changing the label's center. - *

- * @see yfiles.layout.LayoutGraphUtilities#autoFlipBox - * @see yfiles.layout.ILabelLayout#orientedBox - * @type {boolean} - */ - autoFlippingEnabled:boolean; - /** - * Gets or sets whether or not to reset the orientation of node labels. - *

- * If this option is enabled, the up vector of the corresponding oriented box is set to (0,-1) before adding it to the - * {@link yfiles.algorithms.IDataProvider}. - *

- * @type {boolean} - */ - resettingNodeLabelOrientation:boolean; - /** - * Gets or sets whether or not to reset the orientation of edge labels. - *

- * If this option is enabled, the up vector of the corresponding oriented box is set to (0,-1) before adding it to the - * {@link yfiles.algorithms.IDataProvider}. - *

- * @type {boolean} - */ - resettingEdgeLabelOrientation:boolean; - /** - * Gets or sets whether or not edge label information is written back to the model after core layout. - * @type {boolean} - */ - writeBackEdgeLabels:boolean; - /** - * Gets or sets whether or not edge label {@link yfiles.layout.LabelLayoutData#bounds boxes} are interpreted relative to the edge when writing them back to the model. - * @type {boolean} - */ - writeBackRelativeEdgeLabelLocation:boolean; - /** - * Gets or sets whether or not node label information is written back to the model after the core layout. - * @type {boolean} - */ - writeBackNodeLabels:boolean; - /** - * Gets or sets whether or not node label {@link yfiles.layout.LabelLayoutData#bounds bounds} are interpreted relative to the node when writing them back to the model. - * @type {boolean} - */ - writeBackRelativeNodeLabelLocation:boolean; - /** - * Gets or sets whether or not node label information is translated. - * @type {boolean} - */ - translateNodeLabels:boolean; - /** - * Gets or sets whether or not edge label information is translated. - * @type {boolean} - */ - translateEdgeLabels:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelLayoutTranslator; - } - /** - * A {@link yfiles.layout.LayoutGraph} is a {@link yfiles.algorithms.Graph} with attached layout information that basically represents a - * drawing of a graph. - *

- * It provides access to the layout information for nodes, edges and labels. This layout information consists of - * coordinates for the elements. - *

- *

- * {@link yfiles.layout.ILayoutAlgorithm Layout algorithms} work on {@link yfiles.layout.LayoutGraph}s and arrange their nodes and edges. - *

- * @class - * @extends {yfiles.algorithms.Graph} - */ - export interface LayoutGraph extends yfiles.algorithms.Graph{} - export class LayoutGraph { - /** - * Creates a new {@link yfiles.layout.LayoutGraph} which is a copy of the given subgraph. - * @param graph the original graph - * @param nodeSubset the nodes that induce the subgraph - */ - constructor(graph:yfiles.layout.LayoutGraph,nodeSubset:yfiles.algorithms.ICursor); - /** - * Creates a new {@link yfiles.layout.LayoutGraph} which is a copy of the given subgraph. - * @param subgraph the original subgraph - */ - constructor(subgraph:yfiles.layout.LayoutGraph); - /** - * Creates a new, empty {@link yfiles.layout.LayoutGraph} with default settings. - */ - constructor(); - /** - * Creates a new {@link yfiles.layout.ILabelLayoutFactory} for this {@link yfiles.layout.LayoutGraph} that can be used for copying layout - * information of labels. - * @returns the new {@link } - * @protected - * @abstract - */ - createLabelFactory():yfiles.layout.ILabelLayoutFactory; - /** - * Returns the rectangle describing the bounding box of the given node. - * @param node the node - * @returns the bounds of the node - * @see yfiles.layout.LayoutGraph#getLocation - * @see yfiles.layout.LayoutGraph#getSize - */ - getBoundingBox(node:yfiles.algorithms.Node):yfiles.algorithms.YRectangle; - /** - * Returns the center coordinates of the given node. - * @param node the node - * @returns the location of the node's center - * @see yfiles.layout.INodeLayout - * @see yfiles.layout.LayoutGraph#setCenter - */ - getCenter(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; - /** - * Returns the x-coordinate of the given node's center. - * @param node the node - * @returns the x-value of the node's center coordinate - * @see yfiles.layout.INodeLayout - */ - getCenterX(node:yfiles.algorithms.Node):number; - /** - * Returns the y-coordinate of the given node's center. - * @param node the node - * @returns the y-value of the node's center coordinate - * @see yfiles.layout.INodeLayout - */ - getCenterY(node:yfiles.algorithms.Node):number; - /** - * Returns the height of the given node. - * @param node the node - * @returns the height of the node - * @see yfiles.layout.INodeLayout#height - */ - getHeight(node:yfiles.algorithms.Node):number; - /** - * Returns the layout information for all labels associated with the given edge. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param edge the edge - * @returns the layout information for the edge's labels - * @abstract - */ - getLabelLayout(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLabelLayout[]; - /** - * Returns the layout information for all labels associated with the given node. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param node the node - * @returns the layout information for the node's labels - * @abstract - */ - getLabelLayout(node:yfiles.algorithms.Node):yfiles.layout.INodeLabelLayout[]; - /** - * Returns the layout information for the given edge. - *

- * The layout information consists of the locations of the control points and end points of the edge. - *

- * @param edge the edge - * @returns the layout information for the edge - * @abstract - */ - getLayout(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLayout; - /** - * Returns the layout information for the given node. - *

- * The layout information consists of the location and size of the node. - *

- * @param node the node - * @returns the layout information for the node - * @abstract - */ - getLayout(node:yfiles.algorithms.Node):yfiles.layout.INodeLayout; - /** - * Returns the coordinates of the given node's upper-left corner. - * @param node the node - * @returns the location of the node's upper-left corner - * @see yfiles.layout.INodeLayout#x - * @see yfiles.layout.INodeLayout#y - */ - getLocation(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; - /** - * Returns the edge to which the given {@link yfiles.layout.IEdgeLabelLayout} belongs. - * @param labelLayout the label's layout information - * @returns the edge that owns the label - * @abstract - */ - getOwnerEdge(labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.algorithms.Edge; - /** - * Returns the node to which the given {@link yfiles.layout.INodeLabelLayout} belongs. - * @param labelLayout the label's layout information - * @returns the node that owns the label - * @abstract - */ - getOwnerNode(labelLayout:yfiles.layout.INodeLabelLayout):yfiles.algorithms.Node; - /** - * Returns the path of an edge, including the ports. - *

- * The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position - * of the target port. - *

- * @param edge the edge - * @returns the path of the given edge - */ - getPath(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; - /** - * Returns the path of an edge, including the ports. - *

- * The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position - * of the target port. - *

- * @param edge the edge - * @returns a list of {@link }s representing the path of the given edge - */ - getPathList(edge:yfiles.algorithms.Edge):yfiles.algorithms.YList; - /** - * Returns the control points of an edge. - * @param edge the edge - * @returns a list of {@link }s representing the sequence of control points of the edge - * @see yfiles.layout.IEdgeLayout - */ - getPointList(edge:yfiles.algorithms.Edge):yfiles.algorithms.YList; - /** - * Returns the control points of an edge. - * @param edge the edge - * @returns a {@link } representing the sequence of control points of the edge - * @see yfiles.layout.IEdgeLayout - */ - getPoints(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; - /** - * Returns the size of the given node. - * @param node the node - * @returns the size of the node - * @see yfiles.layout.INodeLayout#width - * @see yfiles.layout.INodeLayout#height - */ - getSize(node:yfiles.algorithms.Node):yfiles.algorithms.YDimension; - /** - * Returns the absolute coordinates of the source point of the given edge. - * @param edge the edge - * @returns the absolute source point coordinates of the edge - */ - getSourcePointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the relative coordinates of the source point of the given edge. - *

- * The coordinates are interpreted relative to the center of the source node. - *

- * @param edge the edge - * @returns the relative source point coordinates of the edge - * @see yfiles.layout.IEdgeLayout#sourcePoint - */ - getSourcePointRel(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the absolute coordinates of the target point of the given edge. - * @param edge the edge - * @returns the absolute target point coordinates of the edge - */ - getTargetPointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the relative coordinates of the target point of the given edge. - *

- * The coordinates are interpreted relative to the center of the target node. - *

- * @param edge the edge - * @returns the relative target point coordinates of the edge - * @see yfiles.layout.IEdgeLayout#targetPoint - */ - getTargetPointRel(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the width of the given node. - * @param node the node - * @returns the width of the node - * @see yfiles.layout.INodeLayout#width - */ - getWidth(node:yfiles.algorithms.Node):number; - /** - * Returns the x-coordinate of the given node's upper-left corner. - * @param node the node - * @returns the x-value of the node's upper-left corner - * @see yfiles.layout.INodeLayout#x - */ - getX(node:yfiles.algorithms.Node):number; - /** - * Returns the y-coordinate of the given node's upper-left corner. - * @param node the node - * @returns the y-value of the node's upper-left corner - * @see yfiles.layout.INodeLayout#y - */ - getY(node:yfiles.algorithms.Node):number; - /** - * Moves the upper-left corner of a node by a given vector. - * @param node the node - * @param dx the x-component of the vector - * @param dy the y-component of the vector - */ - moveBy(node:yfiles.algorithms.Node,dx:number,dy:number):void; - /** - * Specifies the center coordinates of the given node. - * @param node the node - * @param x the new x-coordinate of the node's center - * @param y the new y-coordinate of the node's center - * @see yfiles.layout.INodeLayout - */ - setCenter(node:yfiles.algorithms.Node,x:number,y:number):void; - /** - * Specifies the center coordinates of the given node. - * @param node the node - * @param position the new location of the node's center - * @see yfiles.layout.INodeLayout - * @see yfiles.layout.LayoutGraph#setCenter - */ - setCenter(node:yfiles.algorithms.Node,position:yfiles.algorithms.YPoint):void; - /** - * Specifies the two end points of the given edge in absolute coordinates. - * @param edge the edge - * @param source the port on the source side of the edge - * @param target the port on the target side of the edge - * @see yfiles.layout.LayoutGraph#setSourcePointAbs - * @see yfiles.layout.LayoutGraph#setTargetPointAbs - */ - setEndPointsAbs(edge:yfiles.algorithms.Edge,source:yfiles.algorithms.YPoint,target:yfiles.algorithms.YPoint):void; - /** - * Specifies the coordinates of the upper-left corner of the given node. - * @param node the node - * @param x the new x-coordinate of the upper-left corner - * @param y the new y-coordinate of the upper-left corner - * @see yfiles.layout.INodeLayout#setLocation - */ - setLocation(node:yfiles.algorithms.Node,x:number,y:number):void; - /** - * Specifies the coordinates of the upper-left corner of the given node. - * @param node the node - * @param position the new location of the upper-left corner - * @see yfiles.layout.INodeLayout#setLocation - * @see yfiles.layout.LayoutGraph#setLocation - */ - setLocation(node:yfiles.algorithms.Node,position:yfiles.algorithms.YPoint):void; - /** - * Sets the path of the given edge. - *

- * The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position - * of the target port. - *

- *

- * Both source and target port are expected to be given in absolute coordinates. - *

- * @param edge an edge in the graph - * @param path the list of {@link }s representing the new path sequence of the edge - */ - setPath(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList):void; - /** - * Sets the path of the given edge. - *

- * The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position - * of the target port. - *

- *

- * Both source and target port are expected to be given in absolute coordinates. - *

- * @param edge an edge in the graph - * @param path the new path sequence of the edge - */ - setPath(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YPointPath):void; - /** - * Sets the control points of the given edge. - *

- * The source and target points of the edge will not be modified. - *

- * @param edge an edge in the graph - * @param points the list of {@link }s representing the new sequence of control points - */ - setPoints(edge:yfiles.algorithms.Edge,points:yfiles.algorithms.YList):void; - /** - * Sets the control points of the given edge. - *

- * The source and target points of the edge will not be modified. - *

- * @param edge an edge in the graph - * @param points the new sequence of control points - */ - setPoints(edge:yfiles.algorithms.Edge,points:yfiles.algorithms.YPointPath):void; - /** - * Specifies the width and height of the given node. - * @param node the node - * @param width the new width of the node - * @param height the new height of the node - * @see yfiles.layout.INodeLayout#setSize - */ - setSize(node:yfiles.algorithms.Node,width:number,height:number):void; - /** - * Specifies the size of the given node. - * @param node the node - * @param size the new size of the node - * @see yfiles.layout.LayoutGraph#setSize - * @see yfiles.layout.INodeLayout#setSize - */ - setSize(node:yfiles.algorithms.Node,size:yfiles.algorithms.YDimension):void; - /** - * Specifies the absolute coordinates of the source point of the given edge. - * @param edge the edge - * @param point the new absolute source point coordinates of the edge - */ - setSourcePointAbs(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; - /** - * Specifies the relative coordinates of the source point of the given edge. - *

- * The coordinates are interpreted relative to the center of the source node. - *

- * @param edge the edge - * @param point the new relative source point coordinates of the edge - * @see yfiles.layout.IEdgeLayout#sourcePoint - */ - setSourcePointRel(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; - /** - * Specifies the absolute coordinates of the target point of the given edge. - * @param edge the edge - * @param point the new absolute target point coordinates of the edge - */ - setTargetPointAbs(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; - /** - * Specifies the relative coordinates of the target point of the given edge. - *

- * The coordinates are interpreted relative to the center of the target node. - *

- * @param edge the edge - * @param point the new relative target point coordinates of the edge - * @see yfiles.layout.IEdgeLayout#targetPoint - */ - setTargetPointRel(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; - /** - * Gets a list of all edges in the graph. - * @type {yfiles.algorithms.EdgeList} - */ - edgeList:yfiles.algorithms.EdgeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutGraph; - } - /** - * The {@link yfiles.layout.LayoutGraphUtilities} provides several helper and utility functions for {@link yfiles.layout.LayoutGraph} and - * the {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - * @see yfiles.layout.LayoutGraph - * @class - * @static - */ - export interface LayoutGraphUtilities extends yfiles.lang.Object{} - export class LayoutGraphUtilities { - /** - * Aligns the specified nodes either vertically or horizontally according to the specified node alignment mode. - *

- * For vertical arrangements, nodes are either {@link yfiles.layout.NodeAlignment#LEADING top-aligned}, {@link yfiles.layout.NodeAlignment#CENTERED center-aligned}, {@link yfiles.layout.NodeAlignment#TRAILING bottom-aligned}, or {@link yfiles.layout.NodeAlignment#DISTRIBUTED vertically distributed}. - *

- *

- * For horizontal arrangements, nodes are either {@link yfiles.layout.NodeAlignment#LEADING left-aligned}, {@link yfiles.layout.NodeAlignment#CENTERED center-aligned}, {@link yfiles.layout.NodeAlignment#TRAILING right-aligned}, or {@link yfiles.layout.NodeAlignment#DISTRIBUTED horizontally distributed}. - *

- *

- * In this context, distributed means that the specified nodes are placed in such a way that the projections of their bounds onto the - * vertical or horizontal coordinate axis do not overlap. For example, after vertically distributing nodes, (n1.y + n1.height) <= n2.y - * for two consecutively placed nodes n1 and n2. - *

- * @param graph the graph that contains the specified nodes - * @param nodes the subset of the specified graph's nodes that is arranged - * @param referenceNode if null, the common coordinate for aligning the specified nodes is calculated as the the vertical minimum (top-aligned), - * the vertical center, the vertical maximum (bottom-aligned), the horizontal minimum (left-aligned), the horizontal - * center, or the horizontal maximum (right-aligned) of the bounds of the specified nodes; otherwise the appropriate - * coordinate of the given reference node's bounds is used as common coordinate for aligning the specified nodes. The - * reference node is ignored when {@link #DISTRIBUTED distributing} nodes. - * @param vertical true if nodes should be aligned (or distributed) according to their y-coordinates; otherwise nodes are aligned (or - * distributed) according to their x-coordinates. - * @param mode one of the valid alignment modes - * @static - */ - static alignNodeLayouts(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList,referenceNode:yfiles.algorithms.Node,vertical:boolean,mode:yfiles.layout.NodeAlignment):void; - /** - * Reassigns the bounds of the rectangles in a grid to fit in a large rectangle with an aspect ratio close to the specified - * aspect ratio. - *

- * The aspect ratio must be greater than 0. - *

- * @param rectangles the rectangles whose coordinates will be modified - * @param finalRect the exact dimension will be placed in this rectangle - * @param aspectRatio the preferred aspect ratio of the grid - * @returns the dimension of the grid - * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is less than or equal to zero - * @static - */ - static arrangeRectangleGrid(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,aspectRatio:number):yfiles.algorithms.YDimension; - /** - * Reassigns the bounds of the rectangles in multiple rows to fit the preferred width and height. - *

- * The rectangles will be placed within this bound, arranged in rows, where each row may be split into more sub-rows. This - * often leads to more compact results than provided by the procedure used in - * {@link yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows}. A row will be subdivided into more rows, if two successive - * rectangles to be placed in the row could be placed stacked within this row without making the row larger in height. - *

- *

- * The preferred width and height should be greater than 0, otherwise the nodes are not arranged. - *

- * @param rectangles the rectangles to arrange (coordinates will be assigned) - * @param finalRect the exact resulting dimension will be stored in this rectangle - * @param preferredWidth the preferred width of the result rectangle - * @param preferredHeight the preferred height of the result rectangle - * @param compaction true if the algorithm tries to always minimize the resulting dimension, whilst respecting the given constraints, false - * otherwise - * @param constraintMode the width or height constraints to consider - * @param [alignment=yfiles.layout.RowAlignment.LEADING] the alignment inside a row - * @returns the number of rows used - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - * @static - */ - static arrangeRectangleMultiRows(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,preferredWidth:number,preferredHeight:number,compaction:boolean,constraintMode:yfiles.layout.MultiRowConstraint,alignment?:yfiles.layout.RowAlignment):number; - /** - * Reassigns the bounds of the rectangles to fit in a large rectangle with an aspect ratio close to the specified aspect - * ratio. - *

- * This is achieved by arranging the rectangles in rows. - *

- *

- * The aspect ratio must be greater than 0. - *

- * @param rectangles the rectangles whose coordinates will be modified - * @param finalRect the exact dimension of the resulting rectangle - * @param aspectRatio the preferred aspect ratio of the resulting rectangle - * @param [alignment=yfiles.layout.RowAlignment.LEADING] one of the valid row alignments - * @returns the number of used rows - * @throws {Stubs.Exceptions.ArgumentError} if the aspect ratio is 0 or less - * @static - */ - static arrangeRectangleRows(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,aspectRatio:number,alignment?:yfiles.layout.RowAlignment):number; - /** - * Applies the reversed layout of the first edge to the second edge. - * @param graph the graph to which both edges belong - * @param edge1 the edge which adopts the points - * @param edge2 the template - * @static - */ - static assignReverseLayout(graph:yfiles.layout.LayoutGraph,edge1:yfiles.algorithms.Edge,edge2:yfiles.algorithms.Edge):void; - /** - * Flips the orientation of a given rectangle, if its up vector points downward ({@link yfiles.algorithms.YOrientedRectangle#upY upY} > 0). - *

- * That means, it rotates the rectangle by 180 degrees without changing the rectangle's center. - *

- * @param rect the given rectangle - * @returns true if the given rectangle was flipped, false otherwise - * @static - */ - static autoFlipBox(rect:yfiles.algorithms.YOrientedRectangle):boolean; - /** - * Clips the path of the given edge on the bounding box of the source and target points. - *

- * On a clipped edge, the source and target port will be located at the border of the corresponding node. - *

- * @param graph the graph to which the edge belongs - * @param edge the edge to clip - * @static - */ - static clipEdgeOnBounds(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Returns the path of an edge clipped on the bounding box of the source and target node. - *

- * On the clipped edge, the source and target port will be located at the border of the corresponding node. - *

- * @param graph the graph to which the edge belongs - * @param edge the clipped edge - * @returns the clipped path of the edge - * @static - */ - static clipEdgePathOnBounds(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; - /** - * Returns the path of an edge clipped on insets of the bounding box of the source and target node. - *

- * On the clipped edge, the source and target port will be located inside the node with an inset to the border of the - * corresponding node. - *

- * @param edge the clipped edge - * @param source the source of the edge - * @param target the target of the edge - * @param [inset=0.0] the inset of the node - * @returns the clipped path of the edge - * @static - */ - static clipEdgePathOnBounds(edge:yfiles.layout.IEdgeLayout,source:yfiles.layout.INodeLayout,target:yfiles.layout.INodeLayout,inset?:number):yfiles.algorithms.YPointPath; - /** - * Clips the path of all edges in the graph on the bounding box of their source and target points. - *

- * On a clipped edge, the source and target port will be located at the border of the corresponding node. - *

- * @param graph the graph - * @see yfiles.layout.LayoutGraphUtilities#clipEdgeOnBounds - * @static - */ - static clipEdgesOnBounds(graph:yfiles.layout.LayoutGraph):void; - /** - * Returns the path of a given edge path clipped on the given bounding boxes of the source and target node. - * @param path the path that will be clipped - * @param sourceBox the box of the source node that the given path should be clipped at - * @param targetBox the box of the target node that the given path should be clipped at - * @returns the path clipped on the given nodes boxes - * @static - */ - static clipPathOnBounds(path:yfiles.algorithms.YPointPath,sourceBox:yfiles.algorithms.YRectangle,targetBox:yfiles.algorithms.YRectangle):yfiles.algorithms.YPointPath; - /** - * Determines the main direction of the edge flow by analyzing the current layout of the graph. - *

- * The method only considers edges that are marked in the given {@link yfiles.algorithms.IDataProvider}. - *

- * @param graph the underlying graph - * @param considerEdges the edges to consider - * @returns one of the predefined flow directions - * @static - */ - static determineEdgeFlowDirection(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):yfiles.layout.EdgeFlow; - /** - * Returns a {@link string} representation of the path of the given edge. - * @param graph the graph to which the edge belongs - * @param edge the edge - * @returns the {@link } that contains all control points of the edge - * @static - */ - static edgeLayoutString(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):string; - /** - * Returns the bounding box of the given edge. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the control points as well as the - * absolute coordinates of the source and target point of the edge. - *

- * @param graph the graph that contains the edge - * @param edge the edge - * @returns the bounding box of the edge - * @see yfiles.layout.LayoutGraph#getSourcePointAbs - * @see yfiles.layout.LayoutGraph#getTargetPointAbs - * @see yfiles.layout.LayoutGraph#getLayout - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the given node. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given node. It is identical to the - * node's bounds. - *

- * @param graph the graph that contains the node - * @param node the node - * @returns the bounding box of the node - * @see yfiles.layout.LayoutGraph#getLayout - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the nodes and edges accessible through the given cursors, optionally including node labels, - * edge labels or {@link yfiles.layout.NodeHalo}s. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points - * as well as the source and target points of all edges. If node or edge labels should be included, it also contains their - * boxes. {@link yfiles.layout.NodeHalo}s can also extend the bounding box if desired. - *

- * @param graph the graph that contains the given nodes and edges - * @param nodes the nodes to include in the bounding box - * @param edges the edges to include in the bounding box - * @param includeNodeLabels true if labels of nodes should be included, false otherwise - * @param includeEdgeLabels true if labels of edges should be included, false otherwise - * @param [includeHalos=false] true if {@link }s should be included, false otherwise - * @returns the bounding box of the given nodes and edges - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor,includeNodeLabels:boolean,includeEdgeLabels:boolean,includeHalos?:boolean):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the nodes and edges accessible through the given cursors, optionally including node labels - * and edge labels. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points - * as well as the source and target points of all edges. If labels should be included, it also contains their boxes. - *

- * @param graph the graph that contains the given nodes and edges - * @param nodes the nodes to include in the bounding box - * @param edges the edges to include in the bounding box - * @param includeLabels true if labels of nodes and edges should be included, false otherwise - * @returns the bounding box of the given nodes and edges - * @see yfiles.layout.LayoutGraphUtilities#getBoundingBox - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor,includeLabels:boolean):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the nodes and edges accessible through the given cursors. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points - * as well as the source and target points of all edges. - *

- * @param graph the graph that contains the nodes and edges - * @param nodes the nodes to include in the bounding box - * @param edges the edges to include in the bounding box - * @returns the bounding box containing the given nodes and edges - * @see yfiles.layout.LayoutGraphUtilities#getBoundingBoxOfEdges - * @see yfiles.layout.LayoutGraphUtilities#getBoundingBoxOfNodes - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the edges accessible through the given cursor. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the control points as well as the - * absolute coordinates of the source and target points of all given edges. - *

- * @param graph the graph that contains the edges - * @param edges the edges to include in the bounding box - * @returns the bounding box containing the given edges - * @see yfiles.layout.LayoutGraph#getSourcePointAbs - * @see yfiles.layout.LayoutGraph#getTargetPointAbs - * @see yfiles.layout.LayoutGraph#getLayout - * @static - */ - static getBoundingBoxOfEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the nodes accessible through the given cursor. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes. - *

- * @param graph the graph that contains the nodes - * @param nodes the nodes to include in the bounding box - * @returns the bounding box containing the given nodes - * @see yfiles.layout.LayoutGraph#getLayout - * @static - */ - static getBoundingBoxOfNodes(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor):yfiles.algorithms.Rectangle2D; - /** - * Returns the {@link yfiles.layout.ILabelLayoutFactory} for the given graph. - * @param graph the graph - * @returns the label factory of the graph - * @static - */ - static getLabelFactory(graph:yfiles.layout.LayoutGraph):yfiles.layout.ILabelLayoutFactory; - /** - * Returns the upper-left corner of the paraxial bounding box of the given edge label as encoded by the specified model - * parameter. - *

- * The parameter describes the abstract position of the label within the specified model. The parameter must have been - * generated by that model. - *

- * @param model the {@link } used for placing the label - * @param labelSize the size of the label that should be placed - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the edge's source node - * @param targetLayout the layout of the edge's target node - * @param param the model parameter - * @returns the upper-left corner of the label's bounding box - * @see yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @static - */ - static getLabelPlacement(model:yfiles.layout.IEdgeLabelLayoutModel,labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YPoint; - /** - * Returns the upper-left corner of the paraxial bounding box of the given node label as encoded by the specified model - * parameter. - *

- * The parameter describes the abstract position of the label within the specified model. The parameter must have been - * generated by that model. - *

- * @param model the {@link } used for placing the label - * @param labelSize the size of the label - * @param nodeLayout the layout of the node to which the label belongs - * @param param the model parameter - * @returns the upper-left corner of the label's bounding box - * @see yfiles.layout.INodeLabelLayoutModel#getLabelPlacement - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @static - */ - static getLabelPlacement(model:yfiles.layout.INodeLabelLayoutModel,labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YPoint; - /** - * Returns the distance between the centers of the two given nodes. - * @param graph the graph to which the nodes belong - * @param node1 the first node - * @param node2 the second node - * @returns the distance between the nodes' centers - * @static - */ - static getNodeDistance(graph:yfiles.layout.LayoutGraph,node1:yfiles.algorithms.Node,node2:yfiles.algorithms.Node):number; - /** - * Returns a {@link string} representation of all node positions in the graph. - * @param graph the graph - * @returns the {@link } containing all node locations - * @see yfiles.layout.LayoutGraph#getLocation - * @static - */ - static getNodePositions(graph:yfiles.layout.LayoutGraph):string; - /** - * Returns the length of the path of the given edge. - *

- * The path starts at the source point, traverses through all control points and ends at the target point. - *

- * @param graph the graph to which the edge belongs - * @param edge the edge - * @returns the length of the edge's path - * @static - */ - static getPathLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Checks whether or not the path of an edge is outside the bounding box of the source and target node, considering the - * given halo. - *

- * The edge is outside the nodes if its control points as well as the source and target point are not inside the nodes' - * bounding boxes. - *

- *

- * The nodes can be enlarged by a halo to check if the edge keeps some distance to the nodes. - *

- * @param edge the edge - * @param source the source of the edge - * @param target the target of the edge - * @param halo the halo for the nodes - * @returns true if the edge is outside the nodes, false otherwise - * @static - */ - static isEdgeOutsideNodes(edge:yfiles.layout.IEdgeLayout,source:yfiles.layout.INodeLayout,target:yfiles.layout.INodeLayout,halo:number):boolean; - /** - * Checks whether or not the path of an edge is outside the bounding box of the source and target node. - *

- * The edge is outside the nodes if its control points as well as the source and target point are not inside the nodes' - * bounding boxes. - *

- * @param graph the graph to which the edge belongs - * @param edge the edge - * @returns true if the edge is outside the nodes, false otherwise - * @static - */ - static isEdgeOutsideNodes(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):boolean; - /** - * Determines whether or not most of the edges of the graph are routed octilinear. - *

- * The method only considers edges marked in the given {@link yfiles.algorithms.IDataProvider}. - *

- * @param graph the underlying graph - * @param considerEdges the edges to consider - * @returns true if most of the edges in the graph are routed octilinear, false otherwise - * @static - */ - static isUsingOctilinearEdgeRoutes(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):boolean; - /** - * Determines whether or not most of the edges of the graph are routed orthogonally. - *

- * The method only considers edges marked in the given {@link yfiles.algorithms.IDataProvider}. - *

- * @param graph the underlying graph - * @param considerEdges the edges to consider - * @returns true if most of the edges in the graph are routed orthogonally, false otherwise - * @static - */ - static isUsingOrthogonalEdgeRoutes(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):boolean; - /** - * Moves all control points of the given edge by the vector (dx,dy). - * @param graph the graph - * @param edge the edge - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,dx:number,dy:number):void; - /** - * Moves the control points of all edges accessible through the given {@link yfiles.algorithms.IEdgeCursor} by the vector (dx,dy). - * @param graph the graph - * @param edges the edges to be moved - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor,dx:number,dy:number):void; - /** - * Moves the given node by the vector (dx,dy). - * @param graph the graph - * @param node the node - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveNode(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,dx:number,dy:number):void; - /** - * Moves all nodes accessible through the given {@link yfiles.algorithms.INodeCursor} by the vector (dx,dy). - * @param graph the graph - * @param nodes the nodes to be moved - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveNodes(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,dx:number,dy:number):void; - /** - * Moves the subgraph induced by the nodes accessible through the given {@link yfiles.algorithms.INodeCursor} by the vector - * (dx,dy). - * @param graph the graph that contains the subgraph - * @param nodes the nodes that induce the subgraph - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveSubgraph(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,dx:number,dy:number):void; - /** - * Moves the subgraph induced by the edges accessible through the given {@link yfiles.algorithms.IEdgeCursor} by the vector - * (dx,dy). - * @param graph the graph that contains the subgraph - * @param edges the edges that induce the subgraph - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveSubgraphOfEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor,dx:number,dy:number):void; - /** - * Checks whether or not the path of the given edge intersects the interior of a given rectangular area. - * @param graph the graph to which the edge belongs - * @param edge the edge - * @param rect the rectangular area to check for intersection - * @returns true if the edge path intersects with the given rectangle, false otherwise - * @static - */ - static pathIntersectsRect(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,rect:yfiles.algorithms.Rectangle2D):boolean; - /** - * Removes successive bends that have the same coordinates from the given edge. - * @param graph the graph - * @param edge the edge - * @static - */ - static removeDuplicateBends(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Removes successive bends that have the same coordinates from all edges in the graph. - * @param graph the graph - * @static - */ - static removeDuplicateBends(graph:yfiles.layout.LayoutGraph):void; - /** - * Assigns a trivial path which has no control points to the specified edge. - * @param graph the graph - * @param edge the edge - * @param [resetPorts=true] true if the ports of the edge should be set to the center of the corresponding nodes, false otherwise - * @static - */ - static resetPath(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,resetPorts?:boolean):void; - /** - * Assigns a trivial path which has no control points to all edges in the specified graph. - * @param graph the graph - * @param [resetPorts=true] true if the ports of the edges should be set to the center of the corresponding nodes, false otherwise - * @static - */ - static resetPaths(graph:yfiles.layout.LayoutGraph,resetPorts?:boolean):void; - /** - * Sets the ports of all edges in the graph to the center of the nodes. - * @param graph the graph - * @see yfiles.layout.LayoutGraph#setSourcePointRel - * @see yfiles.layout.LayoutGraph#setTargetPointRel - * @static - */ - static resetPorts(graph:yfiles.layout.LayoutGraph):void; - /** - * Reverses the layout of an edge. - *

- * The order of the control points is reversed and source and target point are swapped. - *

- * @param el the layout information of an edge - * @static - */ - static reverseEdgeLayout(el:yfiles.layout.IEdgeLayout):void; - /** - * Rounds the locations of the control points and ports of the given edge to integer values. - * @param graph the graph to which the edge belongs - * @param edge the edge whose values are rounded - * @static - */ - static roundEdgeLayout(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Rounds coordinates and sizes in the layout of an entire graph to integer values. - * @param graph the graph - * @see yfiles.layout.LayoutGraphUtilities#roundNodeLayout - * @see yfiles.layout.LayoutGraphUtilities#roundEdgeLayout - * @static - */ - static roundLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Rounds the location and size of the given node to integer values. - * @param graph the graph to which the node belongs - * @param node the node whose values are rounded - * @static - */ - static roundNodeLayout(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - /** - * Routes a list of edges which are incident to the same nodes in parallel, optionally joining the end points. - *

- * All edges get a path that is parallel to the path of the first (leading) edge. - *

- *

- * The position of the leading edge may be adjusted if there is an odd number of parallel edges. It will be moved from the - * center to achieve a more symmetric port assignment. - *

- * @param graph the graph - * @param leadingEdge the leading edge - * @param edges the list of edges that will be aligned with the leading edge - * @param lineDistance the distance between two edges - * @param [adjustLeadingEdge=false] true if the leading edge should be adjusted if the size of list is odd, false otherwise - * @param [joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise - * @param [absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined - * @param [relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined - * @static - */ - static routeEdgesParallel(graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edges:yfiles.algorithms.EdgeList,lineDistance:number,adjustLeadingEdge?:boolean,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number):void; - /** - * Routes a list of edges which are incident to the same nodes in parallel, optionally joining the end points. - *

- * All edges get a path that is parallel to the path of the first (leading) edge. - *

- *

- * The position of the leading edge may be adjusted if there is an odd number of parallel edges. It will be moved from the - * center to achieve a more symmetric port assignment. - *

- * @param {Object} options The parameters to pass. - * @param options.graph the graph - * @param options.leadingEdge the leading edge - * @param options.edges the list of edges that will be aligned with the leading edge - * @param options.lineDistance the distance between two edges - * @param [options.adjustLeadingEdge=false] true if the leading edge should be adjusted if the size of list is odd, false otherwise - * @param [options.joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise - * @param [options.absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined - * @param [options.relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined - * @static - */ - static routeEdgesParallel(options:{graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edges:yfiles.algorithms.EdgeList,lineDistance:number,adjustLeadingEdge?:boolean,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number}):void; - /** - * Routes two edges which are incident to the same nodes in parallel, optionally joining the end points. - *

- * The second edge gets a path that is parallel to the path of the first (leading) edge. - *

- * @param graph the graph - * @param leadingEdge the leading edge - * @param edge the edge to be adjusted - * @param lineDistance the distance between the two edges - * @param [joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise - * @param [absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined - * @param [relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined - * @static - */ - static routeEdgesParallel(graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edge:yfiles.algorithms.Edge,lineDistance:number,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number):void; - /** - * Routes two edges which are incident to the same nodes in parallel, optionally joining the end points. - *

- * The second edge gets a path that is parallel to the path of the first (leading) edge. - *

- * @param {Object} options The parameters to pass. - * @param options.graph the graph - * @param options.leadingEdge the leading edge - * @param options.edge the edge to be adjusted - * @param options.lineDistance the distance between the two edges - * @param [options.joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise - * @param [options.absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined - * @param [options.relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined - * @static - */ - static routeEdgesParallel(options:{graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edge:yfiles.algorithms.Edge,lineDistance:number,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number}):void; - /** - * Routes a self-loop. - *

- * For a self-loop edge, source and target are identical. The path of the self-loop will start at the top of the node, go - * around the upper-left corner and end at the left side of the node. - *

- * @param graph the graph to which the edge belongs - * @param edge the self-loop - * @static - */ - static routeSelfLoop(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutGraphUtilities; - } - /** - * A {@link yfiles.layout.LayoutMultiplexer} delegates its layout calls to a core layout algorithm that is dynamically chosen at - * runtime by inspecting the nodes of the input graph. - *

- * If a {@link yfiles.algorithms.IDataProvider} is registered with the given graph using the look-up key - * {@link yfiles.layout.LayoutMultiplexer#LAYOUT_DP_KEY}, it is used for retrieving the {@link yfiles.layout.ILayoutAlgorithm} objects that - * are stored for the graph's nodes. If no such {@link yfiles.algorithms.IDataProvider} is registered, this layout stage's {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} - * (if any) is used for the layout calculation of all nodes. - *

- *

- * Note that the first non-null {@link yfiles.layout.ILayoutAlgorithm} instance retrieved from the {@link yfiles.algorithms.IDataProvider} - * is used for all nodes. - *

- *

- * The main purpose of this class is to enable the use of individual layout algorithms for different components (when used - * as the core layout algorithm of {@link yfiles.layout.ComponentLayout}) or for the contents of group nodes (when used as the core - * layout algorithm of {@link yfiles.layout.RecursiveGroupLayout}). - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface LayoutMultiplexer extends yfiles.layout.LayoutStageBase{} - export class LayoutMultiplexer { - /** - * Creates a new instance of {@link yfiles.layout.LayoutMultiplexer}. - */ - constructor(); - /** - * Returns the core layout algorithm associated with the nodes contained in the given graph. - *

- * This implementation looks up the layout algorithm in the {@link yfiles.algorithms.IDataProvider} registered with the key - * {@link yfiles.layout.LayoutMultiplexer#LAYOUT_DP_KEY}. The first non-null {@link yfiles.layout.ILayoutAlgorithm layout algorithm} instance found for a node of the - * given graph will be returned by this method. If no algorithm is registered at all, it will fall back to the - * {@link yfiles.layout.LayoutStageBase#coreLayout default core layout algorithm}. - *

- *

- * This method is called in {@link yfiles.layout.LayoutMultiplexer#applyLayout} and may be overridden to implement a different way - * of selecting the {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - *

- * @param graph the input graph - * @returns the according layout algorithm - * @protected - */ - getCoreLayout(graph:yfiles.layout.LayoutGraph):yfiles.layout.ILayoutAlgorithm; - /** - * Data provider key for assigning layout algorithms to the nodes - *

- * At runtime, the layout algorithms are determined and applied to the current graph. The first non-null {@link yfiles.layout.ILayoutAlgorithm} - * instance is used for the whole graph. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutMultiplexer; - } - /** - * Abstract base class implementing {@link yfiles.layout.ILayoutStage} that handles the management of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * Subclasses of this stage can use the provided methods, such that the management of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} does not - * need to be considered anymore. - *

- * @see yfiles.layout.MultiStageLayout - * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface LayoutStageBase extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class LayoutStageBase { - /** - * Creates a new {@link yfiles.layout.ILayoutStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * - * @param graph - * @abstract - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Invokes the layout process of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * Overriding classes may call this method during {@link yfiles.layout.ILayoutAlgorithm#applyLayout} to delegate arranging the - * graph to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. They can add pre- and post-processing code before and after this call. - *

- * @param graph the input graph - * @protected - */ - applyLayoutCore(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets the core layout algorithm that is wrapped by this stage. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutStageBase; - } - /** - * {@link yfiles.layout.MinimumNodeSizeStage} enforces a given minimum width/height of the nodes of a graph during the layout - * process. - *

- * It temporarily enlarges nodes whose width/height is below the specified minimum values. - *

- *

- * This {@link yfiles.layout.ILayoutStage} is especially useful to prevent that the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} has to handle zero-sized - * nodes or nodes with negative sizes. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface MinimumNodeSizeStage extends yfiles.layout.LayoutStageBase{} - export class MinimumNodeSizeStage { - /** - * Creates a new {@link yfiles.layout.MinimumNodeSizeStage} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} along with a specific - * minimum width and height for the nodes. - * @param coreLayouter the core layout routine - * @param minWidth the minimum width of nodes that should be enforced - * @param minHeight the minimum height of nodes that should be enforced - */ - constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm,minWidth:number,minHeight:number); - /** - * Creates a new {@link yfiles.layout.MinimumNodeSizeStage} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * The nodes will be enlarged to be at least 1 wide and 1 high. - *

- * @param coreLayouter the core routine - */ - constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.MinimumNodeSizeStage; - } - /** - * An abstract base class for layout algorithms that provides services to simplify and decompose the input graph before it - * is passed to the {@link yfiles.layout.MultiStageLayout#applyLayoutCore core layout algorithm} itself. - *

- * Subclasses of this layout algorithm have to provide implementations for the abstract method - * {@link yfiles.layout.MultiStageLayout#applyLayoutCore}. It invokes the actual layout routine of this layout algorithm. - *

- *

- * Concept - *

- *

- * This class provides a configurable pipeline that contains {@link yfiles.layout.ILayoutStage}s that add preprocessing steps - * and/or postprocessing steps to the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. {@link yfiles.layout.MultiStageLayout} provides some predefined - * {@link yfiles.layout.ILayoutStage}s, that simplify the input graph for the layout algorithm and complement the result. It is - * also possible to add custom {@link yfiles.layout.ILayoutStage}s which are executed {@link yfiles.layout.MultiStageLayout#prependStage before} or {@link yfiles.layout.MultiStageLayout#appendStage after the predefined ones}. - *

- *

- * Each {@link yfiles.layout.ILayoutStage} in the pipeline wraps its successor. When the layout pipeline is processed, the - * preprocessing code of the preceding {@link yfiles.layout.ILayoutStage} is executed before the code in the current {@link yfiles.layout.ILayoutStage} - * while the postprocessing code is executed afterwards. - *

- *

- * The pipeline of predefined {@link yfiles.layout.ILayoutStage}s of {@link yfiles.layout.MultiStageLayout} (when all are activated) causes - * the following sequence of steps: - *

- *
    - *
  1. Hides the group nodes.
  2. - *
  3. Hides all except for the induced subgraph.
  4. - *
  5. Decomposes the graph into its connected components. Performs steps 4-12 on each component.
  6. - *
  7. Prepares for label placement.
  8. - *
  9. Prepares the layout for an orientation change.
  10. - *
  11. Hides self-loops.
  12. - *
  13. Hides parallel edges.
  14. - *
  15. Invokes the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} on the simplified graph.
  16. - *
  17. Un-hides and routes parallel edges.
  18. - *
  19. Un-hides and routes self-loops.
  20. - *
  21. Completes orientation change of the layout.
  22. - *
  23. Assigns label positions.
  24. - *
  25. Arranges the connected components of the graph.
  26. - *
  27. Un-hides non-induced subgraph.
  28. - *
  29. Un-hides the group nodes.
  30. - *
- *

- * In order to take effect, a stage that is not already activated by default needs to be activated using the corresponding - * method, e.g., {@link yfiles.layout.MultiStageLayout#hideGroupsStageEnabled}. Vice versa, a stage can also be deactivated, if necessary. - *

- * @class - * @implements {yfiles.layout.ILayoutAlgorithm} - */ - export interface MultiStageLayout extends yfiles.lang.Object,yfiles.layout.ILayoutAlgorithm{} - export class MultiStageLayout { - /** - * Creates a new {@link yfiles.layout.MultiStageLayout} instance with default settings. - */ - constructor(); - /** - * Appends the given {@link yfiles.layout.ILayoutStage} to the layout pipeline. - *

- * Stages that are added with this method will be invoked at the very end of the layout pipeline. This means after all - * prepended {@link yfiles.layout.ILayoutStage}s, all predefined stages, and all previously appended {@link yfiles.layout.ILayoutStage}s, - * but just before the invocation of the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. - *

- * @param stage the {@link } instance to be added - * @see yfiles.layout.MultiStageLayout#removeStage - * @see yfiles.layout.MultiStageLayout#prependStage - */ - appendStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Calculates a layout for the given graph and applies it directly to the graph. - *

- * This method executes all activated {@link yfiles.layout.ILayoutStage}s in the layout pipeline as well as the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. - *

- * @param layoutGraph the input graph - * @see yfiles.layout.MultiStageLayout#appendStage - * @see yfiles.layout.MultiStageLayout#prependStage - * @see yfiles.layout.MultiStageLayout#applyLayoutCore - */ - applyLayout(layoutGraph:yfiles.layout.LayoutGraph):void; - /** - * Invokes the core layout algorithm. - *

- * This method should be implemented by subclasses in order to perform the layout routine of the layout algorithm. - *

- * @param graph the input graph - * @abstract - */ - applyLayoutCore(graph:yfiles.layout.LayoutGraph):void; - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Deactivates all predefined {@link yfiles.layout.ILayoutStage}s so that upon {@link yfiles.layout.MultiStageLayout#applyLayout} only the - * {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} will be executed. - */ - disableAllStages():void; - /** - * Prepends the given {@link yfiles.layout.ILayoutStage} to the layout pipeline. - *

- * Stages that are added with this method will be invoked at the very beginning of the layout pipeline. This means before - * all previously prepended {@link yfiles.layout.ILayoutStage}s, all predefined stages, and all appended - * {@link yfiles.layout.ILayoutStage}s. - *

- * @param stage the {@link } instance to be added - * @see yfiles.layout.MultiStageLayout#removeStage - * @see yfiles.layout.MultiStageLayout#appendStage - */ - prependStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Removes the given {@link yfiles.layout.ILayoutStage} from the layout pipeline. - *

- * This method can only remove {@link yfiles.layout.ILayoutStage}s that have been previously added using {@link yfiles.layout.MultiStageLayout#appendStage} - * or {@link yfiles.layout.MultiStageLayout#prependStage}. Predefined {@link yfiles.layout.ILayoutStage}s can be deactivated separately. - *

- * @param stage a {@link } to be removed from the layout pipeline - * @see yfiles.layout.MultiStageLayout#prependStage - * @see yfiles.layout.MultiStageLayout#appendStage - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#subgraphLayoutEnabled - * @see yfiles.layout.MultiStageLayout#labelingEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - */ - removeStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that places the labels of the input graph. - * @see yfiles.layout.MultiStageLayout#labelingEnabled - * @see yfiles.labeling.GenericLabeling - * @type {yfiles.layout.ILayoutStage} - */ - labeling:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that routes self-loops. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.SelfLoopRouter - * @type {yfiles.layout.ILayoutStage} - */ - selfLoopRouter:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that routes parallel edges. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.router.ParallelEdgeRouter - * @type {yfiles.layout.ILayoutStage} - */ - parallelEdgeRouter:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that arranges the connected components of an input graph. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.ComponentLayout - * @type {yfiles.layout.ILayoutStage} - */ - componentLayout:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that constrains the layout process to a subgraph of the input graph. - * @see yfiles.layout.MultiStageLayout#subgraphLayoutEnabled - * @see yfiles.layout.SubgraphLayout - * @type {yfiles.layout.ILayoutStage} - */ - subgraphLayout:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that hides the group nodes of the input graph. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.HideGroupsStage - * @type {yfiles.layout.ILayoutStage} - */ - hideGroupsStage:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that modifies the orientation of a computed layout. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {yfiles.layout.ILayoutStage} - */ - orientationLayout:yfiles.layout.ILayoutStage; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - *

- * This {@link yfiles.layout.ILayoutStage} may be deactivated if the orientation is irrelevant for the layout or if the core layout - * algorithm already handles the layout orientation by itself. - *

- * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Gets or sets the main orientation of the layout. - *

- * This is a convenience method that configures the {@link yfiles.layout.MultiStageLayout#orientationLayout orientation layout stage}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation does not match a default layout orientation - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @type {yfiles.layout.LayoutOrientation} - */ - layoutOrientation:yfiles.layout.LayoutOrientation; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - *

- * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles self-loops by itself. - *

- * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for placing the labels of the input graph is activated. - *

- * This {@link yfiles.layout.ILayoutStage} may be activated to apply a generic labeling algorithm to the input graph. It will then - * try to find the best locations for the labels in the layout calculated by the - * {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. When the stage is deactivated, the labels are ignored or placed by an integrated labeling of the - * layout algorithm. - *

- * @see yfiles.layout.MultiStageLayout#labeling - * @see yfiles.labeling.GenericLabeling - * @type {boolean} - */ - labelingEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - *

- * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles group nodes itself. - *

- * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - *

- * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} is able to handle several connected - * components. - *

- * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - *

- * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles parallel edges itself. - *

- * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for constraining the layout process to a subgraph of the - * input graph is activated. - *

- * This {@link yfiles.layout.ILayoutStage} may be activated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} should be applied only to a specific part of - * the graph. The remaining graph will stay unchanged. - *

- * @see yfiles.layout.MultiStageLayout#subgraphLayout - * @see yfiles.layout.SubgraphLayout - * @type {boolean} - */ - subgraphLayoutEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.MultiStageLayout; - } - /** - * A {@link yfiles.layout.NodeHalo} specifies a rectangular area around a specific node. - *

- * A {@link yfiles.layout.ILayoutAlgorithm layout algorithm} that supports - * {@link yfiles.layout.NodeHalo}s, keeps this area clear of graph elements, except the node labels of this specific node and the - * adjacent segments of its edges. All minimum distances to this node, which are used in the layout calculation, e.g., - * minimum first segment length, will be extended by the halo size. - *

- *

- * This class defines a key used for registering a {@link yfiles.algorithms.IDataProvider} that provides {@link yfiles.layout.NodeHalo}s - * for all nodes of the input graph. {@link yfiles.layout.NodeHalo}-aware layout algorithms like {@link yfiles.hierarchic.HierarchicLayout} - * look for {@link yfiles.algorithms.IDataProvider}s registered with this key to retrieve {@link yfiles.layout.NodeHalo} information. - *

- *

- * The following layouters support {@link yfiles.layout.NodeHalo}s with different restrictions: - *

- *
    - *
  • {@link yfiles.hierarchic.HierarchicLayout}
  • - *
  • {@link yfiles.orthogonal.OrthogonalLayout}
  • - *
  • {@link yfiles.orthogonal.CompactOrthogonalLayout}
  • - *
  • {@link yfiles.tree.TreeLayout}
  • - *
  • {@link yfiles.tree.ClassicTreeLayout}
  • - *
  • {@link yfiles.organic.OrganicLayout}
  • - *
  • {@link yfiles.labeling.GenericLabeling}
  • - *
  • {@link yfiles.router.EdgeRouter}
  • - *
  • {@link yfiles.circular.CircularLayout}
  • - *
  • {@link yfiles.tree.BalloonLayout}
  • - *
  • {@link yfiles.layout.SelfLoopRouter}
  • - *
  • {@link yfiles.radial.RadialLayout}
  • - *
  • {@link yfiles.layout.RecursiveGroupLayout}
  • - *
  • {@link yfiles.layout.ComponentLayout}
  • - *
- * @class - * @final - */ - export interface NodeHalo extends yfiles.lang.Object{} - export class NodeHalo { - /** - * Creates a {@link yfiles.layout.NodeHalo} with the specified values. - *

- * The values must not be negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY}. - *

- * @param top the {@link } size at the top side of the node - * @param left the {@link } size at the left side of the node - * @param bottom the {@link } size at the bottom side of the node - * @param right the {@link } size at the right side of the node - * @returns the newly created {@link } - * @throws {Stubs.Exceptions.ArgumentError} if one of the values is negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY} - * @static - */ - static create(top:number,left:number,bottom:number,right:number):yfiles.layout.NodeHalo; - /** - * Creates a {@link yfiles.layout.NodeHalo} object with the specified value on each side of the node. - *

- * The value must not be negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY}. - *

- * @param value the halo size at each side of the node - * @returns the newly created {@link } - * @throws {Stubs.Exceptions.ArgumentError} if the value is negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY} - * @static - */ - static create(value:number):yfiles.layout.NodeHalo; - /** - * Returns the {@link yfiles.layout.NodeHalo} associated with the given node. - *

- * If no such {@link yfiles.layout.NodeHalo} is available, this method returns a {@link yfiles.layout.NodeHalo#ZERO_HALO}. - *

- * @param graph the graph containing the given node - * @param node the node whose {@link } will be determined - * @returns the {@link } of the given node if available, otherwise a {@link #ZERO_HALO} - * @static - */ - static getHalo(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.layout.NodeHalo; - /** - * Returns a {@link yfiles.algorithms.YRectangle} instance with the bounds of the given node including its {@link yfiles.layout.NodeHalo}. - *

- * This {@link yfiles.algorithms.YRectangle} is located at the position of the node. - *

- *

- * If the node does not have a {@link yfiles.layout.NodeHalo} assigned, this box has the same size as the node. - *

- * @param graph the graph containing the given node - * @param node the node whose {@link } will be determined - * @returns a {@link } instance with the bounds of the given node including its {@link } - * @static - */ - static getHaloBox(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.algorithms.YRectangle; - /** - * Checks whether or not the given graph contains {@link yfiles.layout.NodeHalo} information. - *

- * This method looks for a {@link yfiles.algorithms.IDataProvider} that has been registered with the given graph using - * {@link yfiles.layout.NodeHalo#NODE_HALO_DP_KEY}. - *

- * @param graph the input graph - * @returns true if a {@link } has been registered with the according key, false otherwise - * @static - */ - static hasHalos(graph:yfiles.layout.LayoutGraph):boolean; - /** - * Data provider key for assigning halos for the nodes - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_HALO_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * A constant holding a {@link yfiles.layout.NodeHalo} with zero size on each side. - * @const - * @static - * @type {yfiles.layout.NodeHalo} - */ - static ZERO_HALO:yfiles.layout.NodeHalo; - /** - * The {@link yfiles.layout.NodeHalo} size at the top side of the node. - * @const - * @type {number} - */ - top:number; - /** - * The {@link yfiles.layout.NodeHalo} size at the left side of the node. - * @const - * @type {number} - */ - left:number; - /** - * The {@link yfiles.layout.NodeHalo} size at the bottom side of the node. - * @const - * @type {number} - */ - bottom:number; - /** - * The {@link yfiles.layout.NodeHalo} size at the right side of the node. - * @const - * @type {number} - */ - right:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.NodeHalo; - } - /** - * A {@link yfiles.layout.NodeLabelCandidate} describes one valid placement for a node label considering the label model. - * @class - * @extends {yfiles.layout.LabelCandidate} - */ - export interface NodeLabelCandidate extends yfiles.layout.LabelCandidate{} - export class NodeLabelCandidate { - /** - * Creates a new instance of {@link yfiles.layout.NodeLabelCandidate} described by location, size, model parameter and internal - * flag. - * @param pos the location of the upper left corner of the candidate - * @param size the size of the candidate - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.INodeLabelLayout,internal?:boolean); - /** - * Creates a new instance of {@link yfiles.layout.NodeLabelCandidate} described by its box, model parameter and internal flag. - * @param labelBox the box that specifies the candidate's size and position - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.INodeLabelLayout,internal?:boolean); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.NodeLabelCandidate; - } - /** - * {@link yfiles.layout.NormalizeGraphElementOrderStage} normalizes the order of the elements within a graph to ensure the same - * order for multiple layout invocations. - *

- * Among other factors, the results produced by layout algorithms usually depend on the order of the nodes and edges within - * a graph. Unfortunately, useful operations such as hiding or unhiding elements from a graph or simply invoking layout - * algorithms on a graph will have the potential side effect of changing that order. - *

- *

- * With this {@link yfiles.layout.ILayoutStage} it is possible to establish a predefined order of nodes and edges within a graph to - * avoid non-deterministic layout behavior. Defining the order of nodes and edges is done by associating each node or edge - * in the graph with a {@link yfiles.lang.IComparable} value using a {@link yfiles.algorithms.IDataProvider} registered with the key {@link yfiles.layout.NormalizeGraphElementOrderStage#NODE_COMPARABLE_DP_KEY} - * or {@link yfiles.layout.NormalizeGraphElementOrderStage#EDGE_COMPARABLE_DP_KEY}, respectively. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface NormalizeGraphElementOrderStage extends yfiles.layout.LayoutStageBase{} - export class NormalizeGraphElementOrderStage { - /** - * Creates a new {@link yfiles.layout.NormalizeGraphElementOrderStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Assigns comparable values for each node and edge. - *

- * The compared values are induced from the current ordering of the nodes and edges within the given graph. - *

- *

- * This is a convenient method to fill the given {@link yfiles.algorithms.IDataMap}s which can then be registered with the graph - * with keys {@link yfiles.layout.NormalizeGraphElementOrderStage#NODE_COMPARABLE_DP_KEY} and {@link yfiles.layout.NormalizeGraphElementOrderStage#EDGE_COMPARABLE_DP_KEY} - * and used for several layout calculations. - *

- * @param graph the input graph - * @param comparableNodeMap the map that will be filled with comparable values for the nodes - * @param comparableEdgeMap the map that will be filled with comparable values for the edges - * @static - */ - static fillComparableMapFromGraph(graph:yfiles.algorithms.Graph,comparableNodeMap:yfiles.algorithms.IDataMap,comparableEdgeMap:yfiles.algorithms.IDataMap):void; - /** - * Data provider key for defining a (global) order for nodes - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_COMPARABLE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining a (global) order for edges - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_COMPARABLE_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.NormalizeGraphElementOrderStage; - } - /** - * {@link yfiles.layout.OrientationLayout} is a {@link yfiles.layout.ILayoutStage} that changes the orientation of the layout. - *

- * Layout Style There are four orientations that can be used for a layout. These orientations can exist with or without mirroring at - * the x-axis or y-axis. - *

- *

- * Changing the layout orientation is useful for layout styles that show a main direction. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[327.5,0],[136.25,100.31],[327.5,100.31],[507.5,100.31],[507.5,180.94],[260,180.94],[327.5,180.94],[447.5,180.94],[440,262.19],[136.25,180.94],[76.25,180.94],[387.5,342.81],[380,262.19],[500,262.19],[320,262.19],[320,342.81],[560,262.19],[196.25,180.94],[20,262.19],[260,262.19],[80,262.19],[387.5,417.81],[140,262.19],[447.5,342.81],[80,342.81],[620,180.94],[200,262.19],[387.5,180.94],[200,342.81],[140,342.81],[20,342.81],[447.5,417.81],[200,417.81],[320,417.81],[620,262.19],[507.5,342.81],[507.5,417.81],[620,342.81],[567.5,417.81],[687.5,342.81],[687.5,417.81],[627.5,417.81]],"e":[[0,1,-10,15,0,-15,[332.5,40,151.25,85.31]],[0,2,0,15,0,-15],[0,3,10,15,0,-15,[352.5,40,522.5,85.31]],[3,4,0,15,0,-15],[2,5,-10,15,0,-15,[332.5,140.31,275,165.94]],[2,6,0,15,0,-15],[3,7,-10,15,0,-15,[512.5,140.31,462.5,165.94]],[7,8,0,15,0,-15,[462.5,220.94,455,247.19]],[1,9,0,15,0,-15],[1,10,-10,15,0,-15,[141.25,140.31,91.25,165.94]],[8,11,-7.5,15,0,-15,[447.5,302.19,402.5,327.81]],[6,12,7.5,15,0,-15,[350,220.94,395,247.19]],[4,13,-7.5,15,0,-15],[6,14,-7.5,15,0,-15],[14,15,0,15,0,-15],[4,16,7.5,15,0,-15,[530,220.94,575,247.19]],[1,17,10,15,0,-15,[161.25,140.31,211.25,165.94]],[9,18,-11.25,15,0,-15,[140,220.94,35,247.19]],[5,19,0,15,0,-15],[9,20,-3.75,15,0,-15,[147.5,220.94,95,247.19]],[11,21,0,15,0,-15],[9,22,3.75,15,0,-15],[8,23,7.5,15,0,-15],[20,24,0,15,0,-15],[3,25,10,15,0,-15,[532.5,140.31,635,165.94]],[9,26,11.25,15,0,-15,[162.5,220.94,215,247.19]],[2,27,10,15,0,-15,[352.5,140.31,402.5,165.94]],[26,28,0,15,0,-15],[22,29,0,15,0,-15],[18,30,0,15,0,-15],[23,31,0,15,0,-15],[28,32,0,15,0,-15],[15,33,0,15,0,-15],[25,34,0,15,0,-15],[34,35,-10,15,0,-15,[625,302.19,522.5,327.81]],[35,36,0,15,0,-15],[34,37,0,15,0,-15],[37,38,-7.5,15,0,-15,[627.5,382.81,582.5,402.81]],[34,39,10,15,0,-15,[645,302.19,702.5,327.81]],[39,40,0,15,0,-15],[37,41,7.5,15,0,-15]],"vp":[20.0,0.0,698.0,448.0]}} - *

- *

- * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} layout - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[327.5,-30],[136.25,-130.31],[327.5,-130.31],[507.5,-130.31],[507.5,-210.94],[260,-210.94],[327.5,-210.94],[447.5,-210.94],[440,-292.19],[136.25,-210.94],[76.25,-210.94],[387.5,-372.81],[380,-292.19],[500,-292.19],[320,-292.19],[320,-372.81],[560,-292.19],[196.25,-210.94],[20,-292.19],[260,-292.19],[80,-292.19],[387.5,-447.81],[140,-292.19],[447.5,-372.81],[80,-372.81],[620,-210.94],[200,-292.19],[387.5,-210.94],[200,-372.81],[140,-372.81],[20,-372.81],[447.5,-447.81],[200,-447.81],[320,-447.81],[620,-292.19],[507.5,-372.81],[507.5,-447.81],[620,-372.81],[567.5,-447.81],[687.5,-372.81],[687.5,-447.81],[627.5,-447.81]],"e":[[0,1,-10,-15,0,15,[332.5,-40,151.25,-85.31]],[0,2,0,-15,0,15],[0,3,10,-15,0,15,[352.5,-40,522.5,-85.31]],[3,4,0,-15,0,15],[2,5,-10,-15,0,15,[332.5,-140.31,275,-165.94]],[2,6,0,-15,0,15],[3,7,-10,-15,0,15,[512.5,-140.31,462.5,-165.94]],[7,8,0,-15,0,15,[462.5,-220.94,455,-247.19]],[1,9,0,-15,0,15],[1,10,-10,-15,0,15,[141.25,-140.31,91.25,-165.94]],[8,11,-7.5,-15,0,15,[447.5,-302.19,402.5,-327.81]],[6,12,7.5,-15,0,15,[350,-220.94,395,-247.19]],[4,13,-7.5,-15,0,15],[6,14,-7.5,-15,0,15],[14,15,0,-15,0,15],[4,16,7.5,-15,0,15,[530,-220.94,575,-247.19]],[1,17,10,-15,0,15,[161.25,-140.31,211.25,-165.94]],[9,18,-11.25,-15,0,15,[140,-220.94,35,-247.19]],[5,19,0,-15,0,15],[9,20,-3.75,-15,0,15,[147.5,-220.94,95,-247.19]],[11,21,0,-15,0,15],[9,22,3.75,-15,0,15],[8,23,7.5,-15,0,15],[20,24,0,-15,0,15],[3,25,10,-15,0,15,[532.5,-140.31,635,-165.94]],[9,26,11.25,-15,0,15,[162.5,-220.94,215,-247.19]],[2,27,10,-15,0,15,[352.5,-140.31,402.5,-165.94]],[26,28,0,-15,0,15],[22,29,0,-15,0,15],[18,30,0,-15,0,15],[23,31,0,-15,0,15],[28,32,0,-15,0,15],[15,33,0,-15,0,15],[25,34,0,-15,0,15],[34,35,-10,-15,0,15,[625,-302.19,522.5,-327.81]],[35,36,0,-15,0,15],[34,37,0,-15,0,15],[37,38,-7.5,-15,0,15,[627.5,-382.81,582.5,-402.81]],[34,39,10,-15,0,15,[645,-302.19,702.5,-327.81]],[39,40,0,-15,0,15],[37,41,7.5,-15,0,15]],"vp":[20.0,-448.0,698.0,448.0]}} - *

- *

- * {@link yfiles.layout.LayoutOrientation#BOTTOM_TO_TOP} layout with {@link yfiles.layout.MirrorModes#BOTTOM_TO_TOP mirroring} - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,-357.5],[100.31,-166.25],[100.31,-357.5],[100.31,-537.5],[180.94,-537.5],[180.94,-290],[180.94,-357.5],[180.94,-477.5],[262.19,-470],[180.94,-166.25],[180.94,-106.25],[342.81,-417.5],[262.19,-410],[262.19,-530],[262.19,-350],[342.81,-350],[262.19,-590],[180.94,-226.25],[262.19,-50],[262.19,-290],[262.19,-110],[417.81,-417.5],[262.19,-170],[342.81,-477.5],[342.81,-110],[180.94,-650],[262.19,-230],[180.94,-417.5],[342.81,-230],[342.81,-170],[342.81,-50],[417.81,-477.5],[417.81,-230],[417.81,-350],[262.19,-650],[342.81,-537.5],[417.81,-537.5],[342.81,-650],[417.81,-597.5],[342.81,-717.5],[417.81,-717.5],[417.81,-657.5]],"e":[[0,1,15,10,-15,-0,[40,-332.5,85.31,-151.25]],[0,2,15,-0,-15,-0],[0,3,15,-10,-15,-0,[40,-352.5,85.31,-522.5]],[3,4,15,-0,-15,-0],[2,5,15,10,-15,-0,[140.31,-332.5,165.94,-275]],[2,6,15,-0,-15,-0],[3,7,15,10,-15,-0,[140.31,-512.5,165.94,-462.5]],[7,8,15,-0,-15,-0,[220.94,-462.5,247.19,-455]],[1,9,15,-0,-15,-0],[1,10,15,10,-15,-0,[140.31,-141.25,165.94,-91.25]],[8,11,15,7.5,-15,-0,[302.19,-447.5,327.81,-402.5]],[6,12,15,-7.5,-15,-0,[220.94,-350,247.19,-395]],[4,13,15,7.5,-15,-0],[6,14,15,7.5,-15,-0],[14,15,15,-0,-15,-0],[4,16,15,-7.5,-15,-0,[220.94,-530,247.19,-575]],[1,17,15,-10,-15,-0,[140.31,-161.25,165.94,-211.25]],[9,18,15,11.25,-15,-0,[220.94,-140,247.19,-35]],[5,19,15,-0,-15,-0],[9,20,15,3.75,-15,-0,[220.94,-147.5,247.19,-95]],[11,21,15,-0,-15,-0],[9,22,15,-3.75,-15,-0],[8,23,15,-7.5,-15,-0],[20,24,15,-0,-15,-0],[3,25,15,-10,-15,-0,[140.31,-532.5,165.94,-635]],[9,26,15,-11.25,-15,-0,[220.94,-162.5,247.19,-215]],[2,27,15,-10,-15,-0,[140.31,-352.5,165.94,-402.5]],[26,28,15,-0,-15,-0],[22,29,15,-0,-15,-0],[18,30,15,-0,-15,-0],[23,31,15,-0,-15,-0],[28,32,15,-0,-15,-0],[15,33,15,-0,-15,-0],[25,34,15,-0,-15,-0],[34,35,15,10,-15,-0,[302.19,-625,327.81,-522.5]],[35,36,15,-0,-15,-0],[34,37,15,-0,-15,-0],[37,38,15,7.5,-15,-0,[382.81,-627.5,402.81,-582.5]],[34,39,15,-10,-15,-0,[302.19,-645,327.81,-702.5]],[39,40,15,-0,-15,-0],[37,41,15,-7.5,-15,-0]],"vp":[0.0,-718.0,448.0,698.0]}} - *

- *

- * {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} layout - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[-30,327.5],[-130.31,136.25],[-130.31,327.5],[-130.31,507.5],[-210.94,507.5],[-210.94,260],[-210.94,327.5],[-210.94,447.5],[-292.19,440],[-210.94,136.25],[-210.94,76.25],[-372.81,387.5],[-292.19,380],[-292.19,500],[-292.19,320],[-372.81,320],[-292.19,560],[-210.94,196.25],[-292.19,20],[-292.19,260],[-292.19,80],[-447.81,387.5],[-292.19,140],[-372.81,447.5],[-372.81,80],[-210.94,620],[-292.19,200],[-210.94,387.5],[-372.81,200],[-372.81,140],[-372.81,20],[-447.81,447.5],[-447.81,200],[-447.81,320],[-292.19,620],[-372.81,507.5],[-447.81,507.5],[-372.81,620],[-447.81,567.5],[-372.81,687.5],[-447.81,687.5],[-447.81,627.5]],"e":[[0,1,-15,-10,15,0,[-40,332.5,-85.31,151.25]],[0,2,-15,0,15,0],[0,3,-15,10,15,0,[-40,352.5,-85.31,522.5]],[3,4,-15,0,15,0],[2,5,-15,-10,15,0,[-140.31,332.5,-165.94,275]],[2,6,-15,0,15,0],[3,7,-15,-10,15,0,[-140.31,512.5,-165.94,462.5]],[7,8,-15,0,15,0,[-220.94,462.5,-247.19,455]],[1,9,-15,0,15,0],[1,10,-15,-10,15,0,[-140.31,141.25,-165.94,91.25]],[8,11,-15,-7.5,15,0,[-302.19,447.5,-327.81,402.5]],[6,12,-15,7.5,15,0,[-220.94,350,-247.19,395]],[4,13,-15,-7.5,15,0],[6,14,-15,-7.5,15,0],[14,15,-15,0,15,0],[4,16,-15,7.5,15,0,[-220.94,530,-247.19,575]],[1,17,-15,10,15,0,[-140.31,161.25,-165.94,211.25]],[9,18,-15,-11.25,15,0,[-220.94,140,-247.19,35]],[5,19,-15,0,15,0],[9,20,-15,-3.75,15,0,[-220.94,147.5,-247.19,95]],[11,21,-15,0,15,0],[9,22,-15,3.75,15,0],[8,23,-15,7.5,15,0],[20,24,-15,0,15,0],[3,25,-15,10,15,0,[-140.31,532.5,-165.94,635]],[9,26,-15,11.25,15,0,[-220.94,162.5,-247.19,215]],[2,27,-15,10,15,0,[-140.31,352.5,-165.94,402.5]],[26,28,-15,0,15,0],[22,29,-15,0,15,0],[18,30,-15,0,15,0],[23,31,-15,0,15,0],[28,32,-15,0,15,0],[15,33,-15,0,15,0],[25,34,-15,0,15,0],[34,35,-15,-10,15,0,[-302.19,625,-327.81,522.5]],[35,36,-15,0,15,0],[34,37,-15,0,15,0],[37,38,-15,-7.5,15,0,[-382.81,627.5,-402.81,582.5]],[34,39,-15,10,15,0,[-302.19,645,-327.81,702.5]],[39,40,-15,0,15,0],[37,41,-15,7.5,15,0]],"vp":[-448.0,20.0,448.0,698.0]}} - *

- *

- * {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT} layout - *

- *

- * Concept {@link yfiles.layout.OrientationLayout} performs three basic steps. - *

- *
    - *
  1. - * Preparation: The sizes and locations of nodes and edge bends as well as labels and {@link yfiles.layout.PortConstraint}s are - * transformed to the {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. - *
  2. - *
  3. - * Delegation: The {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is invoked and calculates the layout for orientation - * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. - *
  4. - *
  5. Completion: The result of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is rotated and mirrored to fit the desired layout orientation.
  6. - *
- *

- * Features - *

- *

- * {@link yfiles.layout.OrientationLayout} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. Then it - * will change the orientation of the result of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *
- * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.layout.OrientationLayout} can work alone. It will just change the - * orientation of the layout without arranging nodes and edges. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrientationLayout extends yfiles.layout.LayoutStageBase{} - export class OrientationLayout { - /** - * Creates a new {@link yfiles.layout.OrientationLayout} instance using the given orientation. - * @param orientation the orientation specifier - * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation is unknown - * @see yfiles.layout.OrientationLayout#orientation - */ - constructor(orientation:yfiles.layout.LayoutOrientation); - /** - * Creates a new {@link yfiles.layout.OrientationLayout} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param coreLayouter the core layout routine - */ - constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm); - /** - * Creates a new {@link yfiles.layout.OrientationLayout} instance with default settings. - */ - constructor(); - /** - * Applies the desired orientation to the graph. - *

- * It performs the inverse coordinate transformation that has been applied to the layout by method - * {@link yfiles.layout.OrientationLayout#prepareOrientationChange}. - *

- *

- * This method is called by {@link yfiles.layout.OrientationLayout#applyLayout} after invoking the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to extend the orientation change to custom layout features. - *

- * @param graph the input graph - * @see yfiles.layout.OrientationLayout#prepareOrientationChange - */ - completeOrientationChange(graph:yfiles.layout.LayoutGraph):void; - /** - * Transforms the given point during completion. - *

- * The point is transformed from {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation to the desired orientation. - *

- * @param point the calculated point - * @returns the transformed point - * @see yfiles.layout.OrientationLayout#completeOrientationChange - */ - completeTransform(point:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Creates {@link yfiles.algorithms.Insets} that are a geometric transformation of the given {@link yfiles.algorithms.Insets}. - *

- * The transform will correspond to the currently set orientation. - *

- * @param insets the original insets - * @returns the oriented insets - * @see yfiles.layout.OrientationLayout#orientation - */ - createOrientedInsets(insets:yfiles.algorithms.Insets):yfiles.algorithms.Insets; - /** - * Creates a {@link yfiles.layout.NodeHalo} that is a geometric transformation of the given {@link yfiles.layout.NodeHalo}. - *

- * The transform will correspond to the currently set orientation. - *

- * @param halo the original {@link } - * @returns the oriented {@link } - * @see yfiles.layout.OrientationLayout#orientation - */ - createOrientedNodeHalo(halo:yfiles.layout.NodeHalo):yfiles.layout.NodeHalo; - /** - * Creates a {@link yfiles.algorithms.YDimension} that is a geometric transformation of the given size. - *

- * The transform will correspond to the currently set orientation. - *

- * @param nodeSize the original node size - * @returns the oriented node size - * @see yfiles.layout.OrientationLayout#orientation - */ - createOrientedNodeSize(nodeSize:yfiles.algorithms.YDimension):yfiles.algorithms.YDimension; - /** - * Returns whether or not this {@link yfiles.layout.OrientationLayout} instance will mirror the graph for a given layout - * orientation. - *

- * Horizontal orientations get mirrored at the x-axis while vertical orientations are mirrored at the y-axis. - *

- * @param orientation the layout orientation for which to check the mirror state - * @returns true if the layout algorithm will mirror the graph at the corresponding axis for the given layout orientation, false - * otherwise - * @see yfiles.layout.OrientationLayout#orientation - * @see yfiles.layout.OrientationLayout#mirrorMode - */ - isOrientationMirrored(orientation:yfiles.layout.LayoutOrientation):boolean; - /** - * Prepares the layout for the desired orientation. - *

- * It will rotate and mirror the coordinates and bounds of the graph layout such that the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can perform - * its calculations assuming the canonical {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. - *

- *

- * This method is called by {@link yfiles.layout.OrientationLayout#applyLayout} before invoking the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It might be overridden to extend the preparations to custom layout features. - *

- * @param graph the input graph - * @see yfiles.layout.OrientationLayout#completeOrientationChange - */ - prepareOrientationChange(graph:yfiles.layout.LayoutGraph):void; - /** - * Transforms the given point during preparation. - *

- * The point is transformed so it matches the {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. - *

- * @param point the original point - * @returns the transformed point - * @see yfiles.layout.OrientationLayout#prepareOrientationChange - */ - prepareTransform(point:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Transforms the given point during the preparation or completion step. - *

- * This method is called by {@link yfiles.layout.OrientationLayout#prepareOrientationChange} and {@link yfiles.layout.OrientationLayout#completeOrientationChange} - * to get the according point location. - *

- * @param point the original/calculated point - * @param prepare true if this method is called during preparation, false if it is called during completion - * @returns the transformed point - * @see yfiles.layout.OrientationLayout#prepareOrientationChange - * @see yfiles.layout.OrientationLayout#completeOrientationChange - * @see yfiles.layout.OrientationLayout#prepareTransform - * @see yfiles.layout.OrientationLayout#completeTransform - * @protected - */ - transform(point:yfiles.algorithms.YPoint,prepare:boolean):yfiles.algorithms.YPoint; - /** - * Gets or sets the main direction of the layout. - * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation is unknown - * @type {yfiles.layout.LayoutOrientation} - */ - orientation:yfiles.layout.LayoutOrientation; - /** - * Gets or sets the mirror mask that defines which orientations this {@link yfiles.layout.OrientationLayout} shall mirror. - *

- * {@link yfiles.layout.OrientationLayout#orientation Setting a layout orientation} can be seen as rotating the graph by 90, 180 or 270 degrees. Afterwards the graph can be - * mirrored at the x-axis (for horizontal layout orientations) or y-axis (for vertical layout orientations). - *

- *

- * Which directions are mirrored can be defined by the given mask. It can combine several mirrored directions with a - * logical or-operation. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown mask is specified - * @type {yfiles.layout.MirrorModes} - */ - mirrorMode:yfiles.layout.MirrorModes; - /** - * Gets whether or not the current orientation is horizontal. - *

- * The orientation is horizontal if it is {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} or - * {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT}. - *

- * @see yfiles.layout.OrientationLayout#orientation - * @type {boolean} - */ - horizontalOrientation:boolean; - /** - * Gets or sets whether or not the position of the edge labels should be changed during orientation change. - * @type {boolean} - */ - considerEdgeLabels:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.OrientationLayout; - } - /** - * {@link yfiles.layout.PortCalculator} adjusts the final port assignments after a layout has been calculated. - *

- * This can be useful if the port assignment calculated by the layout algorithm is insufficient. This stage uses {@link yfiles.algorithms.IDataProvider} - * instances registered with the graph using the keys defined in the {@link yfiles.layout.IIntersectionCalculator} interface to - * calculate the new port offsets. - *

- *

- * For each edge in the graph, {@link yfiles.layout.IIntersectionCalculator}s are retrieved from these - * {@link yfiles.algorithms.IDataProvider}s. If such an {@link yfiles.layout.IIntersectionCalculator} is assigned, it will provide the - * intersection point of the edge and the node. Then this point is added to the {@link yfiles.layout.IEdgeLayout}. - *

- *

- * For this layout stage to work properly, use {@link yfiles.layout.CompositeLayoutStage#prependStage} or {@link yfiles.layout.MultiStageLayout#prependStage} - * to add this layout stage and register appropriate {@link yfiles.algorithms.IDataProvider}s with the graph using the keys defined - * in {@link yfiles.layout.IIntersectionCalculator}. - *

- *

- * Note that this class will not change the coordinates of a port if it is associated with a strong port constraint. - *

- * @see yfiles.layout.IIntersectionCalculator - * @see yfiles.layout.IntersectionCalculatorKeys#SOURCE_INTERSECTION_CALCULATOR_DP_KEY - * @see yfiles.layout.IntersectionCalculatorKeys#TARGET_INTERSECTION_CALCULATOR_DP_KEY - * @see yfiles.layout.PortConstraint - * @class - * @extends {yfiles.layout.LayoutStageBase} - * @implements {yfiles.layout.ILayoutStage} - */ - export interface PortCalculator extends yfiles.layout.LayoutStageBase,yfiles.layout.ILayoutStage{} - export class PortCalculator { - /** - * Creates a new {@link yfiles.layout.PortCalculator} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - */ - constructor(); - /** - * Performs the actual port calculation on the specified graph instance. - * @param graph the input graph - * @protected - */ - calculatePorts(graph:yfiles.layout.LayoutGraph):void; - /** - * Determines whether two points are equal. - *

- * This implementation uses {@link yfiles.layout.PortCalculator#Eps} to add some tolerance to the comparison. It is called by {@link yfiles.layout.PortCalculator#calculatePorts} - * and may be overridden to change the accuracy/tolerance of the comparison. - *

- * @param x1 the x-coordinate of the first point - * @param y1 the y-coordinate of the first point - * @param x2 the x-coordinate of the second point - * @param y2 the y-coordinate of the second point - * @returns true if both points are considered equal, false otherwise - * @see yfiles.layout.PortCalculator#calculatePorts - * @see yfiles.layout.PortCalculator#Eps - * @protected - */ - equalsEps(x1:number,y1:number,x2:number,y2:number):boolean; - /** - * EPSILON used by {@link yfiles.layout.PortCalculator#equalsEps}. - *

- * By default this is 0.2d. - *

- * @protected - * @type {number} - */ - Eps:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortCalculator; - } - /** - * This class represents a candidate port on which edges can be connected to their source and/or target node. - *

- * The notion of {@link yfiles.layout.PortCandidate}s extends the one of {@link yfiles.layout.PortConstraint}s. In contrast to - * {@link yfiles.layout.PortConstraint}s, they can be associated with both edges and nodes. Moreover, more than one {@link yfiles.layout.PortCandidate} - * can be specified for an edge or a node. - *

- *

- * Edge {@link yfiles.layout.PortCandidate}s can be introduced to define specific sides or exact locations on which a given edge can be - * connected to its source or target node. - *
- * Information about edge {@link yfiles.layout.PortCandidate}s is held by {@link yfiles.algorithms.IDataProvider}s that are registered with - * the graph using keys {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY} (to specify - * {@link yfiles.layout.PortCandidate}s for an edge on the source node) and {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY} - * (to specify {@link yfiles.layout.PortCandidate}s for an edge on the target node). The {@link yfiles.algorithms.IDataProvider}s hold a {@link yfiles.collections.ICollection. collection} - * of {@link yfiles.layout.PortCandidate}s for each edge. - *

- *

- * Node {@link yfiles.layout.PortCandidate}s determine available ports on the nodes to which edges can be connected. This means that an - * edge of the graph can be connected to any of these node ports (unless edge {@link yfiles.layout.PortCandidate}s are specified - * too). - *
- * To register and define node {@link yfiles.layout.PortCandidate}s refer to {@link yfiles.layout.PortCandidateSet}. - *

- *

- * A {@link yfiles.layout.PortCandidate} is described by the following attributes: - *

- *
    - *
  • - * Offsets: The X-offset (Y-offset) determines the horizontal (vertical) distance of the {@link yfiles.layout.PortCandidate} - * relative to the center of the node. - *
  • - *
  • - * Fixed or free: Fixed - * {@link yfiles.layout.PortCandidate}s are defined using exact coordinates, whereas coordinates of free candidates are selected - * arbitrarily. - *
  • - *
  • - * Direction: Corresponds to the incoming or outgoing directions of the edges when connecting to a target or source node, - * respectively. - *
  • - *
  • - * Penalty cost: Represents the cost of usage of a - * {@link yfiles.layout.PortCandidate}. During the processing of an edge by a layout or routing algorithm, candidates of lower cost - * will be considered first. - *
  • - *
- *

- * If candidates are defined for nodes as well as for edges and if they should be properly matched by layout algorithms - * (i.e. detected as the same candidate), then it is important that the same {@link yfiles.layout.PortCandidate} instance is - * registered. It does not suffice to register candidates with the same parameter values. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ff0000","b":1, "c":1}, "7":{"f":"#00ffff","b":1}, "8":{"f":"#008000","b":1}},"n":[[646.5,475.5],[725.5,528.5],[831.5,470],[669.5,605.5],[722.5,530.5,6,6,8],[724,549.5,3,8,7],[783,531,5,5,6],[783,551,5,5,6],[667.5,502,6,6,8],[696.5,604.5,8,3,7],[848,498,5,5,6],[696.5,634,8,3,7],[848,468.12,5,5,6],[667.5,472.5,6,6,8],[737.5,525,6,6,8]],"e":[[0,1,-6,15,-30,-10,[670.5,533.5]],[2,1,-11,15,30,-10,[850.5,533.5]],[3,1,1,-15,-30,10,[700.5,553.5]]],"vp":[646.0,468.0,246.0,169.0]}} Example of using edge port candidates. Edge port candidates are colored uniquely based on the edge with which they are - * associated. - *

- *

- * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortCandidate}s. Major layout algorithms that obey - * them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} and - * {@link yfiles.router.BusRouter}. - *

- * @class - */ - export interface PortCandidate extends yfiles.lang.Object{} - export class PortCandidate { - /** - * Factory method that creates a fixed {@link yfiles.layout.PortCandidate} instance with the given cost of usage, direction and - * offset values. - * @param directionMask any combination of the default direction specifiers - * @param xOffset the X-offset relative to the center of the node - * @param yOffset the Y-offset relative to the center of the node - * @param [cost=0.0] the penalty cost for using this {@link } instance - * @returns a new {@link } instance - * @static - */ - static createCandidate(xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirections,cost?:number):yfiles.layout.PortCandidate; - /** - * Factory method that creates a free {@link yfiles.layout.PortCandidate} instance with the given direction and cost of usage. - * @param directionMask any combination of the default direction specifiers - * @param cost the penalty cost for using this {@link } - * @returns a new {@link } instance - * @static - */ - static createCandidate(directionMask:yfiles.layout.PortDirections,cost:number):yfiles.layout.PortCandidate; - /** - * Factory method that returns a free {@link yfiles.layout.PortCandidate} instance with zero cost of usage and the direction - * specified by the {@link yfiles.layout.PortConstraint#side side} of the given {@link yfiles.layout.PortConstraint}. - * @param fromPortConstraint the {@link } whose {@link #side side} should be used as direction - * @returns a new {@link } instance - * @static - */ - static createCandidate(fromPortConstraint:yfiles.layout.PortConstraint):yfiles.layout.PortCandidate; - /** - * Factory method that creates a free {@link yfiles.layout.PortCandidate} instance with the given direction and zero cost of - * usage. - * @param directionMask any combination of the default direction specifiers - * @returns a new {@link } instance - * @static - */ - static createCandidate(directionMask:yfiles.layout.PortDirections):yfiles.layout.PortCandidate; - /** - * Returns the direction of this {@link yfiles.layout.PortCandidate} instance with respect to the given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. - *

- * If the direction mask is not required to be calculated with respect to the actual {@link yfiles.layout.OrientationLayout#orientation layout orientation}, {@link yfiles.layout.PortCandidate#direction} should be used - * instead. - *

- * @param layoutOrientation - * @returns the direction of this {@link } with respect to the given layout orientation - * @see yfiles.layout.PortCandidate#direction - */ - getDirectionForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):yfiles.layout.PortDirections; - /** - * Returns the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the - * given {@link yfiles.layout.OrientationLayout#orientation layout orientation} and {@link yfiles.layout.OrientationLayout#mirrorMode mirror mask}. - *

- * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is equal to zero. - *

- * @param layoutOrientation the layout orientation - * @param mirrorMask the mirror mask - * @returns the X-offset of the port with respect to the given orientation and mirror mask - */ - getXOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):number; - /** - * Returns the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the - * given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. - *

- * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is equal to zero. - *

- * @param layoutOrientation the layout orientation - * @returns the X-offset of the {@link } with respect to the given layout orientation - */ - getXOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):number; - /** - * Returns the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the - * given {@link yfiles.layout.OrientationLayout#orientation layout orientation} and {@link yfiles.layout.OrientationLayout#mirrorMode mirror mask}. - *

- * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is equal to zero. - *

- * @param layoutOrientation the layout orientation - * @param mirrorMask the mirror mask - * @returns the Y-offset of the {@link } with respect to the given orientation and mirror mask - */ - getYOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):number; - /** - * Returns the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the - * given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. - *

- * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is equal to zero. - *

- * @param layoutOrientation the layout orientation - * @returns the Y-offset of the {@link } with respect to the given layout orientation - */ - getYOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):number; - /** - * Returns whether or not this {@link yfiles.layout.PortCandidate} lies in the given direction. - * @param directionMask one of the default direction specifiers - * @returns true if this {@link } lies in the given direction, false otherwise - */ - isInDirection(directionMask:yfiles.layout.PortDirections):boolean; - /** - * A utility method that converts the current {@link yfiles.layout.PortCandidate} instance to a {@link yfiles.layout.PortConstraint}. - *

- * The {@link yfiles.layout.PortConstraint#side side} of the created {@link yfiles.layout.PortConstraint} matches the {@link yfiles.layout.PortCandidate#direction direction} of this {@link yfiles.layout.PortCandidate}. - *

- *

- * If this {@link yfiles.layout.PortCandidate} is {@link yfiles.layout.PortCandidate#fixed fixed}, the resulting {@link yfiles.layout.PortConstraint} will be {@link yfiles.layout.PortConstraint#strong strong}. - *

- * @returns a {@link } that matches this {@link } - */ - toPortConstraint():yfiles.layout.PortConstraint; - /** - * A utility method that converts the current {@link yfiles.layout.PortCandidate} instance to a {@link yfiles.layout.PortConstraint} with - * respect to the given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. - *

- * The {@link yfiles.layout.PortConstraint#side side} of the created {@link yfiles.layout.PortConstraint} is the {@link yfiles.layout.PortCandidate#direction direction} of this {@link yfiles.layout.PortCandidate} interpreted - * for the given orientation. - *

- *

- * If this {@link yfiles.layout.PortCandidate} is {@link yfiles.layout.PortCandidate#fixed fixed}, the resulting {@link yfiles.layout.PortConstraint} will be {@link yfiles.layout.PortConstraint#strong strong}. - *

- * @param layoutOrientation - * @returns a {@link } that matches this {@link } with respect to the given orientation - */ - toPortConstraintForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):yfiles.layout.PortConstraint; - /** - * Data provider key for specifying source port candidates for each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.>} - */ - static SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY:yfiles.algorithms.EdgeDpKey>; - /** - * Data provider key for specifying target port candidates for each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.>} - */ - static TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY:yfiles.algorithms.EdgeDpKey>; - /** - * Gets the direction of this {@link yfiles.layout.PortCandidate}. - *

- * If the direction is required to be calculated with respect to the actual {@link yfiles.layout.OrientationLayout#orientation layout orientation}, {@link yfiles.layout.PortCandidate#getDirectionForLayoutOrientation} - * should be used instead. - *

- * @see yfiles.layout.PortCandidate#getDirectionForLayoutOrientation - * @type {yfiles.layout.PortDirections} - */ - direction:yfiles.layout.PortDirections; - /** - * Gets whether or not this {@link yfiles.layout.PortCandidate} is fixed. - *

- * Fixed - * {@link yfiles.layout.PortCandidate}s are defined using exact coordinates, whereas coordinates of free candidates are selected - * arbitrarily. - *

- * @type {boolean} - */ - fixed:boolean; - /** - * Gets the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node. - *

- * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is zero. - *

- * @type {number} - */ - xOffset:number; - /** - * Gets the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node. - *

- * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is zero. - *

- * @type {number} - */ - yOffset:number; - /** - * Gets the penalty cost for using this {@link yfiles.layout.PortCandidate} instance. - * @type {number} - */ - cost:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortCandidate; - } - /** - * A {@link yfiles.layout.IPortCandidateMatcher} retrieves the best matching {@link yfiles.layout.IPortCandidateSetEntry entries} from a {@link yfiles.layout.PortCandidateSet}. - *

- * How well a candidate is matching can be decided based on its cost, its currently available capacity, its offsets or - * whether or not its direction is consistent with the desired one. - *

- *

- * To use custom implementations of this interface, method {@link yfiles.layout.PortCandidateSet#createMatcher} should be - * overridden. - *

- * @interface - */ - export interface IPortCandidateMatcher extends yfiles.lang.Object{ - /** - * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry} for the given parameters. - * @param edge the edge for which to find a candidate - * @param source true if the given edge connects to its source node, false otherwise - * @param xOffset the preferred X-offset of the port relative to the center of the node - * @param yOffset the preferred Y-offset of the port relative to the center of the node - * @param directionMask any combination of default directions defined in {@link } - * @returns a matching {@link } instance - * @abstract - */ - findMatchingCandidate(edge:yfiles.algorithms.Edge,source:boolean,xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirections):yfiles.layout.IPortCandidateSetEntry; - /** - * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry} for the given parameters. - * @param edge the edge for which to find a candidate - * @param source true if the given edge connects to its source node, false otherwise - * @param directionMask any combination of default directions defined in {@link } - * @returns a matching {@link } instance - * @abstract - */ - findMatchingCandidate(edge:yfiles.algorithms.Edge,source:boolean,directionMask:yfiles.layout.PortDirections):yfiles.layout.IPortCandidateSetEntry; - /** - * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry}. - * @returns a matching {@link } instance - * @abstract - */ - findMatchingCandidate():yfiles.layout.IPortCandidateSetEntry; - } - var IPortCandidateMatcher:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPortCandidateMatcher; - }; - /** - * This interface represents an entry of a {@link yfiles.layout.PortCandidateSet} and provides access to the actual {@link yfiles.layout.PortCandidate} - * instance and the maximum number of edges allowed to connect to it. - * @interface - */ - export interface IPortCandidateSetEntry extends yfiles.lang.Object{ - /** - * Gets the actual {@link yfiles.layout.PortCandidate} associated with this {@link yfiles.layout.IPortCandidateSetEntry}. - * @abstract - * @type {yfiles.layout.PortCandidate} - */ - portCandidate:yfiles.layout.PortCandidate; - /** - * Gets the maximum number of edges allowed to connect to the {@link yfiles.layout.PortCandidate} associated with this - * {@link yfiles.layout.IPortCandidateSetEntry}. - *

- * 0x7FFFFFFF indicates that the number of connections is unbounded. - *

- * @abstract - * @type {number} - */ - connections:number; - } - var IPortCandidateSetEntry:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPortCandidateSetEntry; - }; - /** - * This class associates {@link yfiles.layout.PortCandidate}s with the nodes of a graph. - *

- * {@link yfiles.layout.PortCandidate}s defined on nodes specify sides or even exact locations at which edges can be connected. - * This means that an edge can be connected to any of the available node ports (unless edge {@link yfiles.layout.PortCandidate}s - * are specified too). Each node {@link yfiles.layout.PortCandidate} has a capacity, i.e., a maximum number of edges allowed to - * connect to it. - *

- *

- * Information about {@link yfiles.layout.PortCandidate}s on nodes is held by a {@link yfiles.algorithms.IDataProvider} that stores a {@link yfiles.layout.PortCandidateSet} - * for each node and is registered with the graph using key {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY}. - *

- *

- * The {@link yfiles.layout.PortCandidate}s are retrieved from the {@link yfiles.layout.PortCandidateSet} through a {@link yfiles.layout.IPortCandidateSetEntry} - * that holds the information about the actual {@link yfiles.layout.PortCandidate}. This object is also used for retrieving the - * best candidate from a {@link yfiles.layout.PortCandidateSet} based on the cost (lower costs are considered first) and the - * available capacity of each candidate. Custom searching for the best {@link yfiles.layout.PortCandidate} can be achieved by - * implementing {@link yfiles.layout.IPortCandidateMatcher} interface. - *

- *

- * {@graph {"ann":{"s":[5,5],"d":1},"styles":{"6":{"f":"#008000","b":1, "c":1}, "7":{"f":"#00ffff","b":1}, "8":{"f":"#ff0000","b":1}},"n":[[-54,-100,60,30],[25,-47,60,30],[131,-105.5,60,30],[-31,30,60,30],[111,30.5,60,30],[63.81,-49.5,8],[40.81,-49.5,8],[23.5,-46,3,8,7],[23.5,-26,3,8,7],[83.5,-46,3,8,7],[83.5,-26,3,8,7,6],[40.81,-19.5,8],[63.81,-19.5,8],[-32.5,-73,6],[-2.5,28,6],[132.5,28,6],[147.5,-77.5,6]],"e":[[0,1,-6,15,-30,-10,[-30,-42]],[2,1,-11,15,30,-10,[150,-42]],[3,1,1,-15,-30,10,[0,-22]],[4,1,-6,-15,30,10,[135,-22]]],"vp":[-54.0,-106.0,245.0,167.0]}} Example of node port candidates. Circular ports represent node port candidates on source nodes of each edge. Square and - * rectangular ports are possible port candidates on the target node. Rectangular ports have zero cost of usage and unit - * capacity whereas square rectangles have unit cost and capacity. - *

- *

- * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortCandidate}s. Major layout algorithms that obey - * them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} and - * {@link yfiles.router.BusRouter}. - *

- * @class - */ - export interface PortCandidateSet extends yfiles.lang.Object{} - export class PortCandidateSet { - /** - * Creates a new empty {@link yfiles.layout.PortCandidateSet} instance. - *

- * Addition of {@link yfiles.layout.PortCandidate}s to this {@link yfiles.layout.PortCandidateSet set} can be performed using {@link yfiles.layout.PortCandidateSet#add}. - *

- */ - constructor(); - /** - * Adds a {@link yfiles.layout.PortCandidate} with the given capacity to this {@link yfiles.layout.PortCandidateSet}. - *

- * The capacity value defines the maximum number of edges allowed to connect to the candidate. If no limitation for this - * number exists, 0x7FFFFFFF can be used. - *

- *

- * The capacity must be greater than zero. - *

- * @param p the {@link } to add - * @param [connections=1] the capacity of the given port - * @throws {Stubs.Exceptions.ArgumentError} if the given capacity is less than or equal to zero - */ - add(p:yfiles.layout.PortCandidate,connections?:number):void; - /** - * Creates a {@link yfiles.layout.IPortCandidateMatcher} that retrieves {@link yfiles.layout.IPortCandidateSetEntry entries} from this {@link yfiles.layout.PortCandidateSet}. - *

- * Each next best matching candidate is determined based on its cost, its current available capacity and based on whether - * or not its direction is consistent with the desired one. - *

- *

- * This method may be overridden to support custom implementations of {@link yfiles.layout.IPortCandidateMatcher}. - *

- * @returns a new {@link } instance - */ - createMatcher():yfiles.layout.IPortCandidateMatcher; - /** - * Calculates the penalty cost for the usage of the given {@link yfiles.layout.IPortCandidateSetEntry entry} and the given parameters. - *

- * The cost is equal to the {@link yfiles.layout.PortCandidate#cost cost of usage} of the {@link yfiles.layout.IPortCandidateSetEntry#portCandidate associated port candidate}. - *

- *

- * This method may be overridden to customize the calculation of the cost of usage of an {@link yfiles.layout.IPortCandidateSetEntry entry}. - *

- * @param entry the entry for which the cost is computed - * @param edge the edge that will connect to the {@link } associated with the entry - * @param source true if the given edge connects to its source node, false otherwise - * @param xOffset the preferred X-offset of the port relative to the center of the node - * @param yOffset the preferred Y-offset of the port relative to the center of the node - * @returns the penalty cost for the usage of the given {@link } - */ - getCost(entry:yfiles.layout.IPortCandidateSetEntry,edge:yfiles.algorithms.Edge,source:boolean,xOffset:number,yOffset:number):number; - /** - * Calculates the priority of the given {@link yfiles.layout.IPortCandidateSetEntry entry}. - *

- * Higher priority means that the entry will be considered earlier by a {@link yfiles.layout.IPortCandidateMatcher}. - *

- *

- * This method may be overridden to customize the calculation of the priority of {@link yfiles.layout.IPortCandidateSetEntry entries}. - *

- * @param entry the entry for which the cost is computed - * @param edge the edge that will connect to the {@link } associated with the entry - * @param source true if the given edge connects to its source node, false otherwise - * @returns the priority of the given {@link } - */ - getPriority(entry:yfiles.layout.IPortCandidateSetEntry,edge:yfiles.algorithms.Edge,source:boolean):number; - /** - * Removes the given {@link yfiles.layout.IPortCandidateSetEntry entry} from the list of candidate entries. - * @param entry the entry to remove - */ - remove(entry:yfiles.layout.IPortCandidateSetEntry):void; - /** - * Data provider key for specifying a port candidate set for each node - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_PORT_CANDIDATE_SET_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets the total number of connections allowed by the {@link yfiles.layout.PortCandidate}s described by this {@link yfiles.layout.PortCandidateSet} - * or 0x7FFFFFFF if the number is unbounded. - * @type {number} - */ - connectionCount:number; - /** - * Gets an {@link yfiles.collections.IEnumerator.} over the list of candidate {@link yfiles.layout.IPortCandidateSetEntry entries} of this {@link yfiles.layout.PortCandidateSet}. - * @type {yfiles.collections.IEnumerator.} - */ - entries:yfiles.collections.IEnumerator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortCandidateSet; - } - /** - * A {@link yfiles.layout.PortConstraint} represents a constraint for the source or target port of an edge path. - *

- * It determines the location at which an edge path can be connected to its source and/or target node. There exist two - * different types of {@link yfiles.layout.PortConstraint}s: - *

- *
    - *
  • Weak {@link yfiles.layout.PortConstraint}s determine the side of the node to which an edge can be connected.
  • - *
  • - * Strong - * {@link yfiles.layout.PortConstraint}s determine the exact coordinates of the point to which an edge path can be connected. These - * coordinates are determined at the time the edge is processed by a layout or routing algorithm and are always interpreted - * relative to a node's center. - *
  • - *
- *

- * {@graph {"ann":{"s":[3,8],"d":1},"styles":{"6":{"f":"#FF0000"},"7":{"f":"#000000"}},"n":[[-570,-40,90,30],[-395,-140,90,30],[-563.02,-184.16,90,30],[-398.2,-140,9,30,6],[-477,-184.16,9,30,6],[-484.4,-40,9,30,6],[-474,-173.16,7],[-395.2,-135.01,7],[-395.2,-122.49,7],[-481.4,-29,7]],"e":[[0,1,45,0,-45,6,[-463.02,-25,-463.02,-119]],[2,1,45,0,-45,-6,[-424.34,-169.16,-424.34,-131]]],"vp":[-570.0,-185.0,265.0,175.0]}} Sample output of weak port constraints. For both edges, source port constraints are associated with side {@link yfiles.layout.PortSide#EAST} - * while target port constraints are associated with side {@link yfiles.layout.PortSide#WEST}. Red rectangles indicate that edges - * can be connected to any point of these sides. Black rectangles represent the selected ports. {@graph {"ann":{"s":[90,30],"d":1},"styles":{"6":{"f":"#FF0000"},"7":{"f":"#000000"}},"n":[[-145,135.67],[30,35.67],[-138.02,-8.49],[-49.82,1.51,4,10,7],[28,45.67,4,10,7],[-57.36,145.67,4,10,7]],"e":[[0,1,[-35,150.67,-35,50.67]],[2,1,[-0.22,6.51,-0.22,50.67]]],"vp":[-145.0,-9.0,265.0,175.0]}} Sample output of strong port - * constraints. For both edges, source port constraints are associated with side {@link yfiles.layout.PortSide#EAST} while target - * port constraints are associated with side - * {@link yfiles.layout.PortSide#WEST}. Black rectangles indicate the exact points on the corresponding sides of the nodes to which - * edges can be connected. - *

- *

- * Information about {@link yfiles.layout.PortConstraint}s is held by {@link yfiles.algorithms.IDataProvider}s that are registered with the - * graph using keys {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} (to specify - * {@link yfiles.layout.PortConstraint}s for an edge on its source node) and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} - * (to specify {@link yfiles.layout.PortConstraint}s for an edge on its target node). - *

- *

- * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortConstraint}s. Major layout algorithms that - * obey them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.tree.TreeLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} - * and {@link yfiles.router.BusRouter}. - *

- * @see yfiles.layout.PortConstraintKeys - * @class - */ - export interface PortConstraint extends yfiles.lang.Object{} - export class PortConstraint { - /** - * Creates a new {@link yfiles.layout.PortConstraint} that constrains the edge to connect to the given side of a node and that can - * be either strong or weak. - *

- * If the {@link yfiles.layout.PortConstraint} is strong, the layout or routing algorithm should use the port coordinates of this - * constraint. - *

- * @param side one of the default side specifiers - * @param [strong=false] true if this {@link } is strong, false otherwise - * @returns a new {@link } instance - * @throws {Stubs.Exceptions.ArgumentError} if an unknown side is given - * @static - */ - static create(side:yfiles.layout.PortSide,strong?:boolean):yfiles.layout.PortConstraint; - /** - * Returns the source {@link yfiles.layout.PortConstraint} associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about source {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} - * is used. - *

- * @param graph the input graph - * @param e the edge - * @returns the source {@link } of the given edge or null if there is none - * @static - */ - static getSPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; - /** - * Returns the target {@link yfiles.layout.PortConstraint} associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about target {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} - * is used. - *

- * @param graph the input graph - * @param e the edge - * @returns the target {@link } of the given edge or null if there is none - * @static - */ - static getTPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; - /** - * Checks whether or not there exist source or target {@link yfiles.layout.PortConstraint}s associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider}s that hold information about source or target - * {@link yfiles.layout.PortConstraint}s, keys {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} - * are used. - *

- * @param graph the input graph - * @param e the edge - * @returns true if the edge has source or target {@link }s, false otherwise - * @static - */ - static hasPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; - /** - * Checks whether or not there exist source {@link yfiles.layout.PortConstraint}s associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about source {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} - * is used. - *

- * @param graph the input graph - * @param e the edge - * @returns true if the edge has source {@link }s, false otherwise - * @static - */ - static hasSPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; - /** - * Checks whether or not there exist target {@link yfiles.layout.PortConstraint}s associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about target {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} - * is used. - *

- * @param graph the input graph - * @param e the edge - * @returns true if the edge has target {@link }s, false otherwise - * @static - */ - static hasTPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance represents a strong constraint. - *

- * A strong {@link yfiles.layout.PortConstraint} determines the exact coordinates where the edge path's end should be located. - *

- * @type {boolean} - */ - strong:boolean; - /** - * Gets the side of the node to which an edge should connect. - * @type {yfiles.layout.PortSide} - */ - side:yfiles.layout.PortSide; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#NORTH}. - * @type {boolean} - */ - atNorth:boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#SOUTH}. - * @type {boolean} - */ - atSouth:boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#EAST}. - * @type {boolean} - */ - atEast:boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#WEST}. - * @type {boolean} - */ - atWest:boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#ANY}. - * @type {boolean} - */ - atAnySide:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortConstraint; - } - /** - * The {@link yfiles.layout.PortConstraintConfigurator} provides the possibility to create - * {@link yfiles.layout.PortConstraint}s according to the initial connecting side of an edge. - * @class - */ - export interface PortConstraintConfigurator extends yfiles.lang.Object{} - export class PortConstraintConfigurator { - /** - * Creates a new {@link yfiles.layout.PortConstraintConfigurator} instance. - */ - constructor(); - /** - * Creates a {@link yfiles.layout.PortConstraint} for the given edge. - *

- * The side of the constraint is set up according to the current drawing of the edge within the given graph. - *

- * @param graph the input graph - * @param edge the edge - * @param source true if a source {@link } for the given edge will be created, false for a target - * {@link } - * @param strong true if a strong {@link } is created, false for a weak {@link } - * @returns the {@link } for the given edge whose side is retrieved from the initial drawing - */ - createPortConstraintFromSketch(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,source:boolean,strong:boolean):yfiles.layout.PortConstraint; - /** - * Creates {@link yfiles.layout.PortConstraint}s for some edges of the given graph. - * @param graph the input graph - * @param ec the {@link } that provides access to the edges for which to create {@link }s - * @param spcMap the {@link } that will be used for storing the source {@link }s of the edges - * @param strongSP true if strong source {@link }s should be assigned, false otherwise - * @param tpcMap the {@link } that will be used for storing the target {@link }s of the edges - * @param strongTP true if strong target {@link }s should be assigned, false otherwise - */ - createPortConstraintsFromSketch(graph:yfiles.layout.LayoutGraph,ec:yfiles.algorithms.IEdgeCursor,spcMap:yfiles.algorithms.IEdgeMap,strongSP:boolean,tpcMap:yfiles.algorithms.IEdgeMap,strongTP:boolean):void; - /** - * Creates weak {@link yfiles.layout.PortConstraint}s for all edges of the given graph. - * @param graph the input graph - * @param spcMap the {@link } that will be used for storing the source {@link }s of the edges - * @param tpcMap the {@link } that will be used for storing the target {@link }s of the edges - */ - createPortConstraintsFromSketch(graph:yfiles.layout.LayoutGraph,spcMap:yfiles.algorithms.IEdgeMap,tpcMap:yfiles.algorithms.IEdgeMap):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortConstraintConfigurator; - } - /** - * {@link yfiles.layout.PortConstraintKeys} are used for associating {@link yfiles.algorithms.IDataProvider DataProviders} that contain constraints for the edges of the - * input graph. - *

- * These constraints can either be {@link yfiles.layout.PortConstraint}s or edge groups. - * {@link yfiles.layout.PortConstraint}s force the edges to start/end on specified sides of the node. They may also restrict ports - * of edges to certain coordinates. Edge groups will bundle edges at a common source or target. They will start at the same - * coordinates and may share parts of their edge routes. - *

- *

- * Layout algorithms that support {@link yfiles.layout.PortConstraint}s or edge groups will access the - * {@link yfiles.algorithms.IDataProvider}s using the provided keys. - *

- * @class - * @static - */ - export interface PortConstraintKeys extends yfiles.lang.Object{} - export class PortConstraintKeys { - /** - * Data provider key for providing source constraints for edges in the input graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_PORT_CONSTRAINT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for providing target constraints for edges in the input graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_PORT_CONSTRAINT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning source group information for edges of the input graph - *

- * Edges sharing a source group identifier will share a common bus near the source or at a common source node if possible. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning target group information for edges of the input graph - *

- * Edges sharing a target group identifier will share a common bus near the target or at a common target node if possible. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning port group ids to the edges' source - *

- * All edges with the same port id at a node will share the same port location. However, they will be routed - * independently. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_PORT_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning port group ids to the edges' target - *

- * All edges with the same port id at a node will share the same port location. However, they will be routed - * independently. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_PORT_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortConstraintKeys; - } - /** - * A {@link yfiles.layout.PreferredPlacementDescriptor} provides placement information for automatic edge labeling. - *

- * It provides several options that influence the label placement in generic labeling algorithms and layout algorithms that - * support integrated label placement. - *

- *

- * The preferred placement can describe multiple locations. For some options, like the {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along the edge}, it is - * possible to have a combination of the valid values. These values can be connected with a logical or-operation. - *

- *

- * The following options describe the preferred placement: - *

- *
    - *
  • the placement along the edge
  • - *
  • the side of the edge
  • - *
  • the reference of the side
  • - *
  • the rotation angle of the label
  • - *
  • the reference for the rotation angle
  • - *
  • the rotation behavior for label on the right side of the edge
  • - *
  • the angle offset for label on the right side of the edge
  • - *
  • the distance between the label and its edge segment
  • - *
- *

- * The {@link yfiles.layout.PreferredPlacementDescriptor} will be immutable after {@link yfiles.layout.PreferredPlacementDescriptor#freeze} - * is called. - *

- *

- * A {@link yfiles.layout.PreferredPlacementDescriptor} must be set for each label and will be retrieved by the layout algorithms - * calling {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor}. - *

- * @class - */ - export interface PreferredPlacementDescriptor extends yfiles.lang.Object{} - export class PreferredPlacementDescriptor { - /** - * Creates a new {@link yfiles.layout.PreferredPlacementDescriptor} instance that copies the given descriptor. - * @param descriptor the {@link } that is copied - */ - constructor(descriptor:yfiles.layout.PreferredPlacementDescriptor); - /** - * Creates a new {@link yfiles.layout.PreferredPlacementDescriptor} instance with default settings. - */ - constructor(); - /** - * Clones this instance by returning a {@link any#memberwiseClone} or this in case this instance is already {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen frozen}. - * @returns An instance of the same type as this instance. - */ - clone():any; - /** - * Makes this {@link yfiles.layout.PreferredPlacementDescriptor} instance immutable. - *

- * If this instance is immutable, all setter methods will throw an {@link yfiles.lang.Exception} when invoked. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#isFrozen - */ - freeze():void; - /** - * Returns whether or not this is an immutable instance of {@link yfiles.layout.PreferredPlacementDescriptor}. - *

- * If this instance is immutable, all setter methods will throw an {@link yfiles.lang.Exception} when invoked. - *

- * @returns true if this instance is immutable, false otherwise - * @see yfiles.layout.PreferredPlacementDescriptor#freeze - */ - isFrozen():boolean; - /** - * Returns an immutable descriptor instance for the specified placement. - *

- * Descriptor instances returned by this method will use default values for all properties but {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along edge} and - * {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge side of edge}. - *

- * @param placement a combination of valid placements along the edge and valid sides of the edge - * @returns an immutable descriptor instance for the specified placement - * @see yfiles.layout.PreferredPlacementDescriptor#isFrozen - * @see yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - * @static - */ - static newSharedInstance(placement:yfiles.layout.LabelPlacements):yfiles.layout.PreferredPlacementDescriptor; - /** - * Gets or sets the preferred placement along the edge. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @type {yfiles.layout.LabelPlacements} - */ - placeAlongEdge:yfiles.layout.LabelPlacements; - /** - * Gets or sets the preferred side of the edge. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @type {yfiles.layout.LabelPlacements} - */ - sideOfEdge:yfiles.layout.LabelPlacements; - /** - * Gets or sets how to interpret the preferred side as given by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge}. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified side reference is invalid - * @type {yfiles.layout.LabelSideReferences} - */ - sideReference:yfiles.layout.LabelSideReferences; - /** - * Gets or sets the angle (in radians) for the label rotation. - *

- * How this angle is applied depends on the {@link yfiles.layout.PreferredPlacementDescriptor#angleReference angle reference}, the {@link yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide rotation} and the {@link yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide offset} for labels on the right side of - * the edge. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @see yfiles.layout.PreferredPlacementDescriptor#angleReference - * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide - * @type {number} - */ - angle:number; - /** - * Gets or sets the reference of the angle given by {@link yfiles.layout.PreferredPlacementDescriptor#angle}. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not a valid angle reference - * @type {yfiles.layout.LabelAngleReferences} - */ - angleReference:yfiles.layout.LabelAngleReferences; - /** - * Gets or sets how the angle is applied to labels on the right side in respect of the labels of the left side of the - * edge. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not a valid angle rotation - * @type {yfiles.layout.LabelAngleOnRightSideRotations} - */ - angleRotationOnRightSide:yfiles.layout.LabelAngleOnRightSideRotations; - /** - * Gets or sets the angle offset for labels that are placed on the right side of the edge. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not valid angle offset - * @type {yfiles.layout.LabelAngleOnRightSideOffsets} - */ - angleOffsetOnRightSide:yfiles.layout.LabelAngleOnRightSideOffsets; - /** - * Gets or sets the preferred distance between a label and the corresponding edge segment. - *

- * If the given distance is < 0, the distance is not fixed, i.e., it is chosen by the automatic labeling algorithm. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified value is infinite or NaN - * @type {number} - */ - distanceToEdge:number; - /** - * Gets whether or not one of the preferred placement locations for this label is at source. - * @see yfiles.layout.LabelPlacements#AT_SOURCE - * @type {boolean} - */ - isAtSource:boolean; - /** - * Gets whether or not one of the preferred placement locations for this label is at center. - * @see yfiles.layout.LabelPlacements#AT_CENTER - * @type {boolean} - */ - isAtCenter:boolean; - /** - * Gets whether or not one of the preferred placements for this label is at target. - * @see yfiles.layout.LabelPlacements#AT_TARGET - * @type {boolean} - */ - isAtTarget:boolean; - /** - * Gets whether or not one of the preferred placements for this label is at the source port. - * @see yfiles.layout.LabelPlacements#AT_SOURCE_PORT - * @type {boolean} - */ - isAtSourcePort:boolean; - /** - * Gets whether or not one of the preferred placements for this label is at the target port. - * @see yfiles.layout.LabelPlacements#AT_TARGET_PORT - * @type {boolean} - */ - isAtTargetPort:boolean; - /** - * Gets whether or not one of the preferred sides for this label is left of the edge. - * @see yfiles.layout.LabelPlacements#LEFT_OF_EDGE - * @type {boolean} - */ - isLeftOfEdge:boolean; - /** - * Gets whether or not one of the preferred sides for this label is on the edge. - * @see yfiles.layout.LabelPlacements#ON_EDGE - * @type {boolean} - */ - isOnEdge:boolean; - /** - * Gets whether or not one of the preferred sides for this label is right of the edge. - * @see yfiles.layout.LabelPlacements#RIGHT_OF_EDGE - * @type {boolean} - */ - isRightOfEdge:boolean; - /** - * Gets whether or not one of the angle interpretations is absolute. - * @see yfiles.layout.LabelAngleReferences#ABSOLUTE - * @type {boolean} - */ - isAngleAbsolute:boolean; - /** - * Gets whether or not one of the angle interpretation is relative to the edge slope. - * @see yfiles.layout.LabelAngleReferences#RELATIVE_TO_EDGE_FLOW - * @type {boolean} - */ - isAngleRelativeToEdgeFlow:boolean; - /** - * Gets whether or not one of the angle interpretations is to rotate the angle of labels that are right of the edge - * co-rotating with the labels left of or centered on the edge, i.e., the angle of all labels is interpreted clockwise. - * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge - * @see yfiles.layout.LabelAngleOnRightSideRotations#CLOCKWISE - * @type {boolean} - */ - isAngleOnRightSideCoRotating:boolean; - /** - * Gets whether or not one of the angle interpretations is to rotate the angle of labels that are right of the edge - * counter-rotating with the labels left of or centered on the edge, i.e., the angle of labels left or centered on edge is - * interpreted clockwise while the angle of labels right of edge is interpreted counter-clockwise. - * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge - * @see yfiles.layout.LabelAngleOnRightSideRotations#COUNTER_CLOCKWISE - * @type {boolean} - */ - isAngleOnRightSideCounterRotating:boolean; - /** - * Gets whether or not one of the angle interpretations is to add no angle offset to labels that are right of the edge. - * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge - * @see yfiles.layout.LabelAngleOnRightSideOffsets#NONE - * @type {boolean} - */ - isAngleOffsetOnRightSideZero:boolean; - /** - * Gets whether or not one of the angle interpretations is to add an angle offset of 180 degrees to labels that are right - * of the edge. - * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge - * @see yfiles.layout.LabelAngleOnRightSideOffsets#SEMI - * @type {boolean} - */ - isAngleOffsetOnRightSide180:boolean; - /** - * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted relative to the edge flow. - * @see yfiles.layout.LabelSideReferences#RELATIVE_TO_EDGE_FLOW - * @type {boolean} - */ - isSideRelativeToEdgeFlow:boolean; - /** - * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted absolute, and on horizontal segments, labels with - * preferred side {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} are placed above the segment. - * @see yfiles.layout.LabelSideReferences#ABSOLUTE_WITH_LEFT_IN_NORTH - * @type {boolean} - */ - isSideAbsoluteWithLeftInNorth:boolean; - /** - * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted absolute, and on horizontal segments, labels with - * preferred side {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE} are placed above the segment. - * @see yfiles.layout.LabelSideReferences#ABSOLUTE_WITH_RIGHT_IN_NORTH - * @type {boolean} - */ - isSideAbsoluteWithRightInNorth:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PreferredPlacementDescriptor; - } - /** - * The {@link yfiles.layout.RemoveCollinearBendsStage} removes all collinear bends found in a graph. - *

- * The algorithm traverses each edge path from source to target and removes for each triple of consecutive collinear bends - * the middle one. - *

- *

- * A collinear bend forms a straight line with its preceding bend and its subsequent bend. The angle between the connecting - * edge segments is either 0 or 180 degrees. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface RemoveCollinearBendsStage extends yfiles.layout.LayoutStageBase{} - export class RemoveCollinearBendsStage { - /** - * Creates a new {@link yfiles.layout.RemoveCollinearBendsStage} instance with default settings. - */ - constructor(); - /** - * Gets or sets the scale that defines how accurate the algorithm is when it comes to comparing the coordinates of two - * bends. - *

- * This value determines how the values of the coordinates are rounded. If rounded coordinates lead to a collinear bend, - * this bend will be removed. - *

- *

- * The scaling factor needs to be positive. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified factor is less than or equal to 0 - * @type {number} - */ - scale:number; - /** - * Gets or sets whether the algorithm removes only collinear bends which lie in the middle of their neighbors or all - * collinear bends. - *

- * In the first case, the angle at the middle bend must be 180 degrees, while in the second case, the angle can be either 180 - * degrees or 0 degrees. - *

- * @type {boolean} - */ - removeStraightOnly:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.RemoveCollinearBendsStage; - } - /** - * {@link yfiles.layout.ReverseEdgesStage} selectively reverses edges in a graph, while keeping the layout and label positions of - * the reversed edges as close to the pre-reversal layout and positions as possible. - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface ReverseEdgesStage extends yfiles.layout.LayoutStageBase{} - export class ReverseEdgesStage { - /** - * Creates a new {@link yfiles.layout.ReverseEdgesStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - * @see yfiles.layout.LayoutStageBase#coreLayout - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Marks edges in a tree-structured graph component that need to be reversed to make the specified node the root of the - * tree component. - *

- * Only edges in the graph component to which the specified node belongs will be marked. - *

- * @param graph the graph to which the specified node belongs - * @param root the node to be considered the root of its tree component - * @param reversedEdges a {@link } to mark edges for reversal - * @throws {Stubs.Exceptions.ArgumentError} if the specified root node is null or does not belong to the specified graph - * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY - * @static - */ - static findReversedTreeEdges(graph:yfiles.layout.LayoutGraph,root:yfiles.algorithms.Node,reversedEdges:yfiles.algorithms.IDataAcceptor):void; - /** - * Reverses the specified edge in the specified graph. - *

- * The layout of the specified edge is reversed as specified in - * {@link yfiles.layout.LayoutGraphUtilities#reverseEdgeLayout}. Moreover, the positions of all labels associated with the - * specified edge are adjusted to match the pre-reversal position as closely as possible. (Depending on a label's model it - * might not always be possible to achieve an exact match.) - *

- * @param graph the graph to which the specified edge belongs - * @param edge the edge to be reversed - * @see yfiles.layout.LayoutGraphUtilities#reverseEdgeLayout - */ - reverseEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Reverses selected edges in the specified graph. - *

- * Selected edges are marked in a {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY}. - *

- *

- * Implementation detail: This method calls {@link yfiles.layout.ReverseEdgesStage#reverseEdge} in order to reverse a selected edge. - *

- * @param graph the graph in which to reverse edges. - * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY - * @see yfiles.layout.ReverseEdgesStage#reverseEdge - */ - reverseEdges(graph:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for selecting edges for reversal - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ReverseEdgesStage; - } - /** - * A {@link yfiles.layout.SelfLoopRouter} routes the self-loops (reflexive edges) of a graph. - *

- * Layout Style The nodes and normal edges are arranged by the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. This layout algorithm only handles the paths of self-loops. - *

- *

- * Self-loops are routed either {@link yfiles.layout.SelfLoopStyle#ORTHOGONAL orthogonal} or with {@link yfiles.layout.SelfLoopStyle#ROUNDED rounded} corners. The layout algorithm places the self-loops in the least - * crowded quadrant around a node. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[100,100],[100,0],[0,100],[0,0]],"e":[[0,0,7.5,15,15,7.5,[122.5,145,145,145,145,122.5]],[0,1,5,-15,5,15],[1,1,10,-15,15,-10,[125,-15,145,-15,145,5]],[1,1,5,-15,15,-5,[120,-20,150,-20,150,10]],[1,0,-5,15,-5,-15],[0,2,-15,5,15,5],[2,2,-10,15,-15,10,[5,145,-15,145,-15,125]],[2,2,-5,15,-15,5,[10,150,-20,150,-20,120]],[2,0,15,-5,-15,-5],[1,3,-15,5,15,5],[2,3,5,-15,5,15],[3,3,-7.5,-15,-15,-7.5,[7.5,-15,-15,-15,-15,7.5]],[3,1,15,-5,-15,-5],[3,2,-5,15,-5,-15]],"vp":[-20.0,-20.0,170.0,170.0]}} - *

- *

- * Small graph with self-loops - *

- *

- * Concept Self-loops are handled in four steps: - *

- *
    - *
  1. Remove all self-loops of the input graph
  2. - *
  3. Invoke the core layout algorithm on the now self-loops free graph
  4. - *
  5. Reinsert all formerly removed self-loops
  6. - *
  7. Route the self-loops of the input graph
  8. - *
- *

- * Features - *

- *

- * {@link yfiles.layout.SelfLoopRouter} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} which cannot - * handle self-loops. Then it will hide the self-loops from this {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} and take over the routing of them. - *
- * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.layout.SelfLoopRouter} can work alone. It will route only the self-loops - * and keep the remaining graph unchanged. - *

- *

- * When all self-loops already have a suitable layout, this layout algorithm can {@link yfiles.layout.SelfLoopRouter#keepAllSelfLoopRoutes keep the self-loop paths}. It will just - * hide the self-loops before invoking the core layout algorithm, such that they are not altered by it. - *
- * To only exclude some self-loops from routing, a {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.layout.SelfLoopRouter#KEEP_SELF_LOOP_LAYOUT_DP_KEY} - * can be used for marking those self-loops. - *

- * @see yfiles.layout.MultiStageLayout - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface SelfLoopRouter extends yfiles.layout.LayoutStageBase{} - export class SelfLoopRouter { - /** - * Creates a new {@link yfiles.layout.SelfLoopRouter} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Calculates the routes of the self-loops in the given graph. - *

- * This method will only change the routes of self-loops that are not marked to be {@link yfiles.layout.SelfLoopRouter#KEEP_SELF_LOOP_LAYOUT_DP_KEY kept}. - *

- *

- * This method is called by {@link yfiles.layout.SelfLoopRouter#applyLayout} after the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} has arranged the graph - * and all self-loops have been reinserted into the graph. It may be overridden to introduce custom self-loop styles. - *

- * @param graph the input graph - * @protected - */ - layoutSelfLoops(graph:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for determining which self-loops should keep their current path - *

- * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all self-loops will be routed. - *

- * @see yfiles.layout.SelfLoopRouter#keepAllSelfLoopRoutes - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static KEEP_SELF_LOOP_LAYOUT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the number of points that are used for rounding the corners of the self-loops. - *

- * For rounded corners, the number of points should be at least - * 2. All smaller values will produce one bend and, therefore, an orthogonal path. - *

- *

- * The number of points for a corner must be at least 1. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified point count is less than 1 - * @see yfiles.layout.SelfLoopRouter#layoutStyle - * @see yfiles.layout.SelfLoopStyle#ROUNDED - * @type {number} - */ - cornerApproximationPointsCount:number; - /** - * Gets or sets the distance between two self-loops incident to the same node. - *

- * The distance needs to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @see yfiles.layout.SelfLoopStyle#ROUNDED - * @type {number} - */ - lineDistance:number; - /** - * Gets or sets whether or not the algorithm chooses the side of the self-loop depending on the incident edges. - *

- * If this option is enabled, self-loops are placed on one of the four corners of the corresponding node. For the choice of - * the corner, the algorithm considers all incident edges. Otherwise, self-loops are always placed at the upper left corner - * of the corresponding node. - *

- * @type {boolean} - */ - smartSelfLoopPlacement:boolean; - /** - * Gets or sets the layout style of the self-loops. - * @throws {Stubs.Exceptions.ArgumentError} if the specified style is unknown - * @type {yfiles.layout.SelfLoopStyle} - */ - layoutStyle:yfiles.layout.SelfLoopStyle; - /** - * Gets or sets whether or not this algorithm should keep all self-loop routes. - *

- * When enabled, no self-loop will be routed, instead the existing self-loop layout will be moved with its node. - *

- * @type {boolean} - */ - keepAllSelfLoopRoutes:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SelfLoopRouter; - } - /** - * A {@link yfiles.layout.SequentialLayout} allows for chaining multiple {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - *

- * The {@link yfiles.layout.ILayoutAlgorithm layout algorithms} are invoked one after the other in the order in which they were - * {@link yfiles.layout.SequentialLayout#appendLayout added to the chain}. They all run independently of each other, i.e., they only influence each other by the changed input - * graph. Hence, the sequence determines the result. - *

- *

- * One possible application would be to bundle several {@link yfiles.layout.ILayoutAlgorithm layout algorithms} and pass a single {@link yfiles.layout.ILayoutAlgorithm} - * instance to a {@link yfiles.layout.BufferedLayout}. - *

- * @class - * @implements {yfiles.layout.ILayoutAlgorithm} - */ - export interface SequentialLayout extends yfiles.lang.Object,yfiles.layout.ILayoutAlgorithm{} - export class SequentialLayout { - /** - * Creates a new {@link yfiles.layout.SequentialLayout} instance with an empty chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - */ - constructor(); - /** - * Appends the given {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to the end of the chain. - * @param layouter the {@link layout algorithm} to append - */ - appendLayout(layouter:yfiles.layout.ILayoutAlgorithm):void; - /** - * Appends the specified list of {@link yfiles.layout.ILayoutAlgorithm layout algorithms} to the end of the chain. - * @param layouters the list of {@link layout algorithms} to append - */ - appendLayouts(layouters:yfiles.collections.ICollection):void; - /** - * Executes all {@link yfiles.layout.ILayoutAlgorithm layout algorithms} in the chain, one after the other. - *

- * The order of the layout algorithms is defined by the order in which they were appended. - *

- * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Clears the current chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms} and therefore removes all layout algorithms. - */ - removeAll():void; - /** - * Gets or sets the chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - * @see yfiles.layout.SequentialLayout#appendLayout - * @see yfiles.layout.SequentialLayout#appendLayouts - * @type {yfiles.collections.IList.} - */ - layouts:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SequentialLayout; - } - /** - * {@link yfiles.layout.SimpleProfitModel} implements the ranking for edge and node labels. - *

- * In this implementation node label positions have no ranking, the profit for all candidates is 1. - *

- *

- * The ranking of edge label positions depends on the locations described in the {@link yfiles.layout.PreferredPlacementDescriptor} - * associated with an edge. - *

- * @class - * @implements {yfiles.layout.IProfitModel} - */ - export interface SimpleProfitModel extends yfiles.lang.Object,yfiles.layout.IProfitModel{} - export class SimpleProfitModel { - /** - * Creates a new instance of {@link yfiles.layout.SimpleProfitModel}. - */ - constructor(); - /** - * - * @param candidate - * @returns - */ - getProfit(candidate:yfiles.layout.LabelCandidate):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SimpleProfitModel; - } - /** - * {@link yfiles.layout.SliderEdgeLabelLayoutModel} allows placement of labels at a set of continuous rotated positions along both - * sides of an edge or directly on the edge path. - *

- * It is possible to specify distance values that control the distance between label and edge and between label and nodes. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1,"lblB":1},"n":[[14,10],[14,310],[184,10],[184,310],[354,10],[354,310]],"e":[[0,1,[],[[10.59,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]],[2,3,[],[[157.19,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]],[4,5,[],[[327.19,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]]],"vp":[10.0,10.0,374.0,330.0]}} - *

- *

- * {@link yfiles.layout.SliderMode#CENTER} mode on the left, {@link yfiles.layout.SliderMode#SIDE} mode in the middle and {@link yfiles.layout.SliderMode#SINGLE_SIDE} - * on the right - *

- * @class - * @implements {yfiles.layout.IEdgeLabelLayoutModel} - */ - export interface SliderEdgeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.IEdgeLabelLayoutModel{} - export class SliderEdgeLabelLayoutModel { - /** - * Creates a new instance of {@link yfiles.layout.SliderEdgeLabelLayoutModel} with the given mode. - * @param mode the slider mode - * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - */ - constructor(mode:yfiles.layout.SliderMode); - /** - * - * @param labelBounds - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @returns - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):any; - /** - * Returns all {@link yfiles.layout.EdgeLabelCandidate}s that describe valid label positions within this model. - *

- * The number of candidates and their respective locations are computed depending on the geometries of both label and - * edge. - *

- * @param labelLayout the label for which candidates should be generated - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns a list of {@link } instances - */ - getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @param para - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,para:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets the model's slider mode which determines whether the label slides {@link yfiles.layout.SliderMode#CENTER on the edge}, {@link yfiles.layout.SliderMode#SIDE along both sides of the edge} or - * {@link yfiles.layout.SliderMode#SINGLE_SIDE along one side of the edge}. - * @type {yfiles.layout.SliderMode} - */ - mode:yfiles.layout.SliderMode; - /** - * Gets or sets whether or not the distance to the edge is interpreted relative to the edge's path. - *

- * If enabled, the label is placed to the left of the edge segment (relative to the segment direction) if the given - * distance is less than 0 and to the right of the edge segment if the given distance is greater than 0. - *

- *

- * If disabled, the label is placed below the edge segment (in geometric sense) if the distance is less than 0 and above - * the edge segment if the distance is greater than 0. - *

- * @see yfiles.layout.SliderEdgeLabelLayoutModel#distance - * @type {boolean} - */ - distanceRelativeToEdge:boolean; - /** - * Gets or sets the distance between the label's box and the edge's path. - * @see yfiles.layout.SliderEdgeLabelLayoutModel#distanceRelativeToEdge - * @type {number} - */ - distance:number; - /** - * Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference - * edge segment. - * @type {boolean} - */ - autoRotationEnabled:boolean; - /** - * Gets or sets whether or not edge labels get flipped if they would be upside down in their current position. - * @type {boolean} - */ - autoFlipping:boolean; - /** - * Gets or sets the angle (measured in radians) of the label model. - *

- * The angle is applied in clockwise direction. - *

- * @type {number} - */ - angle:number; - /** - * Gets a model parameter that encodes the default position of this model's allowed edge label positions. - *

- * This parameter can be passed to {@link yfiles.layout.SliderEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- *

- * The default positions for the {@link yfiles.layout.SliderEdgeLabelLayoutModel#mode slider modes} are relative to the first edge segment, either at the beginning of the - * segment ({@link yfiles.layout.SliderMode#SIDE} or - * {@link yfiles.layout.SliderMode#SINGLE_SIDE}) or at its middle ({@link yfiles.layout.SliderMode#CENTER}). - *

- * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SliderEdgeLabelLayoutModel; - } - /** - * A {@link yfiles.layout.SubgraphLayout} is a {@link yfiles.layout.ILayoutStage} that filters out all graph elements that are not part of - * a specific subgraph. - *

- * The nodes that induce this subgraph are marked using a {@link yfiles.algorithms.IDataProvider} registered with a {@link yfiles.layout.SubgraphLayout#affectedNodesDpKey specific key}. - * They will be arranged by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface SubgraphLayout extends yfiles.layout.LayoutStageBase{} - export class SubgraphLayout { - /** - * Creates a new {@link yfiles.layout.SubgraphLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which marks the nodes that induce the subgraph to be - * arranged. - * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - affectedNodesDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SubgraphLayout; - } - /** - * A {@link yfiles.layout.SwimlaneRepresentative SwimlaneRepresentative} represents the position and arrangement mode for a swimlane. - * @class - */ - export interface SwimlaneRepresentative extends yfiles.lang.Object{} - export class SwimlaneRepresentative { - /** - * Creates a new {@link yfiles.layout.SwimlaneRepresentative} instance. - * @param swimlanePos denotes the current position of the represented swimlane - * @param allowRearrangement true if the represented swimlane may be {@link #allowRearrangement rearranged}, false otherwise - */ - constructor(swimlanePos:number,allowRearrangement:boolean); - /** - * Gets or sets the current position of the represented swimlane. - *

- * The swimlane positions are described by a zero-based index and must not be negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the position is smaller than 0 - * @type {number} - */ - swimlanePos:number; - /** - * Gets or sets whether or not the represented swimlane can be rearranged. - *

- * For all swimlanes with disabled rearrangement, the relative ordering given by {@link yfiles.layout.SwimlaneRepresentative#swimlanePos} is preserved. The other swimlanes may be - * rearranged. - *

- * @type {boolean} - */ - allowRearrangement:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SwimlaneRepresentative; - } - /** - * {@link yfiles.layout.Swimlanes} provides helper classes and methods to handle swimlanes. - *

- * It is used by {@link yfiles.hierarchic.HierarchicLayout} to arrange the nodes in lanes. - *

- * @class - * @static - */ - export interface Swimlanes extends yfiles.lang.Object{} - export class Swimlanes { - /** - * Calculates an ordering of the swimlanes considering the specified ordering mode. - *

- * Depending on the swimlane mode, the ordering will try to reduce: - *

- *
    - *
  1. the number of swimlanes traversed by edges
  2. - *
  3. the number of swimlanes spanned by {@link yfiles.layout.GroupingSupport#isGroupNode group nodes}
  4. - *
- * @param graph the input graph - * @param node2Swimlane the assignment of nodes to swimlanes - * @param iterations the number of iterations performed by the heuristic. - * @param mode one of the valid swimlane ordering mode specifier - * @see yfiles.layout.SwimlaneRepresentative - * @see yfiles.layout.GroupingSupport - * @static - */ - static arrangeSwimlanes(graph:yfiles.algorithms.Graph,node2Swimlane:yfiles.algorithms.IDataProvider,iterations:number,mode:yfiles.layout.SwimlanesMode):void; - /** - * Calculates an ordering of the swimlanes. - *

- * The ordering will try to reduce: - *

- *
    - *
  1. the number of swimlanes traversed by edges
  2. - *
  3. the number of swimlanes spanned by {@link yfiles.layout.GroupingSupport#isGroupNode group nodes}
  4. - *
- * @param graph the input graph - * @param node2Swimlane the assignment of nodes to swimlanes - * @see yfiles.layout.SwimlaneRepresentative - * @see yfiles.layout.GroupingSupport - * @static - */ - static arrangeSwimlanes(graph:yfiles.algorithms.Graph,node2Swimlane:yfiles.algorithms.IDataProvider):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.Swimlanes; - } - export enum OperationType{ - /** - * Operation specifier defining that the graph will be mirrored at the x-axis. - * @see yfiles.layout.GraphTransformer#operation - */ - MIRROR_X_AXIS, - /** - * Operation specifier defining that the graph will be mirrored at the y-axis. - * @see yfiles.layout.GraphTransformer#operation - */ - MIRROR_Y_AXIS, - /** - * Operation specifier defining that the graph will be rotated. - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.GraphTransformer#rotationAngle - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - */ - ROTATE, - /** - * Operation specifier defining that the graph will be scaled. - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.GraphTransformer#scaleFactor - * @see yfiles.layout.GraphTransformer#setScaleFactors - * @see yfiles.layout.GraphTransformer#scaleNodeSize - */ - SCALE, - /** - * Operation specifier defining that the graph will be translated. - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.GraphTransformer#translateX - * @see yfiles.layout.GraphTransformer#translateY - */ - TRANSLATE - } - /** - * This layout algorithm applies geometric transformations to (sub-)graphs. - *

- * Layout Style There are several ways to transform the graph that include mirroring, rotating, scaling and translating. {@graph {"ann":{"s":[30,30],"d":1},"n":[[-15,235],[-15,360],[-15,110],[235,485],[110,485],[360,485],[-15,485],[485,235],[485,360],[235,-15],[110,-15],[360,-15],[485,110],[-15,-15],[485,485],[485,-15],[235,235,1],[146.61,146.61,1],[146.61,323.39,1],[58.22,235,1],[323.39,323.39,1],[235,411.78,1],[323.39,146.61,1],[235,58.22,1],[411.78,235,1]],"e":[[1,0],[0,2],[4,3],[3,5],[1,6],[6,4],[7,8],[9,10],[11,9],[12,7],[2,13],[13,10],[8,14],[14,5],[11,15],[12,15],[16,17],[16,18],[19,17],[19,18],[20,16],[18,21],[21,20],[22,16],[23,22],[23,17],[20,24],[22,24],[17,0],[19,1],[23,2],[18,3],[4,19],[5,21],[20,7],[21,8],[9,22],[10,23],[24,11],[24,12]],"vp":[-15.0,-15.0,530.0,530.0]}} - *

- *

- * The highlighted subgraph is rotated by 45 degrees - *

- *

- * Features - *

- *

- * The layout can be {@link yfiles.layout.OperationType#SCALE scaled} with independent factors for the horizontal and vertical scaling. Optionally, the sizes of - * nodes can be scaled, too. - *

- *

- * The layout can be mirrored either on the {@link yfiles.layout.OperationType#MIRROR_X_AXIS x-axis} or the {@link yfiles.layout.OperationType#MIRROR_Y_AXIS y-axis}. - *

- *

- * A {@link yfiles.layout.OperationType#ROTATE rotation} can be specified. Instead of {@link yfiles.layout.GraphTransformer#rotationAngle defining} a rotation angle the angle can be {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled determined automatically} to fit - * specific bounds. - *

- *

- * The coordinates in the layout can be {@link yfiles.layout.OperationType#TRANSLATE translated} by a specific vector. - *

- *

- * To only apply previously mentioned transformations to a subgraph, the {@link yfiles.layout.SubgraphLayout} needs to be {@link yfiles.layout.MultiStageLayout#subgraphLayoutEnabled enabled}. - * Then the nodes in the subgraph must be marked in a {@link yfiles.algorithms.IDataProvider} registered with the according {@link yfiles.layout.SubgraphLayout#affectedNodesDpKey key}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - * @implements {yfiles.layout.ILayoutStage} - */ - export interface GraphTransformer extends yfiles.layout.MultiStageLayout,yfiles.layout.ILayoutStage{} - export class GraphTransformer { - /** - * Creates a new instance of {@link yfiles.layout.GraphTransformer} with default settings. - */ - constructor(); - /** - * Rotates the given graph so its resulting bounding box fits best to the given bounds. - * @param graph the graph that is rotated - * @param width the width of the preferred layout bounds - * @param height the height of the preferred layout bounds - * @returns the rotation angle - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - * @static - */ - static applyBestFitRotationAngle(graph:yfiles.layout.LayoutGraph,width:number,height:number):number; - /** - * Returns the rotation angle for the graph that will result in a layout that fits best to the given bounds. - * @param graph the graph that is rotated - * @param width the width of the preferred layout bounds - * @param height the height of the preferred layout bounds - * @returns the rotation angle - * @see yfiles.layout.GraphTransformer#applyBestFitRotationAngle - * @static - */ - static findBestFitRotationAngle(graph:yfiles.layout.LayoutGraph,width:number,height:number):number; - /** - * Specifies the preferred size of the layout. - *

- * If performing a {@link yfiles.layout.OperationType#ROTATE rotation} and this rotation should be - * {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled automatically fitted}, then the given preferred size defines the aspect ratio that will be used for fitting the layout - * rotation. - *

- *

- * The preferred width and height need to be non-negative. - *

- * @param width the preferred width of the layout - * @param height the preferred height of the layout - * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is negative - * @see yfiles.layout.GraphTransformer#preferredWidth - * @see yfiles.layout.GraphTransformer#preferredHeight - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - */ - preferredLayoutSize(width:number,height:number):void; - /** - * Fits the given graph into the specified rectangular bounds. - *

- * If the bounding box fits in the given bounds, nothing is done. Otherwise, the graph is scaled and optionally moved to - * fit. - *

- * @param graph the graph to modify - * @param x the upper left x-coordinate of the bounds - * @param y the upper left y-coordinate of the bounds - * @param w the width of the bounds - * @param h the height of the bounds - * @static - */ - static setMaximalBounds(graph:yfiles.layout.LayoutGraph,x:number,y:number,w:number,h:number):void; - /** - * Specifies the horizontal and vertical scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. - *

- * Only positive scaling factors are allowed. - *

- * @param xFactor the horizontal scaling factor - * @param yFactor the vertical scaling factor - * @throws {Stubs.Exceptions.ArgumentError} if one the specified scaling factors is negative or 0 - * @see yfiles.layout.GraphTransformer#scaleFactorX - * @see yfiles.layout.GraphTransformer#scaleFactorY - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - */ - setScaleFactors(xFactor:number,yFactor:number):void; - /** - * Translates the layout coordinates by the given vector. - * @param graph the graph that is translated - * @param dx the horizontal distance the given graph is moved - * @param dy the vertical distance the given graph is moved - * @see yfiles.layout.OperationType#TRANSLATE - * @see yfiles.layout.GraphTransformer#operation - * @static - */ - static translate(graph:yfiles.layout.LayoutGraph,dx:number,dy:number):void; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the transformation operation. - * @throws {Stubs.Exceptions.ArgumentError} if the specified operation is unknown - * @type {yfiles.layout.OperationType} - */ - operation:yfiles.layout.OperationType; - /** - * Gets or sets the angle of rotation. - *

- * The angle must be given in degrees. - *

- * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - * @type {number} - */ - rotationAngle:number; - /** - * Gets or sets whether or not to automatically choose the best fitting rotation angle. - *

- * The angle will be chosen such that the bounding box after the rotation fits best to the {@link yfiles.layout.GraphTransformer#preferredLayoutSize preferred aspect ratio}. - *

- * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - * @type {boolean} - */ - bestFitRotationEnabled:boolean; - /** - * Gets or sets the preferred height of the layout. - *

- * This value will be used for {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled fitting the rotation} to preferred bounds. - *

- *

- * The preferred height needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified height is negative - * @see yfiles.layout.GraphTransformer#preferredWidth - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - * @type {number} - */ - preferredHeight:number; - /** - * Gets or sets the preferred width of the layout. - *

- * This value will be used for {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled fitting the rotation} to preferred bounds. - *

- *

- * The preferred width needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified width is negative - * @see yfiles.layout.GraphTransformer#preferredHeight - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - * @type {number} - */ - preferredWidth:number; - /** - * Gets or sets whether or not to also scale node sizes when performing the {@link yfiles.layout.OperationType#SCALE scale operation}. - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - * @type {boolean} - */ - scaleNodeSize:boolean; - /** - * Sets the uniform scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. - *

- * This factor applies vertical and horizontal. - *

- *

- * Only positive scaling factors are allowed. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 - * @see yfiles.layout.GraphTransformer#scaleFactorX - * @see yfiles.layout.GraphTransformer#scaleFactorY - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - * @type {number} - */ - scaleFactor:number; - /** - * Gets or sets the vertical scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. - *

- * Only positive scaling factors are allowed. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 - * @see yfiles.layout.GraphTransformer#scaleFactorX - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - * @type {number} - */ - scaleFactorY:number; - /** - * Gets or sets the horizontal scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. - *

- * Only positive scaling factors are allowed. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 - * @see yfiles.layout.GraphTransformer#scaleFactorY - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - * @type {number} - */ - scaleFactorX:number; - /** - * Gets or sets the horizontal translation distance. - *

- * A positive value means the graph is moved to the right while, a negative value means the graph is moved to the left. - *

- * @see yfiles.layout.GraphTransformer#translateY - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#TRANSLATE - * @type {number} - */ - translateX:number; - /** - * Gets or sets the vertical translation distance. - *

- * A positive value means the graph is moved downwards, while a negative value means the graph is moved upwards. - *

- * @see yfiles.layout.GraphTransformer#translateX - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#TRANSLATE - * @type {number} - */ - translateY:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.GraphTransformer; - } - /** - * A {@link yfiles.layout.ILayoutStage layout stage} that can handle fixed nodes in hierarchically grouped graphs. - *

- * This stage guarantees that a {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} will maintain - * the relative positions of nodes within the same group. - *

- *

- * Also, this stage is responsible for routing edges that connect nodes belonging to hierarchically unrelated groups. More - * precisely, the stage temporarily replaces fixed group nodes (see - * {@link yfiles.layout.FixGroupLayoutStage#FIXED_GROUP_NODES_DP_KEY}) with normal nodes of the same size while the content of the - * groups is removed from the graph during layout. - *

- *

- * The nodes are used as placeholders and are responsible for keeping the relations to the remaining graph elements. Edges - * that originate from the outside of the group node and terminate in its interior (inter-edges) are redirected such that - * they connect to the node that replaces the group. - *

- *

- * After the layout process, the group nodes are restored and the stage inserts the content at the new group position - * (derived from the position of the associated node). The content itself (including the edges between content nodes) - * remains unchanged and is only relocated. Furthermore, the inter-edges are connected to their original source/target and - * the stage reroutes them using the specified inter-edge routing algorithm (see {@link yfiles.layout.FixGroupLayoutStage#interEdgeRouter}). - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[759.46,-86.88,290.54,283.26,2],[982.99,109.5,6],[796.47,109.5,6],[854.11,-67.88,6],[925.35,-67.88,6],[1005,41.75,6],[925.35,151.37,6],[796.47,-26.01,6],[774.46,41.75,6],[982.99,-26.01,6],[854.11,151.37,6],[123.31,-231.69,216.69,224.72,2],[212.57,-132.33,6],[263.97,-67.88,6],[263.97,-196.77,6],[138.31,-168.09,6],[194.23,-51.97,6],[295,-132.33,6],[138.31,-96.56,6],[194.23,-212.69,6],[265,40.5,430,339,2],[465,234.5,45,30],[380,59.5,45,30],[465,284.5,45,30],[380,109.5,45,30],[465,84.5,45,30],[465,134.5,45,30],[550,209.5,45,30],[380,309.5,45,30],[550,259.5,45,30],[380,259.5,45,30],[465,334.5,45,30],[550,134.5,45,30],[635,134.5,45,30],[465,184.5,45,30],[280,184.5,60,30]],"e":[[9,4],[3,7],[8,7],[4,3],[2,8],[10,2],[6,10],[1,6],[5,1],[2,3],[2,9],[2,1],[5,9],[12,18],[12,13],[12,14],[12,15],[12,19],[12,17],[12,16],[30,21],[21,29],[21,27],[35,22],[30,23],[35,24],[24,26],[24,25],[26,32],[35,28],[35,30],[30,31],[30,34],[32,33],[33,2],[33,8],[33,7],[35,17]],"vp":[123.0,-232.0,927.0,612.0]}} Initial graph. Nodes inside groups have to remain at their relative positions. {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[754.73,68.37,290.54,283.26,2],[978.26,264.75,6],[791.74,264.75,6],[849.38,87.37,6],[920.62,87.37,6],[1000.27,197,6],[920.62,306.63,6],[791.74,129.25,6],[769.73,197,6],[978.26,129.25,6],[849.38,306.63,6],[-18.35,97.64,216.69,224.72,2],[70.92,197,6],[122.31,261.44,6],[122.31,132.56,6],[-3.35,161.24,6],[52.58,277.36,6],[153.35,197,6],[-3.35,232.76,6],[52.58,116.64,6],[265,40.5,430,339,2],[465,234.5,45,30],[380,59.5,45,30],[465,284.5,45,30],[380,109.5,45,30],[465,84.5,45,30],[465,134.5,45,30],[550,209.5,45,30],[380,309.5,45,30],[550,259.5,45,30],[380,259.5,45,30],[465,334.5,45,30],[550,134.5,45,30],[635,134.5,45,30],[465,184.5,45,30],[280,184.5,60,30]],"e":[[9,4],[3,7],[8,7],[4,3],[2,8],[10,2],[6,10],[1,6],[5,1],[2,3],[2,9],[2,1],[5,9],[12,18],[12,13],[12,14],[12,15],[12,19],[12,17],[12,16],[30,21],[21,29],[21,27],[35,22],[30,23],[35,24],[24,26],[24,25],[26,32],[35,28],[35,30],[30,31],[30,34],[32,33],[33,8,22.5,6,-2.49,-14.78,[782.24,155.5]],[33,7,22.5,-6,-15,-0.75],[33,2,0,15,-15,0,[657.5,279.75]],[35,17,-30,6.25,13.66,-6.25]],"vp":[-19.0,40.0,1065.0,340.0]}} Example after using {@link yfiles.layout.FixGroupLayoutStage} - * with {@link yfiles.orthogonal.OrthogonalLayout}. Nodes inside groups did not change relative positions. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface FixGroupLayoutStage extends yfiles.layout.LayoutStageBase{} - export class FixGroupLayoutStage { - /** - * Creates a new instance of {@link yfiles.layout.FixGroupLayoutStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Data provider key for selecting group nodes whose contents should keep their relative positions - *

- * A group node is considered selected in this context, if the corresponding {@link yfiles.algorithms.IDataProvider} returns true for the - * group node or any of its ancestor (group) nodes. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_GROUP_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the inter-edge routing style used by this layout stage. - * @throws {Stubs.Exceptions.ArgumentError} if the given routing style is unknown - * @type {yfiles.layout.InterEdgeRoutingStyle} - */ - interEdgeRoutingStyle:yfiles.layout.InterEdgeRoutingStyle; - /** - * Gets or sets the edge routing algorithm that is applied to route the inter-edges. - *

- * If no routing algorithm is set, a new instance of {@link yfiles.layout.CompositeLayoutStage} associated with a {@link yfiles.layout.HideGroupsStage} - * and an {@link yfiles.router.EdgeRouter} will be used. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - interEdgeRouter:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixGroupLayoutStage; - } - /** - * A {@link yfiles.layout.IPartitionFinder} is responsible for partitioning the input graph. - * @interface - */ - export interface IPartitionFinder extends yfiles.lang.Object{ - /** - * Returns a partition ID for each node of an input graph. - *

- * Nodes that share a common partition ID are considered to belong to the same partition. - *

- * @param graph the input graph - * @param partitionIDMap the map that is filled with the resulting partition IDs - * @abstract - */ - findPartitions(graph:yfiles.layout.LayoutGraph,partitionIDMap:yfiles.algorithms.INodeMap):void; - } - var IPartitionFinder:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPartitionFinder; - }; - /** - * A {@link yfiles.layout.IPartitionPlacer} is responsible for arranging the graph partitions. - *

- * Arranging a graph partition usually involves applying a coordinate translation to all elements that belong to the - * partition in order to generate a non-overlapping node arrangement. - *

- * @interface - */ - export interface IPartitionPlacer extends yfiles.lang.Object{ - /** - * Arranges the graph while taking partition IDs and inter-edge information into account. - *

- * Edges which connect nodes that belong to two different partitions are called inter-edges - *

- * @param graph the input graph - * @param partitionIDDP the partition ID for each node in the graph - * @param interEdgeDP the map which marks inter-edges - * @abstract - */ - placePartitions(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; - } - var IPartitionPlacer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPartitionPlacer; - }; - /** - * {@link yfiles.layout.PartitionLayout} provides a framework for layouts that are based on a divide and conquer approach. - *

- * Concept The approach can be subdivided into four stages: - *

- *
    - *
  1. The input graph is partitioned into smaller units. Implementations of this phase can be set using method {@link yfiles.layout.PartitionLayout#partitionFinder}.
  2. - *
  3. Optionally, the layout algorithm arranges each partition. Implementations of this phase can be set using method {@link yfiles.layout.LayoutStageBase#coreLayout}.
  4. - *
  5. - * The graph partitions are arranged next to each other keeping their layout. Implementations of this phase can be set - * using method {@link yfiles.layout.PartitionLayout#partitionPlacer}. - *
  6. - *
  7. - * Edges that connect nodes in different graph partitions will be routed. Implementations of this phase can be set using - * method {@link yfiles.layout.PartitionLayout#interEdgeRouter} - *
  8. - *
- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PartitionLayout extends yfiles.layout.LayoutStageBase{} - export class PartitionLayout { - /** - * Creates a new {@link yfiles.layout.PartitionLayout} instance with default settings. - */ - constructor(); - /** - * Creates a {@link yfiles.layout.IPartitionPlacer} that uses {@link yfiles.layout.ComponentLayout} to place the partitions. - * @param [componentLayout=null] An optional {@link } to use. - * @returns - * @static - */ - static createComponentPartitionPlacer(componentLayout?:yfiles.layout.ComponentLayout):yfiles.layout.IPartitionPlacer; - /** - * Creates a {@link yfiles.layout.IPartitionFinder} that uses {@link yfiles.algorithms.Groups#edgeBetweennessClustering} as strategy for - * finding graph partitions. - * @param [minimumPartitionCount=0] The minimum number of partitions the result should have. - * @param [maximumPartitionCount=0x7FFFFFFF] The maximum number of partitions the result should have. - * @returns - * @static - */ - static createEdgeBetweennessPartitionFinder(minimumPartitionCount?:number,maximumPartitionCount?:number):yfiles.layout.IPartitionFinder; - /** - * Creates a {@link yfiles.layout.IPartitionFinder} that uses {@link yfiles.algorithms.Groups#edgeBetweennessClustering} as strategy for - * finding graph partitions. - * @param {Object} options The parameters to pass. - * @param [options.minimumPartitionCount=0] The minimum number of partitions the result should have. - * @param [options.maximumPartitionCount=0x7FFFFFFF] The maximum number of partitions the result should have. - * @returns - * @static - */ - static createEdgeBetweennessPartitionFinder(options:{minimumPartitionCount?:number,maximumPartitionCount?:number}):yfiles.layout.IPartitionFinder; - /** - * Gets or sets the {@link yfiles.layout.IPartitionFinder} instance that is responsible for partitioning the input graph. - * @type {yfiles.layout.IPartitionFinder} - */ - partitionFinder:yfiles.layout.IPartitionFinder; - /** - * Gets or sets the {@link yfiles.layout.IPartitionPlacer} instance that is responsible for arranging the graph partitions. - * @type {yfiles.layout.IPartitionPlacer} - */ - partitionPlacer:yfiles.layout.IPartitionPlacer; - /** - * Gets or sets the IInterEdgeRouter instance that is responsible for inter-edge routing. - * @type {yfiles.layout.IPartitionInterEdgeRouter} - */ - interEdgeRouter:yfiles.layout.IPartitionInterEdgeRouter; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionLayout; - } - /** - * The {@link yfiles.layout.PortPlacementStage} assigns edges to the ports specified by {@link yfiles.layout.PortConstraint}s or - * {@link yfiles.layout.PortCandidate}s after calling the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * It can be used for adjusting ports for layout algorithms that cannot handle {@link yfiles.layout.PortConstraint}s. - *

- *

- * If {@link yfiles.layout.PortCandidate}s are assigned for edges and nodes, this stage tries to match them. When there is no - * match, the {@link yfiles.layout.PortCandidate} with the lowest costs specified for the edge is chosen. While - * {@link yfiles.layout.PortConstraint}s are also matched to - * {@link yfiles.layout.PortCandidate}s at nodes and edges, it is not recommended to mix them because they belong to different - * concepts. - *

- *

- * Furthermore, option {@link yfiles.layout.PortPlacementStage#pathCorrection} allows to specify whether the edge path should be corrected after correcting a port. - *

- *

- * It is recommended that the {@link yfiles.layout.PortPlacementStage} is prepended to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} in order to be - * able to process all the edges and especially, self-loops and parallel edges. Note that edges that might be hidden by - * other {@link yfiles.layout.ILayoutStage}s cannot be handled by {@link yfiles.layout.PortPlacementStage}. - *

- * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortCandidate - * @see yfiles.layout.PortCandidateSet - * @see yfiles.layout.PortPlacementStage#pathCorrection - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PortPlacementStage extends yfiles.layout.LayoutStageBase{} - export class PortPlacementStage { - /** - * Creates a new {@link yfiles.layout.PortPlacementStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets whether or not this {@link yfiles.layout.ILayoutStage} corrects the edge paths after moving the port to the - * location specified by a {@link yfiles.layout.PortConstraint} or {@link yfiles.layout.PortCandidate}s. - *

- * If path correction is enabled, the edge will be rerouted within a specific area around its source/target node. Outside - * this area, it will keep the route that was calculated by the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. If this feature is disabled, only the ports are moved which may be more suitable for initially - * straight edges. - *

- * @type {boolean} - */ - pathCorrection:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortPlacementStage; - } - /** - * Specifies custom data for the {@link yfiles.layout.ComponentLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface ComponentLayoutData extends yfiles.layout.LayoutData{} - export class ComponentLayoutData { - constructor(); - /** - * Gets or sets a collection of nodes that determine the components that shall be laid out. - *

- * Note that components will be laid out if and only if at least one of the nodes is in this collection. - *

- * @see yfiles.layout.ComponentLayout#AFFECTED_COMPONENTS_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedComponents:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from nodes to their component comparable that is used to sort the components. - * @see yfiles.layout.ComponentLayout#COMPONENT_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - componentIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ComponentLayoutData; - } - /** - * Combines several {@link yfiles.layout.LayoutData} instances. - *

- * This is especially useful if several layouts are run at once, for example a general layout and a subsequent edge - * routing. - *

- * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface CompositeLayoutData extends yfiles.layout.LayoutData{} - export class CompositeLayoutData { - constructor(); - /** - * Gets or sets a collection of composed layout data objects. - * @type {yfiles.collections.ICollection.} - */ - items:yfiles.collections.ICollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.CompositeLayoutData; - } - /** - * Provides different ways to define a mapping from items to values that takes a context object into consideration, too. - *

- * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties {@link yfiles.layout.ContextItemMapping.#contextDelegate}, {@link yfiles.layout.ItemMapping.#delegate}, - * {@link yfiles.layout.ItemMapping.#mapper}, and {@link yfiles.layout.ItemMapping.#constant} should be set on each instance. - *

- *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. - *

- * Type parameter TItem: The type of the items that are mapped. - * Type parameter TValue: The type of the values the items are mapped to. - * Type parameter TContext: The type of the context passed to the {@link yfiles.layout.ContextItemMapping.#contextDelegate} - * @class - * @extends {yfiles.layout.ItemMapping.} - * @template TItem,TValue,TContext - */ - export interface ContextItemMapping extends yfiles.layout.ItemMapping{} - export class ContextItemMapping { - constructor(); - /** - * Provides a mapper mapping the items to values. - * @param adapter The graph adapter the mapper shall be provided for. - * @param layout The layout using the mapper. - * @param context The context object passed to the {@link #contextDelegate}. - * @returns A mapper mapping the items to values. - */ - provideMapperForContext(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm,context:TContext):yfiles.collections.IMapper; - /** - * Gets or sets a delegate from the items and a context object to the values. - * @type {function(TItem, TContext): TValue} - */ - contextDelegate:(arg1:TItem,arg2:TContext)=>TValue; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ContextItemMapping; - } - /** - * Wraps an {@link yfiles.collections.IMapper.} into an {@link yfiles.algorithms.IDataProvider}. - *

- * This class is used by {@link yfiles.layout.LayoutExecutor}, {@link yfiles.layout.LayoutGraphAdapter}, and {@link yfiles.layout.YGraphAdapter} to - * convert an {@link yfiles.graph.IGraph} into a corresponding - * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this - * class usually doesn't need to be used explicitly. - *

- * Type parameter TKey: The type of the keys. - * Type parameter TValue: The type of the values. - * @class - * @implements {yfiles.algorithms.IDataProvider} - * @template TKey,TValue - */ - export interface DataProviderAdapter extends yfiles.lang.Object,yfiles.algorithms.IDataProvider{} - export class DataProviderAdapter { - /** - * Creates a new instance that adapts the provided mapper instance. - * @param keyType The type of the keys. - * @param mapper The mapper to adapt. - */ - constructor(keyType:yfiles.lang.Class,mapper:yfiles.collections.IMapper); - /** - * - * @param dataHolder - * @returns - */ - get(dataHolder:any):any; - /** - * - * @param dataHolder - * @returns - */ - getBoolean(dataHolder:any):boolean; - /** - * - * @param dataHolder - * @returns - */ - getInt(dataHolder:any):number; - /** - * - * @param dataHolder - * @returns - */ - getNumber(dataHolder:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DataProviderAdapter; - } - /** - * An adapter implementation that wraps an {@link yfiles.collections.IMapper.} to an {@link yfiles.algorithms.IDataMap}. - * Type parameter K: The type of the key for the mapper. - * Type parameter V: The type of the value for the mapper. - * @see yfiles.layout.DataProviderAdapter. - * @class - * @extends {yfiles.layout.DataProviderAdapter.} - * @implements {yfiles.algorithms.IDataMap} - * @template K,V - */ - export interface DataMapAdapter extends yfiles.layout.DataProviderAdapter,yfiles.algorithms.IDataMap{} - export class DataMapAdapter { - /** - * Initializes a new instance of the {@link yfiles.layout.DataMapAdapter.} class. - * @param keyType The type of the key for the mapper. - * @param valueType The type of the value for the mapper. - * @param mapper The mapper to adapt. - */ - constructor(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper); - /** - * - * @param dataHolder - * @param value - */ - set(dataHolder:any,value:any):void; - /** - * - * @param dataHolder - * @param value - */ - setBoolean(dataHolder:any,value:boolean):void; - /** - * - * @param dataHolder - * @param value - */ - setInt(dataHolder:any,value:number):void; - /** - * - * @param dataHolder - * @param value - */ - setNumber(dataHolder:any,value:number):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DataMapAdapter; - } - /** - * An item collection that allows to specify the data provider key the collection is registered with. - *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. - *

- * Type parameter T: The type of the items in the collection. - * @class - * @extends {yfiles.layout.ItemCollection.} - * @template T - */ - export interface DpKeyItemCollection extends yfiles.layout.ItemCollection{} - export class DpKeyItemCollection { - constructor(); - /** - * Gets or sets the data provider key that is used for the item collection. - *

- * If no key is set, the default data provider key is used. - *

- * @type {yfiles.algorithms.DpKeyBase.} - */ - dpKey:yfiles.algorithms.DpKeyBase; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DpKeyItemCollection; - } - /** - * An {@link yfiles.layout.EdgeLabelCandidate} that provides a {@link yfiles.graph.ILabelCandidateDescriptor candidate descriptor}. - *

- * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} - * into a corresponding - * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this - * class usually doesn't need to be used explicitly. - *

- * @class - * @extends {yfiles.layout.EdgeLabelCandidate} - */ - export interface ExtendedEdgeLabelCandidate extends yfiles.layout.EdgeLabelCandidate{} - export class ExtendedEdgeLabelCandidate { - /** - * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * @param pos the location of the upper left corner of the candidate. - * @param size the size of the candidate. - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param internal flag whether the candidate is allowed to overlap the layout of the edge. - * @param descriptor the label candidate descriptor. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * @param orientedBox the label size and orientation - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param internal flag whether the candidate is allowed to overlap the layout of the edge. - * @param descriptor the label candidate descriptor. - */ - constructor(orientedBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * @param pos the location of the upper left corner of the candidate. - * @param size the size of the candidate. - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param descriptor the label candidate descriptor. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.IEdgeLabelLayout,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Gets the label candidate descriptor. - * @type {yfiles.graph.ILabelCandidateDescriptor} - */ - descriptor:yfiles.graph.ILabelCandidateDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ExtendedEdgeLabelCandidate; - } - /** - * An {@link yfiles.layout.IProfitModel} that returns the profit of a label candidate for instances of {@link yfiles.layout.ExtendedNodeLabelCandidate} - * and {@link yfiles.layout.ExtendedEdgeLabelCandidate}. - *

- * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} - * into a corresponding - * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this - * class usually doesn't need to be used explicitly. - *

- * @class - * @implements {yfiles.layout.IProfitModel} - */ - export interface ExtendedLabelCandidateProfitModel extends yfiles.lang.Object,yfiles.layout.IProfitModel{} - export class ExtendedLabelCandidateProfitModel { - /** - * Returns the profit for placing a label-candidate. - *

- * This implementation returns the profit for instances of {@link yfiles.layout.ExtendedNodeLabelCandidate} or 0.0 for other - * {@link yfiles.layout.LabelCandidate}s. - *

- * @param candidate a label candidate - * @returns a value between 0 and 1. - */ - getProfit(candidate:yfiles.layout.LabelCandidate):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ExtendedLabelCandidateProfitModel; - } - /** - * A {@link yfiles.layout.NodeLabelCandidate} that provides a {@link yfiles.graph.ILabelCandidateDescriptor candidate descriptor}. - *

- * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} - * into a corresponding - * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this - * class usually doesn't need to be used explicitly. - *

- * @class - * @extends {yfiles.layout.NodeLabelCandidate} - */ - export interface ExtendedNodeLabelCandidate extends yfiles.layout.NodeLabelCandidate{} - export class ExtendedNodeLabelCandidate { - /** - * Returns a new instance of NodeLabelCandidate. - *

- * Returns a new instance of NodeLabelCandidate. - *

- * @param pos the location of the upper left corner of the candidate. - * @param size the size of the candidate. - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param internal flag whether the candidate is inside the node, or outside. - * @param descriptor the label candidate descriptor. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.INodeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Returns a new instance of NodeLabelCandidate. - *

- * Returns a new instance of NodeLabelCandidate. - *

- * @param orientedBox the label size and orientation - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param internal flag whether the candidate is inside the node, or outside. - * @param descriptor the label candidate descriptor. - */ - constructor(orientedBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.INodeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Returns a new instance of ExtendedNodeLabelCandidate. - *

- * Returns a new instance of ExtendedNodeLabelCandidate. - *

- * @param pos the location of the upper left corner of the candidate. - * @param size the size of the candidate. - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param descriptor the label candidate descriptor. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.INodeLabelLayout,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Gets the label candidate descriptor. - * @type {yfiles.graph.ILabelCandidateDescriptor} - */ - descriptor:yfiles.graph.ILabelCandidateDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ExtendedNodeLabelCandidate; - } - /** - * Specifies custom data for the {@link yfiles.layout.FixGroupLayoutStage}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface FixGroupLayoutData extends yfiles.layout.LayoutData{} - export class FixGroupLayoutData { - constructor(); - /** - * Gets or sets the collection of group nodes whose contents should keep their relative positions. - * @see yfiles.layout.FixGroupLayoutStage#FIXED_GROUP_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - fixedGroupNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixGroupLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.layout.FixNodeLayoutStage}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface FixNodeLayoutData extends yfiles.layout.LayoutData{} - export class FixNodeLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes which should be considered fixed. - * @see yfiles.layout.FixNodeLayoutStage#FIXED_NODE_DP_KEY - * @type {yfiles.layout.SingleItemCollection.} - */ - fixedNode:yfiles.layout.SingleItemCollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixNodeLayoutData; - } - /** - * Provides different ways to define the items in a collection for use with {@link yfiles.layout.LayoutData}. - *

- * Only one of the provided ways to define a collection can be used at the same time, therefore only one of the properties - * {@link yfiles.layout.ItemCollection.#items}, {@link yfiles.layout.ItemCollection.#mapper}, and {@link yfiles.layout.ItemCollection.#delegate} should be set on each instance. - *

- *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. - *

- * Type parameter TItem: The type of the items in the collection. - * @class - * @template TItem - */ - export interface ItemCollection extends yfiles.lang.Object{} - export class ItemCollection { - /** - * Provides a mapper describing which elements are contained in this {@link yfiles.layout.ItemCollection.}. - * @param adapter The graph adapter the mapper shall be provided for. - * @param layout The layout using the item collection. - * @returns - */ - provideMapper(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm):yfiles.collections.IMapper; - /** - * Gets or sets a mapping from the items to a boolean value. - *

- * The mapped boolean value specifies whether an item is contained in the collection. - *

- * @type {yfiles.collections.IMapper.} - */ - mapper:yfiles.collections.IMapper; - /** - * Gets or sets a delegate from the items to a boolean value. - *

- * The returned boolean value describes whether an item is contained in the collection. - *

- * @type {function(TItem): boolean} - */ - delegate:(obj:TItem)=>boolean; - /** - * Gets or sets a collection of items. - *

- * This collection contains exactly the items in the given collection. - *

- * @type {yfiles.collections.ICollection.} - */ - items:yfiles.collections.ICollection; - /** - * Sets an enumerable of items. - *

- * This collection contains exactly the items in the given enumerable. - *

- * @type {yfiles.collections.IEnumerable.} - */ - source:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ItemCollection; - } - /** - * Provides different ways to define a mapping from items to values for use with {@link yfiles.layout.LayoutData}. - *

- * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties {@link yfiles.layout.ItemMapping.#mapper}, {@link yfiles.layout.ItemMapping.#delegate} - * and {@link yfiles.layout.ItemMapping.#constant} should be set on each instance. - *

- *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be instantiated by client code - * explicitly. Instances of this class are properties of concrete {@link yfiles.layout.LayoutData} implementations. - *

- * Type parameter TItem: The type of the items that are mapped. - * Type parameter TValue: The type of the values the items are mapped to. - * @class - * @template TItem,TValue - */ - export interface ItemMapping extends yfiles.lang.Object{} - export class ItemMapping { - /** - * Provides a mapper mapping the items to values. - *

- * This implementation returns the {@link yfiles.layout.ItemMapping.#mapper} if one has been set, otherwise it will create a mapper from the {@link yfiles.layout.ItemMapping.#delegate} if one has been - * specified or uses a constant mapper if a {@link yfiles.layout.ItemMapping.#constant} has been specified. If none have been specified, null is returned. - *

- * @param adapter The graph adapter the mapper shall be provided for. - * @param layout The layout using the mapper. - * @returns A mapper that maps items to values or null. - */ - provideMapper(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm):yfiles.collections.IMapper; - /** - * Gets or sets a delegate that implements the mapping. - *

- * This value will be ignored if either {@link yfiles.layout.ItemMapping.#mapper} as also been set. It overrides values set to the {@link yfiles.layout.ItemMapping.#constant} property. - *

- * @type {function(TItem): TValue} - */ - delegate:(key:TItem)=>TValue; - /** - * Gets or sets an {@link yfiles.collections.IMapper.} that realizes the mapping. - *

- * Getting this property will automatically create an instance. Values set will override the effect of any values set to - * the {@link yfiles.layout.ItemMapping.#constant} or {@link yfiles.layout.ItemMapping.#delegate} properties. - *

- * @type {yfiles.collections.IMapper.} - */ - mapper:yfiles.collections.IMapper; - /** - * Gets or sets a constant value all items are mapped to. - *

- * This value will be ignored if either {@link yfiles.layout.ItemMapping.#mapper} or {@link yfiles.layout.ItemMapping.#delegate} have also been set. - *

- * @type {TValue} - */ - constant:TValue; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ItemMapping; - } - /** - * Base for convenience classes that specify custom data for a layout calculation done with the - * {@link yfiles.layout.LayoutExecutor}. - *

- * Implementations of this class provide item-specific configuration options for a specific layout. Single properties that - * affect the complete layout are available on the specific layout class itself. - *

- *

- * The {@link yfiles.layout.LayoutExecutor} {@link yfiles.layout.LayoutData#apply applies} these configurations when {@link yfiles.layout.LayoutExecutor#start started}. So does - * {@link yfiles.layout.LayoutGraphAdapter#applyLayout}. - *

- * @see yfiles.layout.LayoutExecutor#layoutData - * @see yfiles.layout.LayoutGraphAdapter#applyLayout - * @class - */ - export interface LayoutData extends yfiles.lang.Object{} - export class LayoutData { - /** - * Applies this layout data to the specified layoutGraphAdapter. - *

- * This method should be called before a layout is executed. It will configure the adapter and graph for to the layout. - *

- * @param layoutGraphAdapter The adapter to add the layout data to. - * @param layout The layout that shall use this layout data. - * @param layoutGraph The layout graph used for the layout calculation. - * @abstract - */ - apply(layoutGraphAdapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm,layoutGraph:yfiles.layout.CopiedLayoutGraph):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutData; - } - /** - * Executes a {@link yfiles.layout.ILayoutAlgorithm} and optionally animates the transition to the calculated layout. - *

- * This class is the preferred way to execute a layout. Its animation can be customized in various ways. - *

- *

- * If no fine-grained control of the animation is required, the convenience methods {@link yfiles.graph.IGraph#applyLayout} and {@link yfiles.view.GraphComponent#morphLayout} - * can be used instead. - *

- * @see yfiles.layout.LayoutGraphAdapter - * @class - */ - export interface LayoutExecutor extends yfiles.lang.Object{} - export class LayoutExecutor { - /** - * Initializes a new instance of the {@link yfiles.layout.LayoutExecutor} class. - * @param graphComponent The control which will be animated and provides the {@link } instance. - * @param graph The graph to layout. - * @param layout The {@link } to use. - */ - constructor(graphComponent:yfiles.view.GraphComponent,graph:yfiles.graph.IGraph,layout:yfiles.layout.ILayoutAlgorithm); - /** - * Initializes a new instance of the {@link yfiles.layout.LayoutExecutor} class. - *

- * Use the {@link yfiles.layout.LayoutExecutor#start} method to actually execute the task. This will disable animation and content - * rect updates. - *

- * @param graphComponent The control which will be animated and provides the {@link } instance. - * @param layout The {@link } to use. - */ - constructor(graphComponent:yfiles.view.GraphComponent,layout:yfiles.layout.ILayoutAlgorithm); - /** - * Creates an instance of {@link yfiles.algorithms.AbortHandler}. - *

- * This method is called upon first access to the {@link yfiles.layout.LayoutExecutor#abortHandler} property. - *

- * @returns A new {@link } instance to use during layout calculation. - * @protected - */ - createAbortHandler():yfiles.algorithms.AbortHandler; - /** - * Factory method that creates the {@link yfiles.view.IAnimation} that will be used by this instance after the layout has been - * calculated. - * @returns The animation to use after the layout. - * @see yfiles.layout.LayoutExecutor#duration - * @see yfiles.layout.LayoutExecutor#animateViewport - * @see yfiles.layout.LayoutExecutor#createMorphAnimation - * @see yfiles.layout.LayoutExecutor#createViewportAnimation - * @protected - */ - createAnimation():yfiles.view.IAnimation; - /** - * Factory method that creates the animation for the {@link yfiles.graph.IGraph}. - * @returns The animation instance. - * @see yfiles.layout.LayoutExecutor#createAnimation - * @protected - */ - createMorphAnimation():yfiles.view.IAnimation; - /** - * Creates an animation that morphs the layout of all {@link yfiles.graph.ITable}s in the graph. - * @returns - * @see yfiles.view.TableAnimation - * @see yfiles.layout.LayoutExecutor#configureTableLayout - * @protected - */ - createTableAnimations():yfiles.view.IAnimation; - /** - * Create a new instance of {@link yfiles.layout.TableLayoutConfigurator} that is used if {@link yfiles.layout.LayoutExecutor#configureTableLayout} is enabled. - *

- * This method is called upon first access to the {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} property. - *

- * @returns A new instance of the {@link } class. - * @protected - */ - createTableLayoutConfigurator():yfiles.layout.TableLayoutConfigurator; - /** - * Factory method that creates the animation for the {@link yfiles.view.CanvasComponent#viewport}. - *

- * The created animation will morph the currnt viewport into the one where the whole graph fits. The result after the - * animation is thus the same as calling {@link yfiles.view.GraphComponent#fitGraphBounds}. - *

- * @param targetBounds The target bounds of the animation. - * @returns The animation instance. - * @see yfiles.layout.LayoutExecutor#createAnimation - * @protected - */ - createViewportAnimation(targetBounds:yfiles.geometry.Rect):yfiles.view.IAnimation; - /** - * Callback method that performs the actual layout. - * @protected - */ - execute():void; - /** - * Calculate the target bounds to be used for the {@link yfiles.view.CanvasComponent#contentRect} as well as the {@link yfiles.view.ViewportAnimation} after the layout has - * finished. - *

- * By default, the value is computed with {@link yfiles.layout.LayoutGraphUtilities#getBoundingBox} with labels and {@link yfiles.layout.LayoutExecutor#targetBoundsInsets} taken into - * account. - *

- * @returns The desired content rectangle and the bounds for a viewport animation. - * @protected - */ - getTargetBounds():yfiles.geometry.Rect; - /** - * Set up {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} for a layout. - *

- * This implementation configures {@link yfiles.layout.TableLayoutConfigurator#horizontalLayout} according to the {@link yfiles.layout.MultiStageLayout#layoutOrientation} and calls {@link yfiles.layout.TableLayoutConfigurator#prepare} - *

- * @protected - */ - prepareTableLayout():void; - /** - * Writes the table layout information provided through {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} back to all tables. - *

- * This method is only called when the layout is not animated. - *

- * @see yfiles.layout.LayoutExecutor#prepareTableLayout - * @protected - */ - restoreTableLayout():void; - /** - * Actually starts the layout calculation and the optional animation asynchronously using a Promise. - *

- * This method will ultimately call the {@link yfiles.layout.LayoutExecutor#execute} method. If the {@link yfiles.layout.LayoutExecutor#duration} is zero no animation will be - * performed. - *

- *

- * If this instance is already running, this method returns immediately without doing anything and returns the previous - * Promise. - *

- * @returns A Promise that will be fulfilled once the layout and optional animation is done. - * @see yfiles.layout.LayoutExecutor#execute - */ - start():Promise; - /** - * Stops a currently running layout calculation or animation. - *

- * If a layout calculation is still running, it will be requested to stopped via {@link yfiles.algorithms.AbortHandler#stop} and - * the animation will not run. If the layout calculation was already completed, the animation will be aborted immediately - * and the layout result will be shown immediately. - *

- *

- * To just skip the animation but let the calculation finish normally, the {@link yfiles.layout.LayoutExecutor#duration} can be set to zero at any time before the - * animation was started. - *

- * @returns - */ - stop():Promise; - /** - * Gets the {@link yfiles.algorithms.AbortHandler} that is used during the layout calculation, unless another {@link yfiles.algorithms.AbortHandler} - * has been configured via {@link yfiles.layout.LayoutExecutor#layoutData} or by registering an {@link yfiles.collections.IMapper.} in the graph's {@link yfiles.graph.IGraph#mapperRegistry}. - * @see yfiles.layout.LayoutExecutor#createAbortHandler - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets the {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} that is used if {@link yfiles.layout.LayoutExecutor#configureTableLayout} is enabled. - * @see yfiles.layout.LayoutExecutor#createTableLayoutConfigurator - * @type {yfiles.layout.TableLayoutConfigurator} - */ - tableLayoutConfigurator:yfiles.layout.TableLayoutConfigurator; - /** - * Gets or sets a value indicating whether to automatically perform calls to {@link yfiles.layout.TableLayoutConfigurator#prepare} - * and {@link yfiles.layout.TableLayoutConfigurator#restore} in order to layout table nodes. - *

- * The default value is true. - *

- * @type {boolean} - */ - configureTableLayout:boolean; - /** - * Gets or sets the duration of the animation. - *

- * The default value is {@link yfiles.lang.TimeSpan#ZERO}. - *

- * @type {yfiles.lang.TimeSpan} - */ - duration:yfiles.lang.TimeSpan; - /** - * Gets or sets a value indicating whether edge groups are automatically created for edges that are connected to the same - * port. - *

- * If this property is enabled and no edge groups are explicitly created (no {@link yfiles.collections.IMapper.} are registered for the keys {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for each port with multiple outgoing resp. incoming edges - * these edges will be assigned to the same edge group. The necessary - * {@link yfiles.algorithms.IDataProvider}s will be created automatically. - *

- *

- * Without an {@link yfiles.layout.ILayoutAlgorithm} that supports edge groups, this property ahs no visual effect. - *

- *

- * The default value is true. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @see yfiles.layout.LayoutGraphAdapter#automaticEdgeGrouping - * @see yfiles.layout.LayoutExecutor#fixPorts - * @type {boolean} - */ - automaticEdgeGrouping:boolean; - /** - * Controls whether strong port constraints are automatically created. - *

- * If this property is enabled and no edge groups are explicitly created (no {@link yfiles.collections.IMapper.} are registered for the keys {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for all edges strong source and target point constraints - * with {@link yfiles.layout.PortSide#ANY} are created. The necessary - * {@link yfiles.algorithms.IDataProvider}s will be created automatically. - *

- *

- * This ensures that view {@link yfiles.graph.IPort}s are not moved during the layout, if the {@link yfiles.layout.ILayoutAlgorithm} - * supports port constraints. - *

- *

- * The default value is false. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @see yfiles.layout.LayoutGraphAdapter#fixPorts - * @see yfiles.layout.LayoutExecutor#automaticEdgeGrouping - * @type {boolean} - */ - fixPorts:boolean; - /** - * Gets or sets a value indicating whether the viewport should be animated to the new bounds of the graph. - *

- * The result when this property is true after the animation is the same as calling - * {@link yfiles.view.GraphComponent#fitGraphBounds}. Setting this property to true and changing {@link yfiles.layout.LayoutExecutor#duration} to {@link yfiles.lang.TimeSpan#ZERO} will - * disable the animation, but still change the viewport to the new graph bounds. - *

- *

- * When the viewport should stay the same, the layout algorithms often have to be coerced to keep parts of the graph in the - * same location. This can be done by wrapping the layout algorithm in an instance of {@link yfiles.layout.FixNodeLayoutStage}. - *

- *

- * The default value is false. - *

- * @type {boolean} - */ - animateViewport:boolean; - /** - * Gets or sets a value indicating whether to respect the {@link yfiles.view.CanvasComponent#viewportLimiter} of the {@link yfiles.view.GraphComponent} of this instance. - *

- * The default value is false. - *

- * @type {boolean} - */ - considerViewportLimiter:boolean; - /** - * Gets or sets a value indicating whether to use eased animation. - *

- * The default value is false. - *

- * @type {boolean} - */ - easedAnimation:boolean; - /** - * Gets or sets the insets (in world coordinates) that will be added to the content rectangle when calculating the target - * viewport. - *

- * The default value is {@link yfiles.geometry.Insets#EMPTY}. - *

- * @type {yfiles.geometry.Insets} - */ - targetBoundsInsets:yfiles.geometry.Insets; - /** - * Gets or sets a value indicating whether the content rectangle property of the {@link yfiles.view.CanvasComponent} should be - * updated upon completion. - *

- * The default value is false. - *

- * @type {boolean} - */ - updateContentRect:boolean; - /** - * Gets a value indicating whether this instance is currently running. - * @type {boolean} - */ - running:boolean; - /** - * Gets or sets the layout data that is applied when {@link yfiles.layout.LayoutExecutor#start starting} the executor. - * @type {yfiles.layout.LayoutData} - */ - layoutData:yfiles.layout.LayoutData; - /** - * Gets or sets the {@link yfiles.view.ISelectionModel.} to use for the automatically registered {@link yfiles.algorithms.IDataProvider} instances for {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} - * and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. - *

- * If this value is null and {@link yfiles.layout.LayoutExecutor#graph} is the same instance as {@link yfiles.layout.LayoutExecutor#graphComponent}'s {@link yfiles.graph.IGraph} instance, the selection model from {@link yfiles.layout.LayoutExecutor#graphComponent} is used - * instead. - *

- * @type {yfiles.view.ISelectionModel.} - */ - selectionModel:yfiles.view.ISelectionModel; - /** - * Gets the layout graph that is used by this instance to calculate the layout. - * @protected - * @type {yfiles.layout.CopiedLayoutGraph} - */ - layoutGraph:yfiles.layout.CopiedLayoutGraph; - /** - * Gets the control this instance has been created for. - * @protected - * @type {yfiles.view.GraphComponent} - */ - graphComponent:yfiles.view.GraphComponent; - /** - * Gets the {@link yfiles.layout.ILayoutAlgorithm} this instance is using. - * @protected - * @type {yfiles.layout.ILayoutAlgorithm} - */ - layout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets the graph this instance is working on. - * @protected - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutExecutor; - } - /** - * Adapter class that can be used to obtain an {@link yfiles.layout.LayoutGraph} from an {@link yfiles.graph.IGraph}. - *

- * Typically, this class is not used directly but through the convenience class {@link yfiles.layout.LayoutExecutor} or the - * convenience methods {@link yfiles.graph.IGraph#applyLayout} and MorphLayout - *

- *

- * This class will use the provided {@link yfiles.layout.LayoutGraphAdapter#selectionModel} to register corresponding {@link yfiles.algorithms.IDataProvider}s for the data provider keys - * {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY} to the layout graph. - * Moreover, it will automatically convert {@link yfiles.collections.IMapper.} instances registered with the {@link yfiles.graph.IMapperRegistry} of the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} into - * corresponding {@link yfiles.algorithms.IDataProvider} instances of the layout graph. - *

- *

- * In addition, this class supports {@link yfiles.graph.IGraph}s with edge to edge connections, i.e., edges that are adjacent to - * other edges. Since such edges are not allowed in an {@link yfiles.layout.LayoutGraph}, the property {@link yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges} specifies whether these - * edges shouldn't be converted into the layout graph at all or converted into a corresponding structure with dummy nodes. - *

- *

- * The chapter {@link @DGUIDE_LAYOUT_PREFIX@/layout-applying_a_layout.html Applying an Automatic Layout} describes how automatic layout and graph analysis algorithms from the yFiles - * Layout and yFiles Basic library components can be accessed from @COMPONENT_NAME@. - *

- * @see yfiles.layout.CopiedLayoutGraph - * @see yfiles.layout.ILayoutAlgorithm - * @class - */ - export interface LayoutGraphAdapter extends yfiles.lang.Object{} - export class LayoutGraphAdapter { - /** - * Creates the adapter using a given {@link yfiles.graph.IGraph} and {@link yfiles.view.ISelectionModel.}. - * @param graph The graph to build an adapter for. - * @param [selectionModel=null] The optional selection model to use by the {@link #AFFECTED_NODES_DP_KEY} and {@link #AFFECTED_EDGES_DP_KEY} - * {@link } instances that are automatically bound to this adapter. - * @throws {Stubs.Exceptions.ArgumentError} graph is null. - */ - constructor(graph:yfiles.graph.IGraph,selectionModel?:yfiles.view.ISelectionModel); - /** - * Creates the adapter with no initial {@link yfiles.graph.IGraph} and no {@link yfiles.view.ISelectionModel.}. - *

- * Before this instance can be used for automatic layouts, you mus assign a value to the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} property. - *

- */ - constructor(); - /** - * Registers a data provider with the graph using the given look-up key and wrapping the given mapper. - *

- * If a mapper is already registered under the given key, it is overwritten. - *

- * Type parameter K: The type of the key to use. - * Type parameter V: The type of the value to use. - * @param valueType The type of the value to use. - * @param keyType The type of the key to use. - * @param dataKey The look-up key to register the data provider with. - * @param mapper The mapper wrapped as data provider. - * @returns - * @template K,V - */ - addDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,dataKey:any,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataProvider; - /** - * Convenience method that applies a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to an {@link yfiles.graph.IGraph}, optionally applying some - * {@link yfiles.layout.LayoutData}. - * @param layout The layout algorithm to apply. - * @param [layoutData=null] The layout data. - */ - applyLayout(layout:yfiles.layout.ILayoutAlgorithm,layoutData?:yfiles.layout.LayoutData):void; - /** - * Static convenience method that applies a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to an {@link yfiles.graph.IGraph}. - * @param layout The layout algorithm to apply. - * @param graph The graph to compute the layout on. - * @param [layoutData=null] The layout data. - * @static - */ - static applyLayout(graph:yfiles.graph.IGraph,layout:yfiles.layout.ILayoutAlgorithm,layoutData?:yfiles.layout.LayoutData):void; - /** - * Creates a {@link yfiles.layout.CopiedLayoutGraph} for this instance. - * @returns An instance whose {@link #commitLayoutToOriginalGraph} will update this instance. - */ - createCopiedLayoutGraph():yfiles.layout.CopiedLayoutGraph; - /** - * Creates the {@link yfiles.layout.EdgeLabelCandidate} for a given label and {@link yfiles.graph.ILabelModelParameter} combination. - * @param originalLabel The original label. - * @param dummyLabel The dummy label that describes the current laid out label. - * @param layoutParameter The parameter to create a candidate for. - * @param labelLayout The {@link } of the label to pass to the candidate. - * @returns A candidate to yield for the labeling algorithms or null. - */ - createEdgeLabelCandidate(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter,labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.layout.EdgeLabelCandidate; - /** - * Factory method that creates an {@link yfiles.layout.IEdgeLayout} implementation that wraps the given {@link yfiles.graph.IEdge} - * @param edge The edge to wrap. - * @returns A wrapper instance. - * @protected - */ - createEdgeLayout(edge:yfiles.graph.IEdge):yfiles.layout.IEdgeLayout; - /** - * Callback factory method that creates the {@link yfiles.layout.INodeLayout} for the given {@link yfiles.graph.IPort} that is used as a - * dummy to represent the port at the {@link yfiles.graph.IEdge} that owns port. - * @param port The port to create the layout for. - * @returns A suitable implementation of {@link } that uses the {@link #location port's location} as the center of the node. - * @see yfiles.layout.LayoutGraphAdapter#edgePortNodeSize - * @see yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges - * @protected - */ - createEdgePortLayout(port:yfiles.graph.IPort):yfiles.layout.INodeLayout; - /** - * Creates a {@link yfiles.layout.NodeLabelCandidate} for a given label and {@link yfiles.graph.ILabelModelParameter} combination. - * @param originalLabel The original label. - * @param dummyLabel The dummy label that describes the current laid out label. - * @param layoutParameter The parameter to create a candidate for. - * @param ownerLayout The {@link } of the label to pass to the candidate. - * @returns A candidate to yield for the labeling algorithms or null. - */ - createNodeLabelCandidate(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter,ownerLayout:yfiles.layout.INodeLabelLayout):yfiles.layout.NodeLabelCandidate; - /** - * Factory method that creates a {@link yfiles.layout.INodeLayout} implementation that wraps the given {@link yfiles.graph.INode} - * @param node The node to wrap. - * @returns A wrapper instance. - * @protected - */ - createNodeLayout(node:yfiles.graph.INode):yfiles.layout.INodeLayout; - /** - * - * @returns - */ - edgeObjects():yfiles.collections.IEnumerable; - /** - * - * @param dataKey - * @returns - */ - getDataProvider(dataKey:any):yfiles.algorithms.IDataProvider; - /** - * - * @param edge - * @returns - */ - getEdgeLabelLayout(edge:any):yfiles.layout.IEdgeLabelLayout[]; - /** - * - * @param edge - * @returns - */ - getEdgeLayout(edge:any):yfiles.layout.IEdgeLayout; - /** - * Callback that retrieves the label candidate descriptor for the given label and parameter. - * @param originalLabel The original label to which a parameter will be applied. - * @param dummyLabel The dummy label to which the parameter will be applied. - * @param layoutParameter The parameter to apply. - * @returns A descriptor or null. - * @see yfiles.layout.LayoutGraphAdapter#createNodeLabelCandidate - * @see yfiles.layout.LayoutGraphAdapter#createEdgeLabelCandidate - * @see yfiles.layout.LayoutGraphAdapter#getLabelCandidateDescriptorProvider - * @protected - */ - getLabelCandidateDescriptor(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; - /** - * Callback method that gets the label candidate descriptor provider for the given {@link yfiles.graph.IGraph}. - *

- * This implementation uses the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup} to find an implementation of the - * {@link yfiles.graph.ILabelCandidateDescriptorProvider}. - *

- * @param graph The graph. - * @returns The result of a {@link #lookup} query on graph for the {@link } type. - * @protected - */ - getLabelCandidateDescriptorProvider(graph:yfiles.graph.IGraph):yfiles.graph.ILabelCandidateDescriptorProvider; - /** - * - * @param node - * @returns - */ - getNodeLabelLayout(node:any):yfiles.layout.INodeLabelLayout[]; - /** - * - * @param o - * @returns - */ - getNodeLayout(o:any):yfiles.layout.INodeLayout; - /** - * - * @param edgeObject - * @returns - */ - getSource(edgeObject:any):any; - /** - * - * @param edgeObject - * @returns - */ - getTarget(edgeObject:any):any; - /** - * - * @returns - */ - nodeObjects():yfiles.collections.IEnumerable; - /** - * Callback method that assigns a new location that matches newLocation to port. - *

- * This method is called only for ports which are owned by edges. These are represented by dummy nodes during the layout, - * and newLocation is the position of the dummy node after the layout. - *

- * @param port The edge port that should be placed. - * @param newLocation The new location of the port as calculated by the layout algorithm. - * @protected - */ - setEdgePortLocation(port:yfiles.graph.IPort,newLocation:yfiles.geometry.Point):void; - /** - * Callback method that assigns a new relative location to port. - *

- * The default implementation calls {@link yfiles.graph.IGraph#setRelativePortLocation} with - * newRelativeLocation. Depending on the port location model, the actual resulting port location may be different. - *

- * @param port The port that should be placed. - * @param newRelativeLocation The new coordinate offsets relative to the center of the node's {@link #layout}'s center. - * @protected - */ - setRelativePortLocation(port:yfiles.graph.IPort,newRelativeLocation:yfiles.geometry.Point):void; - /** - * An {@link yfiles.graph.IMapperRegistry} tag for an {@link yfiles.collections.IMapper.} that provides for the edge {@link yfiles.graph.ILabel}s in the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} a {@link yfiles.layout.PreferredPlacementDescriptor} - * instance. - *

- * If there is a {@link yfiles.collections.IMapper.} in the {@link yfiles.graph.IGraph#mapperRegistry} it will be queried for each {@link yfiles.graph.IEdge edge} {@link yfiles.graph.ILabel label} to set the {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor} property of the adapted implementation. - *

- * @const - * @static - * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} - */ - static EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; - /** - * A data provider key that can be used to look up the original {@link yfiles.graph.INode} of a {@link yfiles.algorithms.Node}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ORIGINAL_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * A data provider key that can be used to look up the original {@link yfiles.graph.IEdge} of an {@link yfiles.algorithms.Edge}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ORIGINAL_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * A data provider key that can be used to look up the original {@link yfiles.graph.ILabel} of an {@link yfiles.layout.INodeLabelLayout}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.INodeLabelLayoutDpKey.} - */ - static ORIGINAL_NODE_LABEL_DP_KEY:yfiles.algorithms.INodeLabelLayoutDpKey; - /** - * A data provider key that can be used to look up the original {@link yfiles.graph.ILabel} of an {@link yfiles.layout.IEdgeLabelLayout}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} - */ - static ORIGINAL_EDGE_LABEL_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; - /** - * A data provider key that can be used to look up the {@link yfiles.graph.IPort source port} of the original {@link yfiles.graph.IEdge} of an - * {@link yfiles.algorithms.Edge}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ORIGINAL_SOURCE_PORT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * A data provider key that can be used to look up the {@link yfiles.graph.IPort target port} of the original {@link yfiles.graph.IEdge} of an - * {@link yfiles.algorithms.Edge}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ORIGINAL_TARGET_PORT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * A data provider key that can be used to look up the original unconnected{@link yfiles.graph.IPort ports} of the original {@link yfiles.graph.IPortOwner} of an {@link yfiles.algorithms.Node} - * or, in the case of edge-to-edge connections, an {@link yfiles.algorithms.Edge}. - *

- * You can access all (connected and unconnected) ports through the {@link yfiles.graph.IPortOwner#ports} property of the original {@link yfiles.graph.IGraph} elements, - * which can be retrieved through the {@link yfiles.layout.LayoutGraphAdapter#ORIGINAL_NODE_DP_KEY} and {@link yfiles.layout.LayoutGraphAdapter#ORIGINAL_EDGE_DP_KEY} - * data providers. The information about whether a port is connected or not is not readily accessible from there, though. - * You can use this data provider to specifically find these port, e.g. to create additional - * {@link yfiles.layout.PortCandidate}s or just reserve space for them. - *

- *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.GraphObjectDpKey.>} - */ - static UNCONNECTED_PORTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey>; - /** - * This key is used to provide information about dummy nodes that have been inserted into the graph to model edges at - * edges. - *

- * This key can be used to query an {@link yfiles.algorithms.IDataProvider} that yields true for {@link yfiles.algorithms.IDataProvider#getBoolean} - * for nodes that are actually representatives of {@link yfiles.graph.IPort}s at {@link yfiles.graph.IEdge}s. Also the {@link yfiles.algorithms.IDataProvider#get} - * method will yield the corresponding original {@link yfiles.graph.IEdge}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PORT_DUMMY_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Sets or yields the original {@link yfiles.graph.IGraph} instance that is adapted by this instance. - *

- * Before performing a layout, this property must be set or the adapter must have been created with - * {@link yfiles.layout.LayoutGraphAdapter#LayoutGraphAdapter}. Note that this property cannot be assigned again if its value is - * already non null. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the value of this property is already non null - * @type {yfiles.graph.IGraph} - */ - adaptedGraph:yfiles.graph.IGraph; - /** - * Gets or sets the {@link yfiles.view.ISelectionModel.} to use for the automatically registered {@link yfiles.algorithms.IDataProvider} instances for the keys {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} - * and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. - * @type {yfiles.view.ISelectionModel.} - */ - selectionModel:yfiles.view.ISelectionModel; - /** - * Gets or sets the size of the nodes that are inserted for the ports that are created for {@link yfiles.graph.IEdge}s that are - * connected at other {@link yfiles.graph.IEdge}s. - *

- * If this instance is configured to create dummy nodes for ports at edges, this will be the initial size of the dummy - * nodes with the center of the node always being the location of the port. The default is 3x3. - *

- * @see yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges - * @type {yfiles.geometry.Size} - */ - edgePortNodeSize:yfiles.geometry.Size; - /** - * Determines whether edges at other edges will be hidden from the layout graph or included. - *

- * If this property is set to true, edges at other edges are simply ignored and not part of the layout graph. The default - * is false in which case dummy nodes are inserted into the layout graph for each source and target port of an {@link yfiles.graph.IEdge} - * that is {@link yfiles.graph.IPort#owner owned} by an {@link yfiles.graph.IEdge}. - *

- * @see yfiles.layout.LayoutGraphAdapter#edgePortNodeSize - * @type {boolean} - */ - hideEdgesAtEdges:boolean; - /** - * Controls whether edge groups are automatically created for edges that are connected to the same port. - *

- * If this property is enabled and no edge groups are explicitly created ({@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for all ports with multiple outgoing resp. incoming edges - * these edges will be assigned to the same edge group. The necessary - * {@link yfiles.algorithms.IDataProvider}s will be created automatically. - *

- *

- * This features requires edge group support from the {@link yfiles.layout.ILayoutAlgorithm}. - *

- *

- * Default value is true - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @see yfiles.layout.LayoutExecutor#automaticEdgeGrouping - * @see yfiles.layout.LayoutGraphAdapter#fixPorts - * @type {boolean} - */ - automaticEdgeGrouping:boolean; - /** - * Controls whether strong port constraints are automatically created. - *

- * If this property is enabled and no port constraints are explicitly created ({@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} - * and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}), for all edges strong source and target point - * constraints with {@link yfiles.layout.PortSide#ANY} are created. The necessary - * {@link yfiles.algorithms.IDataProvider}s will be created automatically. - *

- *

- * This ensures that view {@link yfiles.graph.IPort}s are not moved during the layout, if the {@link yfiles.layout.ILayoutAlgorithm} - * supports port constraints. - *

- *

- * Default value is false - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @see yfiles.layout.LayoutExecutor#fixPorts - * @see yfiles.layout.LayoutGraphAdapter#automaticEdgeGrouping - * @type {boolean} - */ - fixPorts:boolean; - /** - * - * @type {Array.} - */ - dataProviderKeys:any[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutGraphAdapter; - } - /** - * Specifies a {@link yfiles.layout.PartitionGrid} for a layout. - *

- * The {@link yfiles.layout.PartitionCellId} mapping has to be specified by either setting the {@link yfiles.layout.PartitionGridData#cellIds} property, or either or both of the - * {@link yfiles.layout.PartitionGridData#rowIndices} and {@link yfiles.layout.PartitionGridData#columnIndices} properties. When {@link yfiles.layout.PartitionGridData#cellIds} is set, the {@link yfiles.layout.PartitionGridData#grid} property must be set as well. Otherwise the size of the grid may be induced by the - * maximum row and column indices returned by {@link yfiles.layout.PartitionGridData#rowIndices} and {@link yfiles.layout.PartitionGridData#columnIndices}. - *

- *

- * Note that cell spanning is only supported using the {@link yfiles.layout.PartitionGridData#cellIds}. - *

- * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface PartitionGridData extends yfiles.layout.LayoutData{} - export class PartitionGridData { - constructor(); - /** - * Gets or sets the partition grid. - * @see yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY - * @type {yfiles.layout.PartitionGrid} - */ - grid:yfiles.layout.PartitionGrid; - /** - * Gets or sets the mapping from nodes to {@link yfiles.layout.PartitionCellId} using the partition grid as context. - * @type {yfiles.layout.ContextItemMapping.} - */ - cellIds:yfiles.layout.ContextItemMapping; - /** - * Gets or sets the mapping from nodes to the index of their rows. - * @type {yfiles.layout.ItemMapping.} - */ - rowIndices:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to the index of their columns. - * @type {yfiles.layout.ItemMapping.} - */ - columnIndices:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionGridData; - } - /** - * Specifies custom data for the {@link yfiles.layout.PartitionLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface PartitionLayoutData extends yfiles.layout.LayoutData{} - export class PartitionLayoutData { - constructor(); - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.layout.RecursiveGroupLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface RecursiveGroupLayoutData extends yfiles.layout.LayoutData{} - export class RecursiveGroupLayoutData { - constructor(); - /** - * Gets or sets the mapping from group nodes to the {@link yfiles.layout.ILayoutAlgorithm} used for their child nodes. - * @see yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - groupNodeLayouts:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges connecting to group nodes to source split ids. - *

- * Edges will be aligned with edges that connect to the same group node and have the same split id at their source - * (preferably) or target. - *

- * @see yfiles.layout.RecursiveGroupLayout#SOURCE_SPLIT_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceSplitIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges connecting to group nodes to target split ids. - *

- * Edges will be aligned with edges that connect to the same group node and have the same split id at their source or - * target (preferably). - *

- * @see yfiles.layout.RecursiveGroupLayout#TARGET_SPLIT_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetSplitIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.RecursiveGroupLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.layout.ReverseEdgesStage}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface ReverseEdgesStageData extends yfiles.layout.LayoutData{} - export class ReverseEdgesStageData { - constructor(); - /** - * Gets or sets the collection of affected edges. - * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ReverseEdgesStageData; - } - /** - * Provides different ways to define the items in a collection for use with - * {@link yfiles.layout.LayoutData}, especially if the collection contains only one item. - *

- * Only one of the provided ways to define a collection can be used at the same time, therefore only one of the properties - * {@link yfiles.layout.SingleItemCollection.#item}, {@link yfiles.layout.ItemCollection.#items}, {@link yfiles.layout.ItemCollection.#mapper}, and {@link yfiles.layout.ItemCollection.#delegate} should be set on each instance. - *

- *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. - *

- * Type parameter V: The type of the items in the collection. - * @class - * @extends {yfiles.layout.ItemCollection.} - * @template V - */ - export interface SingleItemCollection extends yfiles.layout.ItemCollection{} - export class SingleItemCollection { - constructor(); - /** - * Gets or sets the single item this item collection contains. - * @type {V} - */ - item:V; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SingleItemCollection; - } - /** - * Creates a {@link yfiles.layout.PartitionGrid} that matches a given table configuration of an {@link yfiles.graph.IGraph} and registers {@link yfiles.collections.IMapper.} - * for that grid at the graph. - *

- * Typically, this class is used as part of the convenience class {@link yfiles.layout.LayoutExecutor} to {@link yfiles.layout.TableLayoutConfigurator#prepare} - * a partition grid before the layout is calculated and {@link yfiles.layout.TableLayoutConfigurator#restore} the graph - * afterwards. - *

- * @class - */ - export interface TableLayoutConfigurator extends yfiles.lang.Object{} - export class TableLayoutConfigurator { - /** - * Destroy all information that results from a previous {@link yfiles.layout.TableLayoutConfigurator#prepare} and a subsequent - * layout - * @param graph - */ - cleanUp(graph:yfiles.graph.IGraph):void; - /** - * Return the sizes of all leaf rows. - *

- * This method does not modify originalTable. You also need to call {@link yfiles.layout.TableLayoutConfigurator#cleanUp} - * explicitly if you don't need the {@link yfiles.layout.TableLayoutConfigurator} anymore. - *

- * @param originalTable The table - * @param nodeLayout The final layout of the node that owns the table - * @returns The sizes of all leaf rows in originalTable, in their natural order. - */ - getColumnLayout(originalTable:yfiles.graph.ITable,nodeLayout:yfiles.geometry.Rect):number[]; - /** - * Return the sizes of all leaf rows. - *

- * This method does not modify originalTable. You also need to call {@link yfiles.layout.TableLayoutConfigurator#cleanUp} - * explicitly if you don't need the {@link yfiles.layout.TableLayoutConfigurator} anymore. - *

- * @param originalTable The table - * @param nodeLayout The final layout of the node that owns the table - * @returns The sizes of all leaf rows in originalTable, in their natural order. - */ - getRowLayout(originalTable:yfiles.graph.ITable,nodeLayout:yfiles.geometry.Rect):number[]; - /** - * Setup partition grid information from a graph that contains table structures - * @param graph - */ - prepare(graph:yfiles.graph.IGraph):void; - /** - * Write back all information from the partition grid - * @param graph - */ - restore(graph:yfiles.graph.IGraph):void; - /** - * Gets or sets the minimum distance between two different table nodes - * @type {number} - */ - minimumTableDistance:number; - /** - * Specifies whether or not to enable size compaction for table nodes. - *

- * If size compaction is enabled, the size of a column or row (or a table node for that matter) may be reduced due to - * layout calculation, but never below the column's or row's minimum size. If size compaction is disabled, columns and rows - * (and therefore table nodes) may only grow due to layout calculation. - *

- *

- * The default value for this property is true. - *

- * @type {boolean} - */ - compaction:boolean; - /** - * Gets or sets whether the configurator will prepare its associated graph for a vertical (that is top-to-bottom or - * bottom-to-top) layout calculation or a horizontal (that is left-to-right or right-to-left) one. - *

- * The default value for this property is false. - *

- * @type {boolean} - */ - horizontalLayout:boolean; - /** - * Specifies whether or not from sketch mode should be enabled. - *

- * If enabled, the positions of the table group nodes are considered, i.e., for horizontal layout configuration these nodes - * are sorted according to their y-coordinate and for vertical layout configuration according to their x-coordinate. - *

- * @type {boolean} - */ - fromSketch:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.TableLayoutConfigurator; - } - /** - * Converts an {@link yfiles.graph.IGraph} instance into a {@link yfiles.algorithms.Graph} instance. - *

- * This class creates a structural copy of a given {@link yfiles.graph.IGraph} and provides convenience methods to convert items - * from one graph instance to their corresponding item in the other graph instance. - *

- *

- * The main use case of this class is executing one of the analysis algorithms on an {@link yfiles.graph.IGraph}, for example - * {@link yfiles.algorithms.ShortestPaths}, {@link yfiles.algorithms.Cycles}, and {@link yfiles.algorithms.Centrality}. For executing a layout - * algorithm, use the convenience class {@link yfiles.layout.LayoutExecutor}, the convenience methods {@link yfiles.graph.IGraph#applyLayout} - * and MorphLayout, or {@link yfiles.layout.LayoutGraphAdapter}. - *

- * @see yfiles.layout.LayoutGraphAdapter - * @see yfiles.layout.LayoutExecutor - * @see yfiles.algorithms.Bipartitions - * @see yfiles.algorithms.Centrality - * @see yfiles.algorithms.Cycles - * @see yfiles.algorithms.GraphChecker - * @see yfiles.algorithms.GraphConnectivity - * @see yfiles.algorithms.Groups - * @see yfiles.algorithms.IndependentSets - * @see yfiles.algorithms.NetworkFlows - * @see yfiles.algorithms.NodeOrders - * @see yfiles.algorithms.Paths - * @see yfiles.algorithms.RankAssignments - * @see yfiles.algorithms.ShortestPaths - * @see yfiles.algorithms.SpanningTrees - * @see yfiles.algorithms.Transitivity - * @see yfiles.algorithms.Trees - * @class - */ - export interface YGraphAdapter extends yfiles.lang.Object{} - export class YGraphAdapter { - /** - * Initializes a new instance of the {@link yfiles.layout.YGraphAdapter} class. - *

- * This will create a copy of the originalGraph that has the same structure and makes it available via the {@link yfiles.layout.YGraphAdapter#yGraph} property. - *

- * @param originalGraph The original graph whose structure will be copied. - */ - constructor(originalGraph:yfiles.graph.IGraph); - /** - * Creates an {@link yfiles.algorithms.IDataMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for items in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IDataMap}s as input and that input can be obtained from - * {@link yfiles.collections.IMapper.} instances that provide and accept values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. - *

- * Type parameter K: The type of the keys in the mapper. - * Type parameter V: The type of the values in the mapper. - * @param valueType The type of the values in the mapper. - * @param keyType The type of the keys in the mapper. - * @param mapper The mapper to direct requests to. - * @returns An {@link } that will delegate the functionality to the mapper. - * @see yfiles.layout.YGraphAdapter#createDataProvider - * @template K,V - */ - createDataMap(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataMap; - /** - * Creates an {@link yfiles.algorithms.IDataProvider} that delegates to the provided delegate when queried for items in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IDataProvider}s as input and that input can be through a - * dynamic callback that provides the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. - *

- * Type parameter K: The type of the keys in the mapper. - * Type parameter V: The type of the values in the mapper. - * @param valueType The type of the values in the mapper. - * @param keyType The type of the keys in the mapper. - * @param getter The mapper delegate to direct requests to. - * @returns A DataProvider that will delegate requests to the getter. - * @template K,V - */ - createDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,getter:(key:K)=>V):yfiles.algorithms.IDataProvider; - /** - * Creates an {@link yfiles.algorithms.IDataProvider} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for items in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IDataProvider}s as input and that input can be obtained - * from {@link yfiles.collections.IMapper.} instances that provide the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. - *

- * Type parameter K: The type of the keys in the mapper. - * Type parameter V: The type of the values in the mapper. - * @param valueType The type of the values in the mapper. - * @param keyType The type of the keys in the mapper. - * @param mapper The mapper to direct requests to. - * @returns A DataProvider that will delegate requests to the mapper. - * @template K,V - */ - createDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataProvider; - /** - * Creates an {@link yfiles.collections.IEnumerable. enumerable of edges} that maps the edges from the {@link yfiles.algorithms.EdgeList} to their {@link yfiles.layout.YGraphAdapter#getOriginalEdge original} ones. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.EdgeList} instances as results and the result needs to be - * interpreted in terms of the {@link yfiles.layout.YGraphAdapter#originalGraph}. - *

- * @param edges The edge list. - * @returns An enumerable that contains the {@link #getOriginalEdge original} edges for the ones in the list. - */ - createEdgeEnumerable(edges:yfiles.algorithms.EdgeList):yfiles.collections.IListEnumerable; - /** - * Creates an {@link yfiles.algorithms.EdgeList} that maps the edges from the {@link yfiles.collections.IEnumerable.} to their {@link yfiles.layout.YGraphAdapter#getCopiedEdge copied} ones. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.EdgeList} instances as input and those edges are - * available as {@link yfiles.collections.IEnumerable.}s in the {@link yfiles.layout.YGraphAdapter#originalGraph}. - *

- * @param edges The edges from the {@link #originalGraph}. - * @returns An {@link } that contains the {@link #getCopiedEdge copied} edges for the ones in the enumerable. - */ - createEdgeList(edges:yfiles.collections.IEnumerable):yfiles.algorithms.EdgeList; - /** - * Creates an {@link yfiles.algorithms.IEdgeMap} that delegates to the provided delegate when queried for {@link yfiles.algorithms.Edge}s - * in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IEdgeMap}s as input and this can be mapped to a - * corresponding dynamic callback that provides the values for the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges}. - *

- * Type parameter V: The type of the values in the mapper. - * @param getter The mapper delegate to direct read requests to. - * @returns An {@link } that will delegate reads to the getter. - * @template V - */ - createEdgeMap(getter:(key:yfiles.graph.IEdge)=>V):yfiles.algorithms.IEdgeMap; - /** - * Creates an {@link yfiles.algorithms.IEdgeMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for {@link yfiles.algorithms.Edge}s in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IEdgeMap}s as input and this can be mapped to - * corresponding {@link yfiles.collections.IMapper.} instances that provide and accept the values for the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges}. - *

- * Type parameter V: The type of the values in the mapper. - * @param mapper The mapper to direct requests to. - * @returns An {@link } that will delegate reads and writes to the mapper. - * @template V - */ - createEdgeMap(mapper:yfiles.collections.IMapper):yfiles.algorithms.IEdgeMap; - /** - * Creates an {@link yfiles.collections.IMapper.} that delegates to the provided {@link yfiles.algorithms.INodeMap} when queried for items in the - * {@link yfiles.graph.IGraph}. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.INodeMap}s and their values should be provided using {@link yfiles.collections.IMapper.} - * instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. - *

- * Type parameter T: The type of the values in the mapper. - * @param nodeMap The map to direct requests to. - * @returns A mapper that will delegate requests to the nodeMap. - * @template T - */ - createEdgeMapper(nodeMap:yfiles.algorithms.INodeMap):yfiles.collections.IMapper; - /** - * Creates an {@link yfiles.collections.IMapper.} that delegates to the provided {@link yfiles.algorithms.IDataProvider} when queried for items in the - * {@link yfiles.graph.IGraph}. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.IDataProvider}s and their values should be provided using - * {@link yfiles.collections.IMapper.} instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges} and the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. - *

- * Type parameter T: The type of the values in the mapper. - * @param dataProvider The provider to direct requests to. - * @returns A mapper that will delegate requests to the dataProvider. - * @template T - */ - createMapper(dataProvider:yfiles.algorithms.IDataProvider):yfiles.collections.IMapper; - /** - * Creates an {@link yfiles.collections.IEnumerable. enumerable of nodes} that maps the nodes from the {@link yfiles.algorithms.NodeList} to their {@link yfiles.layout.YGraphAdapter#getOriginalNode original} ones. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.NodeList} instances as results and the result needs to be - * interpreted in terms of the {@link yfiles.layout.YGraphAdapter#originalGraph}. - *

- * @param nodes The node list. - * @returns An enumerable that contains the {@link #getOriginalNode original} nodes for the ones in the list. - */ - createNodeEnumerable(nodes:yfiles.algorithms.NodeList):yfiles.collections.IListEnumerable; - /** - * Creates a {@link yfiles.algorithms.NodeList} that maps the nodes from the {@link yfiles.collections.IEnumerable.} to their {@link yfiles.layout.YGraphAdapter#getCopiedNode copied} ones. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.NodeList} instances as input and those nodes are - * available as {@link yfiles.collections.IEnumerable.}s in the {@link yfiles.layout.YGraphAdapter#originalGraph}. - *

- * @param nodes The nodes from the {@link #originalGraph}. - * @returns A {@link } that contains the {@link #getCopiedNode copied} nodes for the ones in the enumerable. - */ - createNodeList(nodes:yfiles.collections.IEnumerable):yfiles.algorithms.NodeList; - /** - * Creates an {@link yfiles.algorithms.INodeMap} that delegates to the provided delegate when queried for {@link yfiles.algorithms.Node}s - * in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.INodeMap}s as input and this can be mapped to a - * corresponding dynamic callback that provides the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. - *

- * Type parameter V: The type of the values in the mapper. - * @param getter The mapper delegate to direct read requests to. - * @returns An {@link } that will delegate reads to the getter. - * @template V - */ - createNodeMap(getter:(key:yfiles.graph.INode)=>V):yfiles.algorithms.INodeMap; - /** - * Creates an {@link yfiles.algorithms.INodeMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for {@link yfiles.algorithms.Node}s in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.INodeMap}s as input and this can be mapped to - * corresponding {@link yfiles.collections.IMapper.} instances that provide and accept the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. - *

- * Type parameter V: The type of the values in the mapper. - * @param mapper The mapper to direct requests to. - * @returns An {@link } that will delegate reads and writes to the mapper. - * @template V - */ - createNodeMap(mapper:yfiles.collections.IMapper):yfiles.algorithms.INodeMap; - /** - * Creates an {@link yfiles.collections.IMapper.} that delegates to the provided {@link yfiles.algorithms.IEdgeMap} when queried for items in the - * {@link yfiles.graph.IGraph}. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.IDataProvider}s and their values should be provided using - * {@link yfiles.collections.IMapper.} instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges}. - *

- * Type parameter T: The type of the values in the mapper. - * @param edgeMap The map to direct requests to. - * @returns A mapper that will delegate requests to the edgeMap. - * @template T - */ - createNodeMapper(edgeMap:yfiles.algorithms.IEdgeMap):yfiles.collections.IMapper; - /** - * Yields the edge that has been created as a copy in {@link yfiles.layout.YGraphAdapter#yGraph} to represent the given edge. - * @param edge The edge for which the representation is returned. - * @returns The edge that represents edge in {@link #yGraph}. - */ - getCopiedEdge(edge:yfiles.graph.IEdge):yfiles.algorithms.Edge; - /** - * Yields the node that has been created as a copy in {@link yfiles.layout.YGraphAdapter#yGraph} to represent the given node. - * @param node The node for which the representation is returned. - * @returns The node that represents node in {@link #yGraph}. - */ - getCopiedNode(node:yfiles.graph.INode):yfiles.algorithms.Node; - /** - * Yields the original edge from the {@link yfiles.layout.YGraphAdapter#originalGraph original IGraph} that the given edge has been created for. - * @param edge The edge for which the original instance will be returned. - * @returns The original instance. - */ - getOriginalEdge(edge:yfiles.algorithms.Edge):yfiles.graph.IEdge; - /** - * Yields the original node from the {@link yfiles.layout.YGraphAdapter#originalGraph original IGraph} that the given node has been created for. - * @param node The node for which the original instance will be returned. - * @returns The original instance. - */ - getOriginalNode(node:yfiles.algorithms.Node):yfiles.graph.INode; - /** - * Gets the graph instance that is created during the constructor call. - * @type {yfiles.algorithms.Graph} - */ - yGraph:yfiles.algorithms.Graph; - /** - * Gets the original graph instance. - * @type {yfiles.graph.IGraph} - */ - originalGraph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.YGraphAdapter; - } - }export namespace hierarchic{ - /** - * This interface describes a layering constraint. - *

- * Such constraints can be given as additional input to the {@link yfiles.hierarchic.HierarchicLayout}. - *

- * @see yfiles.hierarchic.ILayerConstraintFactory - * @interface - */ - export interface ILayerConstraint extends yfiles.lang.Object{ - /** - * Gets or sets the priority of a constraint. - *

- * This value is used for resolving conflicting constraints. A constraint with a higher priority is more likely to be - * considered. - *

- *

- * The priority has to be greater than 0. - *

- * @abstract - * @type {number} - */ - priority:number; - } - var ILayerConstraint:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayerConstraint; - }; - /** - * This interface provides methods for creating layering constraints. - * @interface - */ - export interface ILayerConstraintFactory extends yfiles.lang.Object{ - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID aboveId to lie at least minDistance layers above the {@link yfiles.algorithms.Node} - * with ID referenceId with a given weight penalty for larger layer differences. - *

- * The minimum distance includes potentially empty layers that are removed by the {@link yfiles.hierarchic.ILayerer} instance. In - * that case, the actual layer difference may be smaller than the minimum distance. - *

- * @param referenceId the ID of the reference node - * @param aboveId the ID of the node that should lie above - * @param minDistance the minimum layer distance between the node and its reference node - * @param [weight=0] the weight penalty for larger layer differences - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeAboveConstraint(referenceId:any,aboveId:any,minDistance:number,weight?:number):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID aboveId to lie above the {@link yfiles.algorithms.Node} with ID - * referenceId. - * @param referenceId the ID of the reference node - * @param aboveId the ID of the node that should lie above - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeAboveConstraint(referenceId:any,aboveId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that places a {@link yfiles.algorithms.Node} on the bottom layer. - * @param nodeId the ID of the node that should lie on the bottom layer - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeAtBottomConstraint(nodeId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that places a {@link yfiles.algorithms.Node} on the topmost layer. - * @param nodeId the ID of the node that should lie on the top layer - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeAtTopConstraint(nodeId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID belowId to lie at least minDistance layers below the {@link yfiles.algorithms.Node} - * with ID referenceId with a given weight penalty for larger layer differences. - *

- * The minimum distance includes potentially empty layers that are removed by the {@link yfiles.hierarchic.ILayerer} instance. In - * that case, the actual layer difference may be smaller than the minimum distance. - *

- * @param referenceId the ID of the reference node - * @param belowId the ID of the node that should lie below - * @param minDistance the minimum layer distance between the node and its reference node - * @param [weight=0] the weight penalty for larger layer differences - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeBelowConstraint(referenceId:any,belowId:any,minDistance:number,weight?:number):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that forces a {@link yfiles.algorithms.Node} with ID belowId to lie below the {@link yfiles.algorithms.Node} with ID - * referenceId. - * @param referenceId the ID of the reference node - * @param belowId the ID of the node that should lie below - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeBelowConstraint(referenceId:any,belowId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID sameLayerId to lie in the same layer as the {@link yfiles.algorithms.Node} - * with ID referenceId. - * @param referenceId the ID of the reference node - * @param sameLayerId the ID of the node that should lie in the same layer - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeInSameLayerConstraint(referenceId:any,sameLayerId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Disposes this factory. - *

- * This method should be called when this factory is not needed anymore, i.e. after the layout has been calculated. Calling - * this method also clears all constraints. - *

- * @abstract - */ - dispose():void; - /** - * Clears all constraints for a given {@link yfiles.algorithms.Node}. - * @param nodeId the ID of the node for which all constraints should be cleared - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - removeConstraints(nodeId:any):void; - /** - * Gets a token that allows to bind a constraint factory to a graph instance after creation. - *

- * This method should only be used if the constraint factory is not bound to a graph instance initially. It allows to bind - * this factory to a graph instance after creation. See the factory methods that create instances of this interface for a - * description. - *

- * @see yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory - * @abstract - * @type {any} - */ - memento:any; - } - var ILayerConstraintFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayerConstraintFactory; - }; - /** - * This interface specifies the general contract for factory classes that can be used to associate sequence constraints - * with a graph. - *

- * Sequence constraints affect the sequence of nodes within a {@link yfiles.hierarchic.ILayer layer}. - *

- *

- * A {@link yfiles.hierarchic.ISequenceConstraintFactory} has to be {@link yfiles.hierarchic.ISequenceConstraintFactory#dispose disposed of} after use. Disposing of the factory will also - * remove all constraints previously specified for the factory's associated graph. - *

- * @interface - */ - export interface ISequenceConstraintFactory extends yfiles.lang.Object{ - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} with id after to lie after the {@link yfiles.algorithms.Node} - * or {@link yfiles.algorithms.Edge} with id reference. - * @param referenceId the ID of the reference node or edge - * @param afterId the ID of the node or edge that should be placed after the reference element - * @abstract - */ - addPlaceAfterConstraint(referenceId:any,afterId:any):void; - /** - * Adds a constraint that places a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} at the start of the sequence. - * @param id the ID of the node or edge that should be placed at the start - * @abstract - */ - addPlaceAtHeadConstraint(id:any):void; - /** - * Adds a constraint that places a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} at the end of the sequence. - * @param id the ID of the node or edge that should be placed at the end - * @abstract - */ - addPlaceAtTailConstraint(id:any):void; - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} with id before to lie before the {@link yfiles.algorithms.Node} - * or {@link yfiles.algorithms.Edge} with id reference. - * @param referenceId the ID of the reference node or edge - * @param beforeId the ID of the node or edge that should be placed before the reference element - * @abstract - */ - addPlaceBeforeConstraint(referenceId:any,beforeId:any):void; - /** - * Disposes of the {@link yfiles.hierarchic.ISequenceConstraintFactory}. - *

- * This method should be called when the factory is not needed anymore, i.e. after the layout has been calculated. Calling - * this method also clears all constraints. - *

- * @abstract - */ - dispose():void; - /** - * Gets a token that allows to bind a constraint factory to a graph instance after creation. - *

- * This method should only be used if the constraint factory is not bound to a graph instance initially. It allows to bind - * this factory to a graph instance after creation. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#createSequenceConstraintFactory - * @abstract - * @type {any} - */ - memento:any; - } - var ISequenceConstraintFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ISequenceConstraintFactory; - }; - /** - * {@link yfiles.hierarchic.AsIsLayerer} assigns nodes to layers by analyzing already existing node coordinates. - *

- * Nodes whose bounding boxes overlap in the main layout direction are assigned to the same layer. To influence to which - * amount the boxes need to overlap, the nodes can temporarily be - * {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor scaled}. Alternatively, a minimum and maximum size or a halo can be specified for the nodes. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[1.64,133.62,[[11.31,157.97,10.67,18.7,"1"]]],[51.6,4.78,[[61.27,29.13,10.67,18.7,"2"]]],[190,14.75,[[199.66,39.1,10.67,18.7,"3"]]],[226.76,148.06,[[236.42,172.41,10.67,18.7,"4"]]],[108.72,221.62,[[118.38,245.97,10.67,18.7,"5"]]]],"e":[[0,1],[1,2],[3,2],[0,4],[4,3]],"vp":[1.0,4.0,256.0,248.0]}} - *

- *

- * Initial graph - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[20,50,[[29.66,74.35,10.67,18.7,"1"]]],[20,0,[[29.66,24.35,10.67,18.7,"2"]]],[100,0,[[109.66,24.35,10.67,18.7,"3"]]],[100,50,[[109.66,74.35,10.67,18.7,"4"]]],[60,110,[[69.66,134.35,10.67,18.7,"5"]]]],"e":[[0,1,0,-15,0,15],[1,2,15,0,-15,0],[3,2,0,-15,0,15],[0,4,0,15,-7.5,-15,[35,95,67.5,95]],[4,3,7.5,-15,0,15,[82.5,95,115,95]]],"vp":[20.0,0.0,110.0,140.0]}} - *

- *

- * Hierarchic layout when the initial drawing is used as sketch - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[50,0,[[59.66,24.35,10.67,18.7,"1"]]],[20,60,[[29.66,84.35,10.67,18.7,"2"]]],[27.5,170,[[37.16,194.35,10.67,18.7,"3"]]],[80,110,[[89.66,134.35,10.67,18.7,"4"]]],[80,60,[[89.66,84.35,10.67,18.7,"5"]]]],"e":[[0,1,-7.5,15,0,-15,[57.5,45,35,45]],[1,2,0,15,-7.5,-15],[3,2,0,15,7.5,-15,[95,155,50,155]],[0,4,7.5,15,0,-15,[72.5,45,95,45]],[4,3,0,15,0,-15]],"vp":[20.0,0.0,90.0,200.0]}} - *

- *

- * Hierarchic layout when the initial drawing is not used as sketch - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface AsIsLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class AsIsLayerer { - /** - * Creates an instance of {@link yfiles.hierarchic.AsIsLayerer} with default settings. - */ - constructor(); - /** - * Assigns all nodes of the graph to layers by analyzing already existing node coordinates and adds them to the {@link yfiles.hierarchic.ILayers} - * instance. - *

- * Nodes whose bounding boxes overlap in the main layout direction are assigned to the same layer. To influence to which - * amount the boxes need to overlap, the nodes can temporarily be {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor scaled}. - *

- * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Callback used for calculating the lower (max) value of a given node. - * @param graph the graph - * @param node the node - * @returns the lower (max) of a given node - * @protected - */ - getMax(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; - /** - * Callback used for calculating the upper (min) value of a given node. - * @param graph the graph - * @param node the node - * @returns the upper (min) value of a given node - * @protected - */ - getMin(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; - /** - * Gets or sets the scaling factor used for scaling the size of the nodes. - *

- * Nodes are being scaled from their center. This can be used for more fuzzy layering. - *

- *

- * The scaling factor can take positive values. Factors smaller than 1 only consider large overlaps of the nodes' bounding - * boxes in the main layout direction. Factors larger than 1 also combine nodes with some distance between them. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 - * @see yfiles.hierarchic.AsIsLayerer#minimumNodeSize - * @see yfiles.hierarchic.AsIsLayerer#maximumNodeSize - * @see yfiles.hierarchic.AsIsLayerer#nodeHalo - * @type {number} - */ - nodeScalingFactor:number; - /** - * Gets or sets the maximum size of a node used for calculating layer overlaps. - *

- * This can be used for more fuzzy layering. - *

- *

- * The maximum size can take positive values. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 - * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor - * @see yfiles.hierarchic.AsIsLayerer#nodeHalo - * @type {number} - */ - maximumNodeSize:number; - /** - * Gets or sets the minimum size of a node used for calculating layer overlaps. - *

- * This can be used for more fuzzy layering. - *

- *

- * The minimum size can take positive values. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 - * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor - * @see yfiles.hierarchic.AsIsLayerer#nodeHalo - * @type {number} - */ - minimumNodeSize:number; - /** - * Gets or sets the size of the halo around a node, that means the insets that are used for calculating layer overlaps. - *

- * If the value of the halo is positive, it specifies a border around a node. In case it is negative, it is considered as - * an inset that defines a smaller area inside the node. - *

- *

- * This can be used for more fuzzy layering. - *

- * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor - * @see yfiles.hierarchic.AsIsLayerer#minimumNodeSize - * @see yfiles.hierarchic.AsIsLayerer#maximumNodeSize - * @type {number} - */ - nodeHalo:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.AsIsLayerer; - } - /** - * This class calculates the sequence of the nodes within each layer using the nodes' coordinates. - *

- * For {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation} - * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}, the order corresponds to that obtain when sorting the nodes according to - * their x-coordinate. - *

- *

- * An instance of this class can be set to {@link yfiles.hierarchic.HierarchicLayout} using method {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} and {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer} respectively. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[111.8,0,[[121.47,24.35,10.67,18.7,"1"]]],[0,36.33,[[9.66,60.68,10.67,18.7,"2"]]],[180.9,95.11,[[190.56,119.46,10.67,18.7,"3"]]],[0,153.88,[[9.66,178.23,10.67,18.7,"4"]]],[111.8,190.21,[[121.47,214.56,10.67,18.7,"5"]]]],"e":[[0,1],[0,3],[1,3],[0,2],[2,4],[4,3]],"vp":[0.0,0.0,211.0,221.0]}} Initial graph that will be used as sketch {@graph {"ann":{"s":[30,30],"d":1},"n":[[50,0,[[59.66,24.35,10.67,18.7,"1"]]],[20,60,[[29.66,84.35,10.67,18.7,"2"]]],[80,100,[[89.66,124.35,10.67,18.7,"3"]]],[42.5,145,[[52.16,169.35,10.67,18.7,"4"]]],[72.5,205,[[82.16,229.35,10.67,18.7,"5"]]]],"e":[[0,1,-10,15,0,-15,[55,45,35,45]],[0,3,0,15,7.5,-15],[1,3,0,15,-7.5,-15,[35,130,50,130]],[0,2,10,15,0,-15,[75,45,95,45]],[2,4,0,15,7.5,-15],[4,3,-7.5,-15,0,15,[80,190,57.5,190]]],"vp":[20.0,0.0,90.0,235.0]}} Hierarchic layout when the initial graph is used as sketch - *

- * @class - * @implements {yfiles.hierarchic.ISequencer} - */ - export interface AsIsSequencer extends yfiles.lang.Object,yfiles.hierarchic.ISequencer{} - export class AsIsSequencer { - /** - * Creates a new {@link yfiles.hierarchic.AsIsSequencer} instance. - */ - constructor(); - /** - * Calculates the sequence of the nodes within each layer using the nodes' coordinates. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} and finally writes back the calculated sequence using - * method {@link yfiles.hierarchic.ILayer#setNodeOrder}. - *

- * @param graph the input graph - * @param layers the given {@link } instance that defines the layering structure - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param itemFactory the {@link } used for creating and destroying helper structures - */ - sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.AsIsSequencer; - } - /** - * This class is a wrapper {@link yfiles.hierarchic.ILayerer} implementation that delegates the actual layering to a delegate {@link yfiles.hierarchic.ILayerer} - * object. - *

- * If the graph consists of multiple components, they will be identified and each of the components will be layered - * separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that they will all be merged such that the - * desired aspect ratio is fulfilled best. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ccccff"}},"n":[[110,160],[20,160],[20,220],[110,220],[20,280],[252.5,160,6],[305,220,6],[380,280,6],[200,220,6],[290,280,6],[290,330,6],[380,330,6],[200,280,6],[27.5,0,180,80],[87.5,100]],"e":[[14,0,15,15,0,-15,[132.5,145,140,145]],[14,1,-15,15,0,-15,[102.5,145,50,145]],[1,2,0,15,0,-15],[0,3,0,15,0,-15],[2,4,0,15,0,-15],[5,6,15,15,0,-15,[297.5,205,335,205]],[6,7,15,15,0,-15,[350,265,410,265]],[5,8,-15,15,0,-15,[267.5,205,230,205]],[6,9,-15,15,0,-15],[9,10,0,15,0,-15],[7,11,0,15,0,-15],[8,12,0,15,0,-15],[13,14,0,40,0,-15]],"vp":[20.0,0.0,420.0,360.0]}} Sample output of {@link yfiles.hierarchic.AspectRatioComponentLayerer} with default settings on a graph with two connected - * components. - *

- * @see yfiles.hierarchic.AspectRatioComponentLayerer#desiredAspectRatio - * @see yfiles.hierarchic.MultiComponentLayerer - * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface AspectRatioComponentLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class AspectRatioComponentLayerer { - /** - * Creates a new instance of {@link yfiles.hierarchic.AspectRatioComponentLayerer} using the given delegate {@link yfiles.hierarchic.ILayerer} - * instance. - * @param singleComponentLayerer - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null - */ - constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer); - /** - * Assigns all nodes of the graph to layers and registers them to the {@link yfiles.hierarchic.ILayers} instance based on the given - * aspect ratio. - *

- * If the graph consists of multiple components, they will be identified and each of the components will be layered - * separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that, they will all be merged such that the - * desired aspect ratio is best fulfilled. - *

- * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for query information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Gets or sets the delegate {@link yfiles.hierarchic.ILayerer} instance. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null - * @type {yfiles.hierarchic.ILayerer} - */ - singleComponentLayerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets whether or not the size of the nodes should be considered. - *

- * If this option is disabled, all nodes are considered to be of equal size. Hence, the given aspect ratio specifies the - * ratio between the number of nodes within a layer and the overall number of layers. - *

- * @type {boolean} - */ - considerNodeSize:boolean; - /** - * Gets or sets the desired aspect ratio. - *

- * If the graph consists of multiple components, they will be identified and each of the components will be layered - * separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that, they will all be merged such that the - * desired aspect ratio is best fulfilled. - *

- *

- * The given aspect ratio should be greater or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the aspect ratio is negative - * @type {number} - */ - desiredAspectRatio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.AspectRatioComponentLayerer; - } - /** - * {@link yfiles.hierarchic.BFSLayerer} uses a breadth first search for assigning layers to the nodes. - *

- * The nodes of the first layer can be freely selected (see - * {@link yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY}). The nodes that belong to a subsequent layer are determined as follows: - * Add all yet unassigned nodes to the new layer that are connected to nodes already assigned. As a consequence, all - * connected nodes will be at most one layer apart. Also, edges between nodes that belong to the same layer are possible. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[46.17,0,[[55.83,24.35,10.67,18.7,"1"]]],[100,70,[[109.66,94.35,10.67,18.7,"2"]]],[0,70,[[9.66,94.35,10.67,18.7,"3"]]],[211.77,0,[[221.43,24.35,10.67,18.7,"6"]]],[211.77,70,[[221.43,94.35,10.67,18.7,"7"]]],[100,0,[[109.66,24.35,10.67,18.7,"8"]]],[50,70,[[56.33,94.35,17.35,18.7,"12"]]],[3.17,140,[[12.83,164.35,10.67,18.7,"8"]]],[113.17,140,[[122.83,164.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,7.5,-15,[115,50,122.5,50]],[0,1,10,15,-7.5,-15,[71.17,50,107.5,50]],[0,2,-10,15,0,-15,[51.17,50,15,50]],[4,1,-15,0,15,0],[3,4,0,15,0,-15],[0,6,-0,15,0,-15,[61.17,50,65,50]],[6,7,-7.5,15,7.5,-15,[57.5,120,25.67,120]],[6,8,7.5,15,0,-15,[72.5,120,128.17,120]],[8,7,-15,0,15,0],[2,7,0,15,-7.5,-15,[15,120,10.67,120]]],"vp":[0.0,0.0,242.0,170.0]}} - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface BFSLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class BFSLayerer { - /** - * Creates an instance of {@link yfiles.hierarchic.BFSLayerer}. - */ - constructor(); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for query information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Data provider key for identifying the core nodes of the BFS layering - *

- * The {@link yfiles.algorithms.IDataProvider} registered with this key should provide boolean values for the nodes of the graph. - * The boolean value determines whether or not a node is to be placed in the first layer. If there are no nodes marked as - * core nodes, then nodes with in-degree 0 are considered to be the core nodes. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static CORE_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.BFSLayerer; - } - /** - * This class is a {@link yfiles.hierarchic.ILayerer} implementation that observes relative and absolute layering constraints - * defined by the {@link yfiles.hierarchic.ILayerConstraintFactory layer constraint factory}. - *

- * Furthermore, it can handle the edge directedness as specified by {@link yfiles.algorithms.IDataProvider} key - * {@link yfiles.hierarchic.HierarchicLayout#EDGE_DIRECTEDNESS_DP_KEY}. - *

- *

- * For a given graph instance, the layer constraint factory can be created using method - * {@link yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory}. The {@link yfiles.hierarchic.ILayerer} can be used for both - * common layering and layering of incremental nodes. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ff0000"},"7":{"f":"#0099ff"}, "8":{"f":"#00cc66"}},"n":[[120,0,6,[[144.66,24.35,10.67,18.7,"1"]]],[10,50,7,[[34.66,74.35,10.67,18.7,"2"]]],[120,50,7,[[144.66,74.35,10.67,18.7,"3"]]],[280,125,8,[[304.66,149.35,10.67,18.7,"7"]]],[10,125,8,[[34.66,149.35,10.67,18.7,"4"]]],[100,125,8,[[124.66,149.35,10.67,18.7,"5"]]],[190,125,8,[[214.66,149.35,10.67,18.7,"6"]]]],"e":[[2,0,0,-15,0,15],[2,1,-30,0,30,0],[3,2,0,-15,22.5,15,[310,95,172.5,95]],[2,4,-22.5,15,0,-15,[127.5,90,40,90]],[2,5,-7.5,15,0,-15,[142.5,100,130,100]],[2,6,7.5,15,0,-15,[157.5,105,220,105]]],"vp":[10.0,0.0,330.0,155.0]}} Sample output of applying {@link yfiles.hierarchic.ConstraintIncrementalLayerer}. The red colored node should reside in the - * topmost layer, blue nodes in the medium layer while green nodes in the bottommost layer. {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#0099ff"},"7":{"f":"#e3e3ff", "s":"#e3e3ff"}, "8":{"f":"#00cc66"}},"n":[[330,136.5,380,67,7],[330,206.5,380,127,7],[330,337,380,80,7],[490,156.5,[[514.66,180.85,10.67,18.7,"1"]]],[350,226.5,6,[[374.66,250.85,10.67,18.7,"2"]]],[440,226.5,6,[[464.66,250.85,10.67,18.7,"3"]]],[450,286.5,6,[[474.66,310.85,10.67,18.7,"4"]]],[415,346.5,8,[[439.66,370.85,10.67,18.7,"5"]]],[505,346.5,8,[[529.66,370.85,10.67,18.7,"6"]]],[595,346.5,8,[[619.66,370.85,10.67,18.7,"7"]]]],"e":[[3,4,-25,15,0,-15,[495,196.5,380,196.5]],[3,5,-15,15,0,-15,[505,206.5,470,206.5]],[3,6,-5,15,15,-15,[515,266.5,495,266.5]],[5,6,0,15,-15,-15,[470,266.5,465,266.5]],[3,7,5,15,0,-15,[525,326.5,445,326.5]],[3,8,15,15,0,-15],[3,9,25,15,0,-15,[545,196.5,625,196.5]]],"vp":[330.0,136.0,380.0,281.0]}} Sample output of applying {@link yfiles.hierarchic.ConstraintIncrementalLayerer} - * on a graph with a - * {@link yfiles.layout.PartitionGrid}. Same colors represent nodes that belong to the same partition grid cell and should be - * layered with respect to the partition grid cell to which they belong. - *

- * @see yfiles.hierarchic.ILayerConstraintFactory - * @see yfiles.hierarchic.HierarchicLayout - * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface ConstraintIncrementalLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class ConstraintIncrementalLayerer { - /** - * Creates a new {@link yfiles.hierarchic.ConstraintIncrementalLayerer} with the given {@link yfiles.hierarchic.ILayerer} instance. - * @param coreLayerer the given {@link } instance - */ - constructor(coreLayerer:yfiles.hierarchic.ILayerer); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance based on relative and - * absolute layering constraints defined by the given layering constraints. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for query information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Checks if the current setting of constraints is consistent (i.e. - *

- * the induced constraint graph has no cycles). - *

- * @throws {Stubs.Exceptions.ArgumentError} if the constraint graph is inconsistent - * @protected - */ - checkConstraints():void; - /** - * Data provider key for assigning additional edge weights - *

- * The {@link yfiles.hierarchic.ILayerer} tries to maintain edges with higher weights short. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ADDITIONAL_EDGE_WEIGHT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets whether or not same-layer edges can be created by this {@link yfiles.hierarchic.ILayerer} instance. - *

- * This only concerns edges between nodes that have no hard constraints that will force a same-layer edge (i.e. a - * same-layer constraint). - *

- * @type {boolean} - */ - allowSameLayerEdges:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.ConstraintIncrementalLayerer; - } - /** - * This class is a default {@link yfiles.hierarchic.IDrawingDistanceCalculator} implementation that is used by {@link yfiles.hierarchic.HierarchicLayoutCore} - * to configure the {@link yfiles.hierarchic.INodePlacer}. - * @class - * @implements {yfiles.hierarchic.IDrawingDistanceCalculator} - */ - export interface DefaultDrawingDistanceCalculator extends yfiles.lang.Object,yfiles.hierarchic.IDrawingDistanceCalculator{} - export class DefaultDrawingDistanceCalculator { - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} with default settings. - */ - constructor(); - /** - * - * @param graph - * @param layers - * @param ldp - */ - dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Determines the minimum distance between two {@link yfiles.algorithms.Node}s of the same layer. - * @param graph the input graph - * @param layer the {@link } object that will be used during subsequent calls - * @param ldp the {@link } used for querying information - * @param left the left of the two {@link }s whose minimum distance is to be determined or null if only the left border - * of the right {@link } is of interest - * @param right the right of the two {@link }s whose minimum distance is to be determined or null if only the right border - * of the left {@link } is of interest - * @returns the minimum distances between {@link }s of same layer - */ - getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; - /** - * - * @param graph - * @param layers - * @param ldp - */ - initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Gets or sets whether or not an adaptive minimum edge distance is used. - *

- * If this option is enabled the minimum distance between two adjacent edges is the minimum of the current minimum edge - * distance and the distance of the edges' source/target points. - *

- * @type {boolean} - */ - adaptiveMinimumEdgeDistanceEnabled:boolean; - /** - * Gets or sets whether or not the compaction option is enabled. - * @type {boolean} - */ - compaction:boolean; - /** - * Gets or sets the minimum distance between two {@link yfiles.algorithms.Node}s. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - nodeToNodeDistance:number; - /** - * Gets or sets the minimum distance between a {@link yfiles.algorithms.Node} and an (non-adjacent) {@link yfiles.algorithms.Edge}. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - nodeToEdgeDistance:number; - /** - * Gets or sets the minimum distance between two edges. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - edgeToEdgeDistance:number; - /** - * Gets or sets whether or not to use an optimized minimum distance calculation for swimlane layouts. - *

- * If set to true this instance will report 0.0d as the minimum distance between two nodes if they belong to different - * swimlanes. This avoids unwanted feedback between different swimlanes during node placement. - *

- * @type {boolean} - */ - optimizeSwimlaneDistances:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.DefaultDrawingDistanceCalculator; - } - /** - * This class is a {@link yfiles.hierarchic.ISequencer} implementation that performs the second phase of the Sugiyama algorithm. - *

- * It minimizes the crossings in the diagram by using either the barycentric or median heuristic. - *

- * @class - * @implements {yfiles.hierarchic.ISequencer} - */ - export interface DefaultLayerSequencer extends yfiles.lang.Object,yfiles.hierarchic.ISequencer{} - export class DefaultLayerSequencer { - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultLayerSequencer}. - */ - constructor(); - /** - * - * @param graph - * @param glayers - * @param ldp - * @param itemFactory - */ - sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,glayers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Gets or sets whether or not to apply an additional crossing minimization heuristic. - *

- * Activating this heuristic can reduce the overall number of edge crossings. On the other hand, it may increase the - * running time. - *

- * @type {boolean} - */ - transposition:boolean; - /** - * Gets or sets whether or not an additional crossing minimization heuristic should be used in the presence of grouped - * graphs. - *

- * Activating this heuristic can reduce the overall number of edge crossings in grouped graphs. On the other hand, it may - * increase running time. - *

- * @type {boolean} - */ - groupTransposition:boolean; - /** - * Gets or sets the weight heuristic that should be used. - * @throws {Stubs.Exceptions.ArgumentError} if the constant is unknown - * @type {yfiles.hierarchic.WeightHeuristic} - */ - weightHeuristic:yfiles.hierarchic.WeightHeuristic; - /** - * Gets or sets the time limit (in milliseconds) set for this sequencer per execution. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative. - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the number of randomized rounds that this algorithm performs, if there was no optimal solution. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if a negative value is given - * @type {number} - */ - randomizationRounds:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.DefaultLayerSequencer; - } - /** - * A default implementation of a {@link yfiles.hierarchic.ILayeredComponentsMerger} that provides simple default behaviors. - *

- * Instances of this class are used internally by {@link yfiles.hierarchic.HierarchicLayoutCore} and {@link yfiles.hierarchic.MultiComponentLayerer} - * when e.g. the graph is grouped or it consists of more than one connected component. - *

- * @class - * @implements {yfiles.hierarchic.ILayeredComponentsMerger} - */ - export interface DefaultLayeredComponentsMerger extends yfiles.lang.Object,yfiles.hierarchic.ILayeredComponentsMerger{} - export class DefaultLayeredComponentsMerger { - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} using the given merging policy. - * @param policy one of the predefined merging constants - * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given - */ - constructor(policy:yfiles.hierarchic.MergingPolicy); - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} with default settings. - */ - constructor(); - /** - * - * @param graph - * @param ldp - * @param srcLayers - * @param targetLayers - */ - merge(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,srcLayers:yfiles.hierarchic.ILayers,targetLayers:yfiles.hierarchic.ILayers):void; - /** - * Gets or sets the merging policy constant as defined in {@link yfiles.hierarchic.DefaultLayeredComponentsMerger}. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given - * @type {yfiles.hierarchic.MergingPolicy} - */ - policy:yfiles.hierarchic.MergingPolicy; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.DefaultLayeredComponentsMerger; - } - /** - * This class is a default {@link yfiles.hierarchic.IPortAllocator} implementation. - *

- * It is used by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. - *

- * @class - * @implements {yfiles.hierarchic.IPortAllocator} - */ - export interface DefaultPortAllocator extends yfiles.lang.Object,yfiles.hierarchic.IPortAllocator{} - export class DefaultPortAllocator { - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultPortAllocator} with default settings. - * @see yfiles.hierarchic.DefaultPortAllocator#defaultPortBorderGapRatio - */ - constructor(); - /** - * Assigns source and target port coordinates to each edge of the graph. - *

- * This method assigns: - *

- *
    - *
  • {@link yfiles.layout.PortSide#ANY} ports to appropriate sides.
  • - *
  • {@link yfiles.layout.PortConstraint#strong Weak} ports to appropriate positions between strong ones.
  • - *
- *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. - *

- * @param graph the input graph - * @param layers the given {@link } instance containing the layering structure - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param itemFactory the {@link } used for creating and destroying helper structures - */ - assignPorts(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Callback method used for determining the port border gap for each node and side. - *

- * It may be overridden for a custom calculation of port border gap on a given node. - *

- * @param graph the input graph - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param node the given node - * @param sideIndex the zero-based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) - * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @returns the absolute gap on both sides of the ports - * @see yfiles.hierarchic.DefaultPortAllocator#getPortDistanceDelta - * @protected - */ - getPortBorderGap(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number):number; - /** - * Callback method used for determining the port border gap ratio. - *

- * See {@link yfiles.hierarchic.DefaultPortAllocator#defaultPortBorderGapRatio} for an explanation. - *

- *

- * It may be overridden for a custom calculation of port border gap ratio on a given node. - *

- * @param graph the input graph - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param node the given node - * @param sideIndex the zero-based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) - * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @returns the border gap ratio - * @protected - */ - getPortBorderGapRatio(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number):number; - /** - * Callback method used for determining the distance between two adjacent ports. - *

- * It may be overridden for a custom calculation of the distance between two adjacent ports.. - *

- * @param graph the input graph - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param node the given node - * @param sideIndex the zero-based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) - * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @param portBorderGap the previously calculated port border gap - * @returns the absolute distance between two adjacent ports - * @protected - */ - getPortDistanceDelta(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number,portBorderGap:number):number; - /** - * Gets or sets the border gap ratio for the default port. - *

- * This ratio determines the gap between a corner of the node and the first assigned port. - *

- *

- * The ratio should be greater than 0. - *

- *

- * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). - *

- *

- * A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of - * the node and the first port is half as wide as the distance between two adjacent ports. - *

- *

- * A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative - * @type {number} - */ - defaultPortBorderGapRatio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.DefaultPortAllocator; - } - /** - * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases to provide routing details for - * the edges of the graph. - *

- * An {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance can be specified individually for single edges using a {@link yfiles.algorithms.IDataProvider} - * that returns an {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance for each edge of the graph, or null if no {@link yfiles.hierarchic.EdgeLayoutDescriptor} - * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- *

- * This class is designed as a class to allow future additions of new getter methods. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @see yfiles.hierarchic.NodeLayoutDescriptor - * @class - */ - export interface EdgeLayoutDescriptor extends yfiles.lang.Object{} - export class EdgeLayoutDescriptor { - /** - * Creates a new instance of an {@link yfiles.hierarchic.EdgeLayoutDescriptor} with the default values. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance. - * @returns a copy of this {@link } instance - */ - createCopy():yfiles.hierarchic.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum length of the first segment of the edge path (at the source node). - *

- * The minimum length should be greater than 0. - *

- *

- * If the value is 0.0d the first segment does not need to be orthogonal. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative - * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length of the last segment of the edge path (at the target node). - *

- * The minimum length should be greater than 0. - *

- *

- * If the value is 0.0d the last segment does not need to be orthogonal. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the last segment is negative - * @type {number} - */ - minimumLastSegmentLength:number; - /** - * Gets or sets the minimum length of an edge. - *

- * If this is used for polyline routing, it describes the minimum vertical length of the mid segment. If it is used for - * orthogonal routing, it describes the minimum length of the whole edge. - *

- *

- * The minimum length should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative - * @type {number} - */ - minimumLength:number; - /** - * Gets or sets the preferred minimum distance to obstacles. - *

- * The minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative - * @type {number} - */ - minimumDistance:number; - /** - * Gets or sets the minimum slope that the mid segments of this edge should have, if the edge is routed polyline in - * vertical layouts. - *

- * The minimum slope should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum slope is negative - * @type {number} - */ - minimumSlope:number; - /** - * Gets or sets whether or not source port optimization is enabled. - *

- * This means that the algorithm should try to find a better source {@link yfiles.layout.PortConstraint port constraint} if the current constraint is null or - * {@link yfiles.layout.PortSide#ANY}. - *

- * @type {boolean} - */ - sourcePortOptimization:boolean; - /** - * Gets or sets whether or not target port optimization is enabled. - *

- * This means that the algorithm should try to find a better target {@link yfiles.layout.PortConstraint port constraint} if the current constraint is null or - * {@link yfiles.layout.PortSide#ANY}. - *

- * @type {boolean} - */ - targetPortOptimization:boolean; - /** - * Gets or sets the routing style for this edge. - * @see yfiles.hierarchic.RoutingStyle - * @type {yfiles.hierarchic.RoutingStyle} - */ - routingStyle:yfiles.hierarchic.RoutingStyle; - /** - * Gets or sets the minimum length of octilinear segments for this edge. - * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative - * @see yfiles.hierarchic.EdgeLayoutDescriptor#routingStyle - * @type {number} - */ - minimumOctilinearSegmentLength:number; - /** - * Gets or sets how edges in grouped graphs are routed between the content of different groups. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown style is specified - * @type {yfiles.hierarchic.RecursiveEdgeStyle} - */ - recursiveEdgeStyle:yfiles.hierarchic.RecursiveEdgeStyle; - /** - * Gets or sets whether or not this edge is routed directly to a group node's border if it connects the group node with one - * of its descendants. - *

- * When enabled, the edge will connect to the inner side of the group node's border instead of leaving the group node and - * connect from outside. - *

- * @type {boolean} - */ - directGroupContentEdgeRouting:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.EdgeLayoutDescriptor; - } - export enum WeightHeuristic{ - /** - * A weight assignment specifier based on a barycenter heuristic. - *

- * The position of a node within a layer will be determined by the barycenter of its successor (downward pass) and - * predecessor (upward pass) nodes. - *

- * @see yfiles.hierarchic.DefaultLayerSequencer#weightHeuristic - */ - BARYCENTER, - /** - * A weight assignment specifier based on a median heuristic. - *

- * The position of a node within a layer will be determined by the median position of its successor (downward pass) and - * predecessor (upward pass) nodes. - *

- * @see yfiles.hierarchic.DefaultLayerSequencer#weightHeuristic - */ - MEDIAN - } - export enum MergingPolicy{ - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} below the layers of the target {@link yfiles.hierarchic.ILayers layering}. - * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_BELOW, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} above the layers of the target {@link yfiles.hierarchic.ILayers layering}. - * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_ABOVE, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target layering. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become top-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_RIGHT_TOP_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become bottom-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_RIGHT_BOTTOM_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become center-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_RIGHT_CENTER_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become top-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_LEFT_TOP_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become bottom-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_LEFT_BOTTOM_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become center-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_LEFT_CENTER_ALIGNED - } - export enum EdgeDataType{ - /** - * A constant describing a normal edge. - * @see yfiles.hierarchic.IEdgeData#type - */ - NORMAL, - /** - * A constant describing an edge that connects to a source group node. - * @see yfiles.hierarchic.IEdgeData#type - */ - SOURCE_GROUP_NODE_CONNECTOR, - /** - * A constant describing an edge that connects to a target group node. - * @see yfiles.hierarchic.IEdgeData#type - */ - TARGET_GROUP_NODE_CONNECTOR, - /** - * A constant describing an edge that connects two group nodes. - * @see yfiles.hierarchic.IEdgeData#type - */ - GROUP_NODE_INTERCONNECTOR, - /** - * A constant describing a same-layer edge that connects directly two neighboring nodes. - * @see yfiles.hierarchic.IEdgeData#type - */ - DIRECT_SAME_LAYER_EDGE, - /** - * A constant describing a same-layer edge that does not connect directly two neighboring nodes. - *

- * This means that two nodes of the same layer are not connected directly with a straight-line edge, but with an edge - * consisting of polyline segments. - *

- * @see yfiles.hierarchic.IEdgeData#type - */ - NON_DIRECT_SAME_LAYER_EDGE, - /** - * A constant describing an edge that connects group border nodes in adjacent layers. - * @see yfiles.hierarchic.IEdgeData#type - */ - BORDER_EDGE, - /** - * A constant describing an edge that has been added temporarily to replace an edge connected to a group node. - * @see yfiles.hierarchic.IEdgeData#type - */ - REDIRECTED_GROUP_EDGE - } - export enum RecursiveEdgeStyle{ - /** - * Routing specifier that routes edges between different group contents non-recursively. - * {@link yfiles.algorithms.Edge}s may leave and enter group nodes at the left and right side in order to connect as directly as - * possible. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle - */ - OFF, - /** - * Routing specifier that routes edges between different group contents recursively and directed. - * {@link yfiles.algorithms.Edge}s can only leave the groups at the bottom side and enter them at the top side. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle - */ - DIRECTED, - /** - * Routing specifier that routes edges between different group contents recursively and undirected. - * {@link yfiles.algorithms.Edge}s can leave the groups at the bottom or top side and enter them at the bottom or top side. This - * style is more compact than the directed edge style. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle - */ - UNDIRECTED - } - export enum ComponentArrangementPolicy{ - /** - * A component arrangement policy that achieves a 1:1 aspect ratio for the graph. - *

- * After layering the single components with the core layerer, the components will be merged such that an 1:1 aspect ratio - * is fulfilled best. - *

- * @see yfiles.hierarchic.HierarchicLayout#componentArrangementPolicy - */ - COMPACT, - /** - * A component arrangement policy that aligns the components with their topmost layer. - *

- * After layering the single components with the core layerer, the components are aligned with their topmost layer. - *

- * @see yfiles.hierarchic.HierarchicLayout#componentArrangementPolicy - */ - TOPMOST - } - export enum LayoutMode{ - /** - * A layout mode that allows to keep some nodes fixed and insert the remaining nodes incrementally. - *

- * Fixed elements will be handled by the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer fixed elements sequencer} and {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer fixed elements layerer}. Incremental elements will be - * added during the layering or the sequencing phase. They are handled by {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer from scratch layerer} and {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer fixed elements layerer} - * respectively. - *

- * @see yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer - */ - INCREMENTAL, - /** - * A layout mode that will recompute the complete layout from scratch. - *

- * All elements will be handled by the same {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer layerer} and {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer sequencer}. - *

- * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer - */ - FROM_SCRATCH - } - export enum LayeringStrategy{ - /** - * A layering strategy which places each node in the highest possible layer without passing its predecessor in the - * topological order of nodes. - *

- * All nodes with indegree zero will be assigned to the topmost layer of the layout. The number of separate layers will be - * as small as possible. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - HIERARCHICAL_TOPMOST, - /** - * A layering strategy which places each node in the optimal layer to minimize the layer distances. - *

- * The layer distance of an edge is the absolute difference between the layer numbers of its source and target node. The - * layer assignment will minimize the overall sum of the layer distances of all edges in the layout. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - HIERARCHICAL_OPTIMAL, - /** - * A layering strategy which applies a heuristic to approximate the {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_OPTIMAL optimal layering}. - *

- * The quality of the result may not be as good as with {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_OPTIMAL optimal layering} but it is usually achieved faster. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - HIERARCHICAL_TIGHT_TREE, - /** - * A layering strategy which applies a fast heuristic that improves the layering done by {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TOPMOST} - * by shifting some nodes down. - *

- * The quality of the result is usually worse than the one produced by - * {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TIGHT_TREE}. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - HIERARCHICAL_DOWNSHIFT, - /** - * A layering strategy based on a breadth first search (BFS). - *

- * All edges will span at most one layer in the resulting drawing. Edges between nodes that belong to the same layer are - * possible. - *

- *

- * The nodes that will be placed in the first layer can be provided by a data provider bound to the input graph using the - * key - * {@link yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY}. If this data provider is not given, then nodes that have no incoming - * edges are placed in the first layer. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - BFS, - /** - * A layering strategy which derives the layers from the initial coordinates of the nodes. - *

- * It tries to find a layering that is similar to the one in the input graph. The layout algorithm may place nodes in the - * same layer, even though they are connected by an edge. - *

- *

- * In a vertically oriented layout, nodes that overlap vertically are placed in the same layer. The same holds for a - * horizontally oriented layout in the case where the nodes overlap horizontally. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - FROM_SKETCH, - /** - * A layering strategy which uses a layer assignment specified by the user. - *

- * The nodes' layer assignment must be provided by a data provider bound to the input graph using the key - * {@link yfiles.hierarchic.GivenLayersLayerer#LAYER_ID_DP_KEY}. - *

- *

- * This layering strategy allows edges whose source and target share a layer. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - USER_DEFINED, - /** - * A dummy layering strategy which describes a strategy that is not part of the default strategies. - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - UNKNOWN - } - export enum GroupAlignmentPolicy{ - /** - * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the top with - * respect to their inner layers. - * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy - * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - */ - TOP, - /** - * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the center with - * respect to their inner layers. - * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy - * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - */ - CENTER, - /** - * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the bottom with - * respect to their inner layers. - * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy - * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - */ - BOTTOM - } - export enum LayerType{ - /** - * A constant describing a normal layer consisting mainly of normal nodes. - */ - NORMAL, - /** - * A constant describing a layer consisting mainly of label nodes or dummy nodes. - */ - LABEL, - /** - * A constant describing a layer consisting of source group nodes and dummy nodes. - */ - SOURCE_GROUP_NODES, - /** - * A constant describing a layer consisting of target group nodes and dummy nodes. - */ - TARGET_GROUP_NODES, - /** - * Describes a layer above a group to store the connector proxies where edges connect to groups. - */ - UPPER_GROUP_CONNECTOR_NODES, - /** - * Describes a layer below a group to store the connector proxies where edges connect to groups. - */ - LOWER_GROUP_CONNECTOR_NODES - } - export enum NodeDataType{ - /** - * A constant describing a normal {@link yfiles.algorithms.Node}. - *

- * A normal node may have any degree, any size and any number of connected same-layer edges. - *

- * @see yfiles.hierarchic.INodeData#type - */ - NORMAL, - /** - * A constant describing a bend {@link yfiles.algorithms.Node}. - *

- * A bend node has degree 2, small size and no same-layer edges. - *

- * @see yfiles.hierarchic.INodeData#type - */ - BEND, - /** - * A constant describing a side proxy {@link yfiles.algorithms.Node}. - *

- * A side proxy node, in case port constraints are used for the drawing phase, has degree - * 1, small size and no same-layer edges. The associated node is the one of which this node is the proxy. - *

- * @see yfiles.hierarchic.INodeData#type - */ - SIDE_PROXY, - /** - * A constant describing a side proxy {@link yfiles.algorithms.Node} for drawing same-layer edges. - *

- * A side proxy node for drawing same-layer edges has degree - * 0, small size and one same-layer edge. The associated node is the one of which this node is the proxy. The associated - * edge is the same-layer edge of which this node is the proxy. - *

- * @see yfiles.hierarchic.INodeData#type - */ - SAME_LAYER_SIDE_PROXY, - /** - * A constant describing a label {@link yfiles.algorithms.Node}. - *

- * A label node has degree - * 2, size of the labels and no same-layer edges. The borders of this node describe the layout of the labels. - *

- * @see yfiles.hierarchic.INodeData#type - */ - LABEL, - /** - * A constant describing a group {@link yfiles.algorithms.Node} for nested graph layouts. - *

- * This group node carries additional {@link yfiles.hierarchic.ILayers} information. - *

- * @see yfiles.hierarchic.INodeData#type - * @see yfiles.hierarchic.INodeData#groupLayers - */ - GROUP, - /** - * A constant describing a source group {@link yfiles.algorithms.Node} for bus edges. - *

- * This node serves as a dummy node in a {@link yfiles.hierarchic.LayerType#SOURCE_GROUP_NODES} layer. - *

- * @see yfiles.hierarchic.INodeData#type - * @see yfiles.hierarchic.INodeData#groupId - */ - SOURCE_GROUP_NODE, - /** - * A constant describing a target group {@link yfiles.algorithms.Node} for bus edges. - *

- * This node serves as a dummy node in a {@link yfiles.hierarchic.LayerType#TARGET_GROUP_NODES} layer. - *

- * @see yfiles.hierarchic.INodeData#type - * @see yfiles.hierarchic.INodeData#groupId - */ - TARGET_GROUP_NODE, - /** - * A constant describing a back-loop proxy that belongs to the source of an edge. - *

- * A back-loop proxy that belongs to the source of an edge has degree 2, small size and exactly one same-layer edge. - *

- * @see yfiles.hierarchic.INodeData#type - */ - SOURCE_BACK_LOOP_PROXY, - /** - * A constant describing a back-loop proxy that belongs to the target of an edge. - *

- * A back-loop proxy that belongs to the target of an edge has degree 2, small size and exactly one same-layer edge. - *

- * @see yfiles.hierarchic.INodeData#type - */ - TARGET_BACK_LOOP_PROXY, - /** - * A constant describing a same-layer edge crossing dummy {@link yfiles.algorithms.Node}. - *

- * A same-layer edge crossing dummy node has degree - * 2, small size and exactly two same-layer edges. It is used for marking the crossing of the layer, if source and target - * port are at opposite layer sides. - *

- * @see yfiles.hierarchic.INodeData#type - */ - SAME_LAYER_CENTER_NODE, - /** - * A constant describing a {@link yfiles.algorithms.Node} used for the drawing phase to keep the distance between two nodes. - * @see yfiles.hierarchic.INodeData#type - */ - DISTANCE_NODE, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the drawing phase for marking the beginning of a node group - * interval. - * @see yfiles.hierarchic.INodeData#type - */ - GROUP_BEGIN, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the drawing phase for marking the ending of a node group - * interval. - * @see yfiles.hierarchic.INodeData#type - */ - GROUP_END, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node - * inserted to guarantee that a group is non-empty on the layer on which it is defined. - * @see yfiles.hierarchic.INodeData#type - */ - GROUP_LAYER_DUMMY, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node - * inserted as a legal endpoint of an edge connecting to a group node. - * @see yfiles.hierarchic.INodeData#type - */ - PROXY_FOR_EDGE_AT_GROUP, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node - * inserted as a legal endpoint of an edge connecting a descendant node to a group node. It has degree 0 or 1 depending on - * whether or not the opposite node of the edge is assigned to the same layer. This kind of proxy nodes is only used if - * there are edges that shall connect to the group node without backloops. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - */ - PROXY_FOR_CONTENT_EDGE_AT_GROUP, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during sequencing and drawing phase for routing an {@link yfiles.algorithms.Edge} - * recursively. An {@link yfiles.algorithms.Edge} that connects to the content of a group node has to leave the group node at the - * bottom side and enter it at the top side. - * @see yfiles.hierarchic.INodeData#type - */ - RECURSIVE_EDGE_DUMMY - } - export enum PortAssignmentMode{ - /** - * A port assignment strategy that distributes ports evenly along the border of the node. - *

- * This is the default port assignment strategy of {@link yfiles.hierarchic.HierarchicLayout}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment - */ - DEFAULT, - /** - * A port assignment strategy that places all edges on grid lines. - *

- * If there are not enough grid lines for each port, ports may overlap. In case there is no grid line available at the side - * of a node, the ports are placed centered at that side. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment - */ - ON_GRID, - /** - * A port assignment strategy that places all edges on grid lines or sub-grid lines. - *

- * If there are not enough grid lines for each port, the grid gets subdivided with sub-grid lines until each edge has space - * for its port. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment - */ - ON_SUBGRID - } - export enum NodeLabelMode{ - /** - * A constant that prevents node labels from being considered during the layout. - *

- * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode - */ - NEVER, - /** - * A constant that makes the algorithm consider node labels for self-loops, node placement and routing. - *

- * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode - */ - CONSIDER_FOR_SELF_LOOPS, - /** - * A constant that makes the algorithm consider node labels for node placement and routing, but not for self-loops. - *

- * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode - */ - CONSIDER_FOR_DRAWING, - /** - * A constant that makes the algorithm consider node labels during routing only. - *

- * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode - */ - CONSIDER_FOR_ROUTING - } - export enum EdgeRoutingStyle{ - /** - * A routing style constant specifying that the edges should be orthogonal. Orthogonal edges only consist of vertical and - * horizontal segments. - */ - ORTHOGONAL, - /** - * A routing style constant specifying that the edges should be octilinear. Octilinear edges consist of vertical and - * horizontal segments as well as segments with slope -1 and 1. - */ - OCTILINEAR, - /** - * A routing style constant specifying that the edges should be polyline. - */ - POLYLINE - } - export enum GroupCompactionPolicy{ - /** - * A strategy specifying no horizontal group compaction. - *

- * This means that group node contents will occupy nearly the same horizontal positions as when not grouped at all. - *

- * @see yfiles.hierarchic.SimplexNodePlacer#groupCompactionStrategy - */ - NONE, - /** - * A strategy specifying maximal horizontal group compaction. - *

- * This means that the node placer will try to minimize the horizontally occupied space for a group node. - *

- * @see yfiles.hierarchic.SimplexNodePlacer#groupCompactionStrategy - */ - MAXIMAL - } - export enum RankingPolicy{ - /** - * A ranking policy that specifies that nodes are not re-ranked after the initial topological layering step. - */ - NO_RERANKING, - /** - * A ranking policy that specifies that nodes are re-ranked by an inexpensive downshift rule. - */ - DOWN_SHIFT, - /** - * A ranking policy that specifies that nodes are re-ranked by finding a spanning tree that contains only tight (length - * 1) edges. - */ - TIGHT_TREE - } - /** - * This layering algorithm implementation assigns nodes to layers given a mapping of nodes to layer IDs. - *

- * The layer IDs are given by a {@link yfiles.algorithms.IDataProvider} that returns the integer layer ID of each node of the - * graph. Nodes with the same ID are in the same layer while the layers are sorted according to their IDs such that the - * smallest ID represents the top layer. - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface GivenLayersLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class GivenLayersLayerer { - /** - * Creates an instance of {@link yfiles.hierarchic.GivenLayersLayerer}. - */ - constructor(); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Convenience method that removes empty layers and ensures that the smallest layer has value 0. - * @param graph the graph - * @param layerId the {@link } that returns an integer value (layer) for each node; the first layer has the number - * 0 - * @param normalizedLayerId the {@link } that will be filled by the layout algorithm and holds an integer value (layer ID - * after normalization) for each node - * @returns the number of layers after the removal of empty layers - */ - normalize(graph:yfiles.algorithms.Graph,layerId:yfiles.algorithms.IDataProvider,normalizedLayerId:yfiles.algorithms.IDataAcceptor):number; - /** - * Data provider key for storing the layer IDs - *

- * This {@link yfiles.algorithms.IDataProvider} stores for each node the layer ID to which it belongs. Nodes with the same ID are - * in the same layer while the layers are sorted according to their IDs such that the smallest ID represents the top - * layer. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LAYER_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.GivenLayersLayerer; - } - /** - * This class is a {@link yfiles.hierarchic.ISequencer} implementation that determines the sequence of nodes of the same {@link yfiles.hierarchic.ILayer layer} - * based on a given {@link yfiles.collections.IComparer. comparator} constraint. - * @class - * @implements {yfiles.hierarchic.ISequencer} - */ - export interface GivenSequenceSequencer extends yfiles.lang.Object,yfiles.hierarchic.ISequencer{} - export class GivenSequenceSequencer { - /** - * Creates a new instance of {@link yfiles.hierarchic.GivenSequenceSequencer} using a given {@link yfiles.collections.IComparer.} for the sequencing. - * @param [c=null] - */ - constructor(c?:yfiles.collections.IComparer); - /** - * Calculates the sequence of the nodes within a {@link yfiles.hierarchic.ILayers} instance based on the given {@link yfiles.collections.IComparer.} instance. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} during the sequencing phase and finally writes back the - * calculated sequence using the {@link yfiles.hierarchic.ILayer#setNodeOrder} method. - *

- * @param graph the input graph - * @param layers the given {@link } instance containing the elements of the layers - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param itemFactory the {@link } used for creating and destroying helper structures - */ - sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} used by this {@link yfiles.hierarchic.GivenSequenceSequencer} to determine the sequence of the nodes. - * @type {yfiles.collections.IComparer.} - */ - sequenceComparer:yfiles.collections.IComparer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.GivenSequenceSequencer; - } - /** - * Visitor interface that can be used to traverse the descendants of a group node - * @interface - */ - export interface IVisitor extends yfiles.lang.Object{ - /** - * Visits the descendants of a group node. - * @param node A descandant of the group node. - * @param parentNode A group node. - * @abstract - */ - visit(node:yfiles.algorithms.Node,parentNode:yfiles.algorithms.Node):void; - } - var IVisitor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IVisitor; - }; - /** - * This class is responsible for managing hierarchically grouped graphs. - *

- * The grouping information is provided through {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys - * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} and - * {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}. - *

- * @see yfiles.layout.GroupingSupport - * @see yfiles.layout.GroupingKeys - * @class - */ - export interface GroupingSupport extends yfiles.lang.Object{} - export class GroupingSupport { - /** - * Assigns edge group nodes to groups based on a given {@link yfiles.hierarchic.ILayers} instance. - * @param layers the given {@link } instance containing the elements in the layering - * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE - * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE - */ - assignEdgeGroupNodesToGroups(layers:yfiles.hierarchic.ILayers):void; - /** - * Assigns label nodes to groups. - * @param layers the given {@link } instance containing the elements in the layering - * @param itemFactory the {@link } used temporarily for modifying the graph instance - * @see yfiles.hierarchic.NodeDataType#LABEL - * @see yfiles.hierarchic.NodeDataType#BEND - * @see yfiles.hierarchic.NodeDataType#GROUP_BEGIN - * @see yfiles.hierarchic.NodeDataType#GROUP_END - */ - assignLabelNodesToGroups(layers:yfiles.hierarchic.ILayers,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Returns the direct children of the given group node. - * @param groupNode the given group node - * @returns a {@link } of all direct children or null if {@link } {@link #active is not active} - */ - getChildren(groupNode:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns the descendant {@link yfiles.algorithms.Node}s of the given group node. - *

- * The descendants are all direct or indirect children of a group node. - *

- * @param groupNode the given group node - * @returns a {@link } of all descendants or null if {@link } {@link #active is not active} - */ - getDescendants(groupNode:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns the parent group node of the given {@link yfiles.algorithms.Node} or null if the given node is a top-level node. - * @param node the given {@link } - * @returns the parent group node or null if the given node is a top-level node or if {@link } - * {@link #active is not active} - */ - getParentNode(node:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Hides the group nodes and incident edges from the graph. - */ - hideGroupNodes():void; - /** - * Returns whether or not the given node is a descendant {@link yfiles.algorithms.Node} of the given group node. - *

- * The descendants are all direct or indirect children of a group node. - *

- * @param node the given node - * @param groupNode the given group node - * @returns true if the given node is a descendant of the given group node, false otherwise - */ - isDescendant(node:yfiles.algorithms.Node,groupNode:yfiles.algorithms.Node):boolean; - /** - * Returns whether or not the given {@link yfiles.algorithms.Node} is a non-empty group node. - * @param node the given {@link } - * @returns true if the given node is a non-empty group node, false otherwise - */ - isGroupNode(node:yfiles.algorithms.Node):boolean; - /** - * Removes the current assignment of source/target edge groups from a given {@link yfiles.hierarchic.ILayers} instance. - * @param layers the given {@link } instance containing the elements in the layering - * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE - * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE - */ - removeEdgeGroupAssignment(layers:yfiles.hierarchic.ILayers):void; - /** - * Un-hides all previously hidden group nodes and incident edges. - */ - unhideGroupNodes():void; - /** - * Visits all descendant {@link yfiles.algorithms.Node}s of the given group node. - *

- * The descendants are all direct or indirect children of a group node. - *

- * @param groupNode the given group node - * @param visitor a {@link } implementation - */ - visitDescendants(groupNode:yfiles.algorithms.Node,visitor:yfiles.hierarchic.IVisitor):void; - /** - * Gets or sets the minimum distance between group nodes. - *

- * The minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - minimumGroupDistance:number; - /** - * Gets whether or not {@link yfiles.hierarchic.GroupingSupport} is active. - * @type {boolean} - */ - active:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.GroupingSupport; - } - /** - * This layout algorithm arranges graphs in a hierarchic fashion. - *

- * Layout Style The nodes are distributed into layers so that most of the edges point to the main layout direction. The order of the - * nodes within the layers ensures that the number of edge crossings is as small as possible. There are different edge - * routing styles available. Edges can be orthogonal, polyline or octilinear. - *

- *

- * Hierarchical diagrams are commonly used for the visualization of hierarchical data, since they facilitate the - * identification of dependencies and relationships among the nodes of the graph. Possible application domains are the - * following: workflow visualization, call graph visualization, entity-relationship diagrams, biochemical pathways and - * network management. - *

- *

- * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[137.81,67.5],[137.81,135],[718.44,67.5],[147.19,202.5],[305.62,135],[296.25,202.5],[771.88,450],[354.38,285],[290,367.5],[366.88,367.5],[400.62,67.5],[709.06,135],[709.06,202.5],[366.88,450],[79.69,202.5],[492.5,285],[501.88,367.5],[627.5,285],[357.5,532.5],[363.75,202.5],[286.88,285],[425,532.5],[400.62,135],[569.38,450],[569.38,367.5],[155,450],[434.38,367.5],[636.88,367.5],[84.38,285],[151.88,285],[222.5,532.5],[290,532.5],[155,532.5],[87.5,532.5],[20,532.5],[219.38,285],[69.38,367.5],[713.75,285],[704.38,367.5],[771.88,367.5],[848.75,285],[906.88,367.5],[839.38,367.5],[400.62,0]],"e":[[0,1,0,18.75,0,-18.75],[1,3,9.38,18.75,0,-18.75],[0,4,12.5,18.75,0,-18.75,[169.06,120,324.38,120]],[4,5,-9.38,18.75,0,-18.75],[2,6,9.38,18.75,12.5,-18.75,[746.56,120,959.38,120,959.38,420,803.12,420]],[5,7,9.38,18.75,0,-18.75,[324.38,255,373.12,255]],[7,8,0,18.75,0,-18.75,[373.12,352.5,308.75,352.5]],[7,9,12.5,18.75,0,-18.75],[2,11,-9.38,18.75,0,-18.75],[11,12,0,18.75,0,-18.75],[9,13,0,18.75,0,-18.75],[1,14,-9.38,18.75,0,-18.75,[147.19,187.5,98.44,187.5]],[12,15,-14.06,18.75,0,-18.75,[713.75,255,511.25,255]],[15,16,9.38,18.75,0,-18.75],[12,17,-4.69,18.75,0,-18.75,[723.13,270,646.25,270]],[13,18,-9.38,18.75,0,-18.75],[4,19,9.38,18.75,0,-18.75,[333.75,187.5,382.5,187.5]],[5,20,-9.38,18.75,0,-18.75],[13,21,9.38,18.75,0,-18.75,[395,502.5,443.75,502.5]],[10,22,0,18.75,0,-18.75],[22,23,0,18.75,-12.5,-18.75,[419.38,420,575.62,420]],[17,24,-9.38,18.75,0,-18.75,[636.88,337.5,588.12,337.5]],[24,23,0,18.75,0,-18.75],[0,25,-12.5,18.75,-9.38,-18.75,[144.06,120,54.38,120,54.38,420,164.38,420]],[8,25,-9.38,18.75,9.38,-18.75,[299.38,420,183.12,420]],[15,26,-9.38,18.75,0,-18.75,[501.88,337.5,453.12,337.5]],[17,27,9.38,18.75,0,-18.75],[27,6,0,18.75,-12.5,-18.75,[655.62,420,778.12,420]],[3,28,-4.69,18.75,0,-18.75,[161.25,270,103.12,270]],[3,29,4.69,18.75,0,-18.75],[25,30,7.5,18.75,0,-18.75,[181.25,517.5,241.25,517.5]],[25,31,15,18.75,-9.38,-18.75,[188.75,502.5,299.38,502.5]],[8,31,9.38,18.75,9.38,-18.75],[25,32,0,18.75,0,-18.75],[25,33,-7.5,18.75,0,-18.75,[166.25,517.5,106.25,517.5]],[25,34,-15,18.75,0,-18.75,[158.75,502.5,38.75,502.5]],[3,35,14.06,18.75,0,-18.75,[180,255,238.12,255]],[3,36,-14.06,18.75,-9.38,-18.75,[151.88,255,69.38,255,69.38,337.5,78.75,337.5]],[7,36,-12.5,18.75,9.38,-18.75,[360.62,337.5,97.5,337.5]],[12,37,4.69,18.75,0,-18.75],[37,38,-9.38,18.75,0,-18.75],[38,23,0,18.75,12.5,-18.75,[723.12,435,600.62,435]],[37,39,9.38,18.75,0,-18.75,[741.88,337.5,790.62,337.5]],[39,6,0,18.75,0,-18.75],[12,40,14.06,18.75,0,-18.75,[741.88,255,867.5,255]],[40,41,9.38,18.75,0,-18.75,[876.88,337.5,925.62,337.5]],[40,42,-9.38,18.75,0,-18.75],[43,0,-12.5,18.75,0,-18.75,[406.88,52.5,156.56,52.5]],[43,2,12.5,18.75,0,-18.75,[431.88,52.5,737.19,52.5]],[43,10,0,18.75,0,-18.75]],"vp":[20.0,0.0,940.0,570.0]}} Hierarchic Layout obtained with default settingsConceptThe layout algorithm runs in three main phases: - *

- *
    - *
  • - * Layering – The nodes are distributed into layers by means of {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer} or - * {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer}, respectively. If the layout orientation is top-to-bottom, the nodes in each layer are arranged horizontally while the - * layers are ordered vertically top-to-bottom. - *
  • - *
  • - * Sequencing – The order of the nodes in each layer is determined such that the number of edge crossings is as small as possible. To - * specify the sequencing algorithm, use {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer} or {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer}. - *
  • - *
  • Drawing – The layout algorithm assigns the final coordinates to all nodes and routes the edges.
  • - *
- *

- * Features - *

- *

- * This layout algorithm is able to create hierarchic layouts from scratch or add new elements to the existing sketch - * drawing incrementally. In order to add elements incrementally to the current sketch or let the algorithm optimize - * certain elements in the current sketch, set the layout mode to {@link yfiles.hierarchic.LayoutMode#INCREMENTAL}. Then register a - * {@link yfiles.algorithms.IDataProvider} (e.g. use {@link yfiles.algorithms.Maps#createHashedDataMap}) with the graph using the {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY} - * DataProvider key and associate the hints obtained from the {@link yfiles.hierarchic.IIncrementalHintsFactory} with the elements - * to be added incrementally. - *

- *

- * {@link yfiles.hierarchic.NodeLayoutDescriptor} and {@link yfiles.hierarchic.EdgeLayoutDescriptor} instances can be used for specifying - * individual information (e.g. distances or routing styles) for each node and edge in the graph. The descriptors are bound - * to the graph using {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY} - * or {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If there is no descriptor assigned to some - * nodes/edges, a default descriptor will be used. To set default descriptors use {@link yfiles.hierarchic.HierarchicLayout#nodeLayoutDescriptor} and {@link yfiles.hierarchic.HierarchicLayout#edgeLayoutDescriptor}. - *

- *

- * {@link yfiles.hierarchic.HierarchicLayout} supports two approaches to connect edges on a specific side or even an exact location - * to a node. {@link yfiles.layout.PortConstraint}s define a single constraint for the ports of an edge. To realize more complex - * port restrictions, several {@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortCandidateSet}s can be assigned to edges or - * nodes. If an edge with registered {@link yfiles.layout.PortCandidate}s connects to nodes with {@link yfiles.layout.PortCandidateSet}s, - * the layouter will try to match both collections to find an appropriate port. In case there is no matching port - * candidate, a {@link yfiles.layout.PortCandidate} specified for the edge is preferred. For the matching to work properly, the - * candidates in both collection need to be the same instances. Since their simultaneous existence at the same node may be - * ambiguous, it is not recommended to use a combination of {@link yfiles.layout.PortConstraint}s and - * {@link yfiles.layout.PortCandidate}s in the same layout. - *

- *

- * The edge grouping feature of this layout algorithm is restricted to normal, hierarchic edges. Edges with {@link yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle recursive edge style} - * {@link yfiles.hierarchic.RecursiveEdgeStyle#DIRECTED} or {@link yfiles.hierarchic.RecursiveEdgeStyle#UNDIRECTED} will not be grouped. - * They are also not grouped when enabling {@link yfiles.hierarchic.HierarchicLayout#automaticEdgeGrouping automatic edge grouping}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface HierarchicLayout extends yfiles.layout.MultiStageLayout{} - export class HierarchicLayout { - /** - * Creates a new {@link yfiles.hierarchic.HierarchicLayout} instance with the default settings. - */ - constructor(); - /** - * Configures the core layout algorithm with the settings of this {@link yfiles.hierarchic.HierarchicLayout} instance. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayout#applyLayoutCore} before the actual layout is calculated. It - * may be overridden in order to manually reconfigure the core layout algorithm. - *

- *

- * This implementation will temporarily set a {@link yfiles.hierarchic.PortCandidateOptimizer} if a {@link yfiles.algorithms.IDataProvider} - * is registered with {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY} and no {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} is assigned. - *

- * @param graph the input graph - * @param coreLayouter the given core layout algorithm instance - * @protected - */ - configureCoreLayout(graph:yfiles.layout.LayoutGraph,coreLayouter:yfiles.hierarchic.HierarchicLayoutCore):void; - /** - * Returns a new {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance that will be used during the various phases of the layout - * algorithm to determine the drawing details of the edges of the graph. - *

- * This method may be overridden to create a new {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance with different - * configuration settings. - *

- * @returns a new {@link } instance - * @protected - */ - createEdgeLayoutDescriptor():yfiles.hierarchic.EdgeLayoutDescriptor; - /** - * Returns a new {@link yfiles.hierarchic.HierarchicLayoutCore} instance. - *

- * This method may be overridden to create a new {@link yfiles.hierarchic.HierarchicLayoutCore} object with different configuration - * settings. - *

- *

- * This factory method provides the initial {@link yfiles.hierarchic.HierarchicLayoutCore} instance. - *

- * @returns a new {@link } instance - * @protected - */ - createHierarchicLayoutCore():yfiles.hierarchic.HierarchicLayoutCore; - /** - * Returns a {@link yfiles.hierarchic.IIncrementalHintsFactory} instance that must be used to obtain hints to be associated with - * graph elements that should be laid out incrementally. - *

- * Use this factory and a {@link yfiles.algorithms.IDataProvider} that is registered to the graph using the {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY} - * key to associate appropriate hints with the graph elements that should be laid out incrementally by the algorithm. - *

- * @returns a new {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#createIncrementalHintsFactory - * @see yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @see yfiles.hierarchic.LayoutMode#INCREMENTAL - */ - createIncrementalHintsFactory():yfiles.hierarchic.IIncrementalHintsFactory; - /** - * Creates and registers an incremental layer constraint factory for an {@link yfiles.graph.IGraph}. - * @param graph The graph for which the factory is created - * @returns the sequence constraint factory - */ - createLayerConstraintFactory(graph:yfiles.graph.IGraph):yfiles.hierarchic.ILayerConstraintFactory; - /** - * Returns a {@link yfiles.hierarchic.ILayerConstraintFactory} instance that can be used for specifying layer constraints for the - * given graph. - *

- * The instance is usually bound to {@link yfiles.algorithms.Graph} instance - * graph, i.e., if the input graph for the layerer changes, a new instance must be retrieved. This instance can be used for - * creating constraints for this graph instance. - *

- *

- * You can create an instance without binding it to a graph instance initially by passing a null parameter. In that case, - * you must bind the returned instance to the graph, see {@link yfiles.hierarchic.HierarchicLayout#LAYER_CONSTRAINTS_MEMENTO_DP_KEY} - * and {@link yfiles.hierarchic.ILayerConstraintFactory#memento}. - *

- * @param graph the input graph - * @returns a new {@link } instance - */ - createLayerConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ILayerConstraintFactory; - /** - * Returns a new {@link yfiles.hierarchic.NodeLayoutDescriptor} instance that will be used during the various phases of the layout - * algorithm to determine the drawing details of the nodes of the graph. - *

- * This method may be overridden to create a new {@link yfiles.hierarchic.NodeLayoutDescriptor} instance with different - * configuration settings. - *

- * @returns a new {@link } instance - * @protected - */ - createNodeLayoutDescriptor():yfiles.hierarchic.NodeLayoutDescriptor; - /** - * Creates and registers a sequencer constraint factory for an {@link yfiles.graph.IGraph}. - * @param graph The graph. - * @returns the sequence constraint factory - */ - createSequenceConstraintFactory(graph:yfiles.graph.IGraph):yfiles.hierarchic.ISequenceConstraintFactory; - /** - * Returns a {@link yfiles.hierarchic.ISequenceConstraintFactory} instance that can be used for specifying sequence constraints for - * the given graph. - *

- * For these sequence constraints to have any effect, the {@link yfiles.hierarchic.ISequencer} that determines the in-layer node - * order (sequence) has to support constraints. Both, {@link yfiles.hierarchic.DefaultLayerSequencer DefaultLayerSequencer} and the incremental sequencer used internally support - * sequence constraints. - *

- * @param graph the input graph - * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer - */ - createSequenceConstraintFactory(graph:yfiles.layout.LayoutGraph):yfiles.hierarchic.ISequenceConstraintFactory; - /** - * Disposes of the core layout algorithm. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayout#applyLayoutCore} after the actual layout is calculated. It - * may be overridden in order to revert a custom configuration made in - * {@link yfiles.hierarchic.HierarchicLayout#configureCoreLayout}. - *

- *

- * This implementation will remove the {@link yfiles.hierarchic.PortCandidateOptimizer} that was created in case a {@link yfiles.algorithms.IDataProvider} - * is registered with {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY} and no {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} was initially assigned. - *

- * @param graph the input graph - * @param coreLayouter the given core layout algorithm instance - * @protected - */ - disposeCoreLayout(graph:yfiles.layout.LayoutGraph,coreLayouter:yfiles.hierarchic.HierarchicLayoutCore):void; - /** - * Returns the mirror mask of the {@link yfiles.layout.MultiStageLayout#orientationLayout orientation layouter}. - *

- * It may be overridden in order to configure a different mirror mask. - *

- * @returns the mirror mask - * @protected - */ - getMirrorMode():yfiles.layout.MirrorModes; - /** - * Data provider key for specifying the directedness of edges - *

- * Generally, the hierarchic layout algorithm assigns nodes to layers such that most of the edges point in the - * {@link yfiles.layout.MultiStageLayout#layoutOrientation main layout direction}. The directedness of an edge specifies whether it should comply with this strategy. More - * precisely, a value of 1 means that the edge should fully comply, a value of -1 that it should comply inversely (the edge - * should point against the main layout direction), and a value of 0 means that the direction doesn't matter at all and the - * endpoints of the edges may be placed at the same layer. If there are conflicting preferences, edges with higher absolute - * values are more likely to point in the desired direction. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_DIRECTEDNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for defining the priority of critical edges - *

- * Critical edges highlight different edge paths that are relevant for a user. The layouter tries to vertically align each - * node pair that is connected by a critical edge. Conflicts between different critical edges are always resolved in favor - * of the higher priority. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static CRITICAL_EDGE_PRIORITY_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the thickness of the edges - *

- * The specified non-negative thickness is considered when calculating minimum distances so that there are no overlaps - * between edges and other graph elements. By default, each edge has thickness 0. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_THICKNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying incremental hints - *

- * Incremental hints are created using an {@link yfiles.hierarchic.HierarchicLayout#createIncrementalHintsFactory incremental hints factory}. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY - * @see yfiles.hierarchic.IIncrementalHintsFactory - * @const - * @static - * @type {yfiles.algorithms.GraphObjectDpKey.} - */ - static INCREMENTAL_HINTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey; - /** - * Data acceptor key for publishing the layer IDs for all nodes in the graph - * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LAYER_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data acceptor key for publishing the index inside their layer for all nodes in the graph - * @see yfiles.hierarchic.HierarchicLayoutCore#SEQUENCE_INDEX_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SEQUENCE_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining swimlanes for the nodes - *

- * The layout algorithm will arrange nodes in swimlanes according to the registered descriptors. - *

- *

- * Layout information about the swimlanes is finally written back to the descriptor instances. Instances can be shared - * among multiple nodes in the same lane. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SWIMLANE_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for associating an alternative bounds with the collapsed/expanded group - *

- * When running in {@link yfiles.hierarchic.LayoutMode#INCREMENTAL incremental} - * {@link yfiles.hierarchic.HierarchicLayout#layoutMode layout mode}, the alternative bounds of the collapsed/expanded group will be used during the layering and sequencing - * phase of the algorithm. - *

- * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_EDGE_PATH_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ALTERNATIVE_GROUP_BOUNDS_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for associating alternative paths for edges connecting to groups, group content or folder nodes - *

- * When running in {@link yfiles.hierarchic.LayoutMode#INCREMENTAL incremental} - * {@link yfiles.hierarchic.HierarchicLayout#layoutMode layout mode}, the alternative edge paths are considered during the routing of fixed (i.e., non-incremental) edges. - *

- *

- * The alternative paths should be used in conjunction with {@link yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY alternative group bounds} to achieve more stable layout results - * when collapsing/expanding a group node as follows: - *

- *
    - *
  1. - * Collapsing: edges adjacent to the group itself and edges where one of the endpoints (source/target) lies inside the - * group should get the path before collapsing the group as alternative path. If both endpoints are either inside or outside the - * group, no alternative path is required. - *
  2. - *
  3. - * Expanding: edges adjacent to the expanded folder node (which is now a group) should get the path before expanding as - * alternative path. - *
  4. - *
- * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ALTERNATIVE_EDGE_PATH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for marking folder nodes - *

- * When using recursive edge styles in incremental mode, edges will also start at the bottom and end at the top of marked - * folder nodes. This will keep the edge routes more stable since the connection sides won't change. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FOLDER_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for storing the constraint graph - *

- * A v1 before v2 constraint is represented as an edge between the representatives of v1 and v2 in the constraint graph. - *

- * @const - * @static - * @type {yfiles.algorithms.GraphDpKey.} - */ - static SEQUENCE_CONSTRAINTS_MEMENTO_DP_KEY:yfiles.algorithms.GraphDpKey; - /** - * Data provider key for storing the constraint graph - * @const - * @static - * @type {yfiles.algorithms.GraphDpKey.} - */ - static LAYER_CONSTRAINTS_MEMENTO_DP_KEY:yfiles.algorithms.GraphDpKey; - /** - * Gets or sets the group layer alignment strategy used for recursive group layering. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown group alignment policy is given - * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - * @type {yfiles.hierarchic.GroupAlignmentPolicy} - */ - groupAlignmentPolicy:yfiles.hierarchic.GroupAlignmentPolicy; - /** - * Gets or sets whether or not layer compaction for recursive group layering is active. - *

- * The number of node layers is decreased if possible without reversing edge directions. The resulting layering tries to - * keep the layer span of a group node minimum while minimizing the overall vertical space. - *

- * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - * @type {boolean} - */ - compactGroups:boolean; - /** - * Gets or sets the policy that specifies how to arrange connected components. - * @throws {Stubs.Exceptions.ArgumentError} if the specified policy does not match a default component arrangement policy - * @type {yfiles.hierarchic.ComponentArrangementPolicy} - */ - componentArrangementPolicy:yfiles.hierarchic.ComponentArrangementPolicy; - /** - * Gets or sets the time limit (in milliseconds) set for the layout algorithm. - *

- * Values have to be greater or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets whether or not groups are respected during the layering stage. - *

- * If this option is enabled, groups are layered recursively, i.e. - *

- *
    - *
  • nodes in the same group always occupy adjacent layers
  • - *
  • layer intervals spanned by different group nodes are either disjoint or are nested
  • - *
- *

- * If it is disabled, group information is ignored for the layering step. - *

- *

- * If the graph is flat, this setting is ignored. - *

- * @see yfiles.hierarchic.HierarchicLayout#compactGroups - * @type {boolean} - */ - recursiveGroupLayering:boolean; - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * When the spacing is negative or zero, no grid is defined, otherwise nodes and edges are placed on multiples of the grid - * spacing. - *

- * @see yfiles.hierarchic.IIncrementalHintsFactory - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets whether or not reversed edges should be routed as back-loops. - *

- * When this option is enabled, back-loops attach to the same node sides as the other edges, i.e., for layout orientation - * top-to-bottom, they leave their source at the bottom and enter their target at the top. - *

- * @type {boolean} - */ - backLoopRouting:boolean; - /** - * Gets or sets whether or not self-loops should be routed in a similar manner as back-loops. - *

- * Self-loops will start at the bottom of their attached nodes and end at the top of them. - *

- * @see yfiles.hierarchic.HierarchicLayout#backLoopRouting - * @type {boolean} - */ - backLoopRoutingForSelfLoops:boolean; - /** - * Gets or sets whether or not edges are grouped automatically. - *

- * The automatic edge grouping tries to group a high number of edges without changing the semantic of the graph, i.e., it - * groups edges either at a common source node or a common target node. Edge groupings often allow more compact layouts - * since grouped edges are routed in a bus-style manner. - *

- * @type {boolean} - */ - automaticEdgeGrouping:boolean; - /** - * Gets or sets whether or not edges should be routed orthogonally. - *

- * When orthogonal routing is enabled, all resulting edge paths will be composed of vertical and horizontal segments, - * only. - *

- * @type {boolean} - */ - orthogonalRouting:boolean; - /** - * Gets or sets whether or not the layout algorithm reserves space for labels and places them. - *

- * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on - * {@link yfiles.layout.IEdgeLabelLayout}. - *

- *

- * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} - * and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to true. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if integrated labeling should be enabled but the current {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is not of type - * {@link yfiles.layout.LabelLayoutTranslator} - * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though integrated labeling was enabled - * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). - * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets whether or not the layout algorithm considers node labels when calculating node positions to avoid - * overlaps. - *

- * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} - * and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to true. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if this property should be enabled but the current {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is not of type - * {@link yfiles.layout.LabelLayoutTranslator} - * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though this property was enabled - * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets the minimum distance between two adjacent layers. - *

- * The specified distance should have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @type {number} - */ - minimumLayerDistance:number; - /** - * Gets or sets whether or not to stop the layout algorithm after the layering step. - *

- * By then, each node will be assigned to a layer. Since the sequencing and drawing phases are skipped, the order of the - * nodes within a layer matches the initial order of the nodes, edges won't be routed and the nodes won't get coordinates - * assigned. - *

- *

- * The calculated layering information can be retrieved from the {@link yfiles.algorithms.IDataProvider} registered with the key - * {@link yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY}. - *

- * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY - * @type {boolean} - */ - stopAfterLayering:boolean; - /** - * Gets or sets whether or not to stop the layout algorithm after the sequencing step. - *

- * By then, each node will be assigned to a layer and will have a place in the sequence of nodes in this layer. Since the - * drawing phase is skipped, edges won't be routed and the nodes won't get coordinates assigned. - *

- *

- * The calculated layering and sequencing information can be retrieved from the {@link yfiles.algorithms.IDataProvider}s registered - * with the keys {@link yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY} and - * {@link yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY}. - *

- * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY - * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY - * @type {boolean} - */ - stopAfterSequencing:boolean; - /** - * Gets or sets the minimum distance between two adjacent nodes in one layer. - *

- * All values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of - * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} - * @type {number} - */ - nodeToNodeDistance:number; - /** - * Gets or sets the minimum distance between an edge and an adjacent node in one layer. - *

- * All values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of - * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} - * @type {number} - */ - nodeToEdgeDistance:number; - /** - * Gets or sets the minimum distance between two adjacent edges in one layer. - *

- * All values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of - * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} - * @type {number} - */ - edgeToEdgeDistance:number; - /** - * Gets or sets whether or not to separate layers. - *

- * In case layers are not separated, nodes of a layer may extend into adjacent layers. Otherwise, nodes of different layers - * are strictly separated, i.e., layers are placed below each other. - *

- * @type {boolean} - */ - separateLayers:boolean; - /** - * Gets the {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} that is registered with the layout algorithm by default. - * @throws {Stubs.Exceptions.InvalidOperationError} if the current instance returned by {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator} is not an instance of {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} - * @protected - * @type {yfiles.hierarchic.DefaultDrawingDistanceCalculator} - */ - defaultDrawingDistanceCalculator:yfiles.hierarchic.DefaultDrawingDistanceCalculator; - /** - * Gets the current layout algorithm instance. - *

- * By default, this method will return a {@link yfiles.hierarchic.HierarchicLayoutCore} instance created with - * {@link yfiles.hierarchic.HierarchicLayout#createHierarchicLayoutCore}. - *

- * @see yfiles.hierarchic.HierarchicLayout#createHierarchicLayoutCore - * @type {yfiles.hierarchic.HierarchicLayoutCore} - */ - hierarchicLayoutCore:yfiles.hierarchic.HierarchicLayoutCore; - /** - * Gets or sets a predefined layering strategy for the {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer from scratch} layerer. - *

- * The layouter assigns the nodes to separate layers. The nodes within each layer will be placed on the same horizontal - * layer. The layers will be arranged vertically starting with the small-numbered layers. - *

- *

- * An important layering strategy for the hierarchic layout style is called Hierarchical Layering. A hierarchical layering - * tries to assign nodes to layers in a way such that as much edges of the graph as possible will point to the main layout - * direction, i.e., the start nodes of the edges will be in a layer with a smaller number than the corresponding end nodes. - * Also, a hierarchical layering will never put two connected nodes in the same layer. - *

- *

- * This method wraps the internal implementations into a {@link yfiles.hierarchic.MultiComponentLayerer} instance so that it is - * possible to specify the behavior of the algorithm if the {@link yfiles.layout.MultiStageLayout#componentLayoutEnabled component layouter} is disabled. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown strategy is given - * @type {yfiles.hierarchic.LayeringStrategy} - */ - fromScratchLayeringStrategy:yfiles.hierarchic.LayeringStrategy; - /** - * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance that obtains the layering for the nodes if the layout algorithm - * runs in {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH From Scratch mode}. - *

- * If the graph consists of multiple components, then the {@link yfiles.hierarchic.ILayerer} instance should be wrapped in - * {@link yfiles.hierarchic.MultiComponentLayerer}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ILayerer} is null - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @type {yfiles.hierarchic.ILayerer} - */ - fromScratchLayerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance that calculates the node sequence if the layout algorithm runs in - * {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH From Scratch mode}. - * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ISequencer} is null - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @type {yfiles.hierarchic.ISequencer} - */ - fromScratchSequencer:yfiles.hierarchic.ISequencer; - /** - * Gets or sets the {@link yfiles.hierarchic.INodePlacer} instance that will calculate the final node placement of the layout. - * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.INodePlacer} is null - * @type {yfiles.hierarchic.INodePlacer} - */ - nodePlacer:yfiles.hierarchic.INodePlacer; - /** - * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance that obtains the layering for fixed nodes during the incremental - * layout run. - * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ILayerer} is null - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @type {yfiles.hierarchic.ILayerer} - */ - fixedElementsLayerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance that calculates the sequence of the fixed nodes during the - * incremental layout run. - * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.hierarchic.ISequencer} is null - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @type {yfiles.hierarchic.ISequencer} - */ - fixedElementsSequencer:yfiles.hierarchic.ISequencer; - /** - * Gets or sets the layout mode this layouter should use for upcoming layouts. - *

- * Depending on the mode the layout algorithm will use different {@link yfiles.hierarchic.ILayerer} and {@link yfiles.hierarchic.ISequencer} - * implementations. - *
- *

- * @throws {Stubs.Exceptions.ArgumentError} if the given layout mode is unknown - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer - * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer - * @type {yfiles.hierarchic.LayoutMode} - */ - layoutMode:yfiles.hierarchic.LayoutMode; - /** - * Gets or sets the {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific - * layout descriptor assigned. - *

- * By default, this method will return a {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance created with - * {@link yfiles.hierarchic.HierarchicLayout#createEdgeLayoutDescriptor}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.EdgeLayoutDescriptor} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.hierarchic.EdgeLayoutDescriptor} - */ - edgeLayoutDescriptor:yfiles.hierarchic.EdgeLayoutDescriptor; - /** - * Gets or sets the {@link yfiles.hierarchic.NodeLayoutDescriptor} instance used for all those nodes that do not have a specific - * layout descriptor assigned. - *

- * By default, this method will return a {@link yfiles.hierarchic.NodeLayoutDescriptor} instance created with - * {@link yfiles.hierarchic.HierarchicLayout#createNodeLayoutDescriptor}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.hierarchic.NodeLayoutDescriptor} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY - * @see yfiles.hierarchic.HierarchicLayout#createNodeLayoutDescriptor - * @type {yfiles.hierarchic.NodeLayoutDescriptor} - */ - nodeLayoutDescriptor:yfiles.hierarchic.NodeLayoutDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.HierarchicLayout; - } - /** - * This class arranges graphs in a hierarchic/layered fashion and supports complete re-layout as well as incremental graph - * layout. - *

- * Note that class {@link yfiles.hierarchic.HierarchicLayout} offers a facade to this class which is easier to use. Hence, we - * strongly recommend to not directly use class {@link yfiles.hierarchic.HierarchicLayoutCore}. - *

- *

- * Layout Style The nodes are distributed into layers such that most of the edges point to the main layout direction. The order of the - * nodes within the layers ensures that the number of edge crossings is as small as possible. There are different edge - * routing styles available. Edges can be orthogonal, polyline or octilinear. - *

- *

- * Hierarchical diagrams are commonly used for the visualization of hierarchical data, since they facilitate the - * identification of dependencies and relationships among the nodes of the graph. Possible application domains are the - * following: workflow visualization, call graph visualization, entity-relationship diagrams, biochemical pathways and - * network management. - *

- *

- * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[137.81,67.5],[137.81,135],[718.44,67.5],[147.19,202.5],[305.62,135],[296.25,202.5],[771.88,450],[354.38,285],[290,367.5],[366.88,367.5],[400.62,67.5],[709.06,135],[709.06,202.5],[366.88,450],[79.69,202.5],[492.5,285],[501.88,367.5],[627.5,285],[357.5,532.5],[363.75,202.5],[286.88,285],[425,532.5],[400.62,135],[569.38,450],[569.38,367.5],[155,450],[434.38,367.5],[636.88,367.5],[84.38,285],[151.88,285],[222.5,532.5],[290,532.5],[155,532.5],[87.5,532.5],[20,532.5],[219.38,285],[69.38,367.5],[713.75,285],[704.38,367.5],[771.88,367.5],[848.75,285],[906.88,367.5],[839.38,367.5],[400.62,0]],"e":[[0,1,0,18.75,0,-18.75],[1,3,9.38,18.75,0,-18.75],[0,4,12.5,18.75,0,-18.75,[169.06,120,324.38,120]],[4,5,-9.38,18.75,0,-18.75],[2,6,9.38,18.75,12.5,-18.75,[746.56,120,959.38,120,959.38,420,803.12,420]],[5,7,9.38,18.75,0,-18.75,[324.38,255,373.12,255]],[7,8,0,18.75,0,-18.75,[373.12,352.5,308.75,352.5]],[7,9,12.5,18.75,0,-18.75],[2,11,-9.38,18.75,0,-18.75],[11,12,0,18.75,0,-18.75],[9,13,0,18.75,0,-18.75],[1,14,-9.38,18.75,0,-18.75,[147.19,187.5,98.44,187.5]],[12,15,-14.06,18.75,0,-18.75,[713.75,255,511.25,255]],[15,16,9.38,18.75,0,-18.75],[12,17,-4.69,18.75,0,-18.75,[723.13,270,646.25,270]],[13,18,-9.38,18.75,0,-18.75],[4,19,9.38,18.75,0,-18.75,[333.75,187.5,382.5,187.5]],[5,20,-9.38,18.75,0,-18.75],[13,21,9.38,18.75,0,-18.75,[395,502.5,443.75,502.5]],[10,22,0,18.75,0,-18.75],[22,23,0,18.75,-12.5,-18.75,[419.38,420,575.62,420]],[17,24,-9.38,18.75,0,-18.75,[636.88,337.5,588.12,337.5]],[24,23,0,18.75,0,-18.75],[0,25,-12.5,18.75,-9.38,-18.75,[144.06,120,54.38,120,54.38,420,164.38,420]],[8,25,-9.38,18.75,9.38,-18.75,[299.38,420,183.12,420]],[15,26,-9.38,18.75,0,-18.75,[501.88,337.5,453.12,337.5]],[17,27,9.38,18.75,0,-18.75],[27,6,0,18.75,-12.5,-18.75,[655.62,420,778.12,420]],[3,28,-4.69,18.75,0,-18.75,[161.25,270,103.12,270]],[3,29,4.69,18.75,0,-18.75],[25,30,7.5,18.75,0,-18.75,[181.25,517.5,241.25,517.5]],[25,31,15,18.75,-9.38,-18.75,[188.75,502.5,299.38,502.5]],[8,31,9.38,18.75,9.38,-18.75],[25,32,0,18.75,0,-18.75],[25,33,-7.5,18.75,0,-18.75,[166.25,517.5,106.25,517.5]],[25,34,-15,18.75,0,-18.75,[158.75,502.5,38.75,502.5]],[3,35,14.06,18.75,0,-18.75,[180,255,238.12,255]],[3,36,-14.06,18.75,-9.38,-18.75,[151.88,255,69.38,255,69.38,337.5,78.75,337.5]],[7,36,-12.5,18.75,9.38,-18.75,[360.62,337.5,97.5,337.5]],[12,37,4.69,18.75,0,-18.75],[37,38,-9.38,18.75,0,-18.75],[38,23,0,18.75,12.5,-18.75,[723.12,435,600.62,435]],[37,39,9.38,18.75,0,-18.75,[741.88,337.5,790.62,337.5]],[39,6,0,18.75,0,-18.75],[12,40,14.06,18.75,0,-18.75,[741.88,255,867.5,255]],[40,41,9.38,18.75,0,-18.75,[876.88,337.5,925.62,337.5]],[40,42,-9.38,18.75,0,-18.75],[43,0,-12.5,18.75,0,-18.75,[406.88,52.5,156.56,52.5]],[43,2,12.5,18.75,0,-18.75,[431.88,52.5,737.19,52.5]],[43,10,0,18.75,0,-18.75]],"vp":[20.0,0.0,940.0,570.0]}} Hierarchic Layout obtained with default settingsConceptThe layout algorithm runs in three main phases: - *

- *
    - *
  • - * Layering – The nodes are distributed into layers by means of - * {@link yfiles.hierarchic.HierarchicLayoutCore#layerer}. If the layout orientation is top-to-bottom, the nodes in each layer are arranged horizontally while the layers are - * ordered vertically top-to-bottom. - *
  • - *
  • - * Sequencing – The order of the nodes in each layer is determined such that the number of edge crossings is as small as possible. To - * specify the sequencing algorithm, use {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer}. - *
  • - *
  • Drawing – The layout algorithm assigns the final coordinates to all nodes and routes the edges.
  • - *
- *

- * Features - *

- *

- * In order to customize this layout algorithm, modify the {@link yfiles.hierarchic.HierarchicLayoutCore#layerer Layerer}, {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer Sequencer}, {@link yfiles.hierarchic.HierarchicLayoutCore#portAllocator PortAllocator}, {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator DrawingDistanceCalculator}, - * and {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer NodePlacer} instances. - *

- *

- * This layout algorithm is able to incrementally add new elements to an existing drawing of a graph. In order to add - * elements incrementally, register a {@link yfiles.algorithms.IDataProvider} with the graph using the {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY} - * DataProvider key and associate the hints obtained from the {@link yfiles.hierarchic.IIncrementalHintsFactory} with the elements - * to be added incrementally. - *

- *

- * {@link yfiles.hierarchic.NodeLayoutDescriptor} and {@link yfiles.hierarchic.EdgeLayoutDescriptor} instances can be used for specifying - * individual information (e.g. distances or routing styles) for each node and edge in the graph. The descriptors are bound - * to the graph using {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY} - * or {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- *

- * {@link yfiles.hierarchic.HierarchicLayoutCore} supports two approaches to connect edges on a specific side or even an exact - * location to a node. {@link yfiles.layout.PortConstraint}s define a single constraint for the ports of an edge. To realize more - * complex port restrictions, several {@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortCandidateSet}s can be assigned to - * edges or nodes. If an edge with registered {@link yfiles.layout.PortCandidate}s connects to nodes with - * {@link yfiles.layout.PortCandidateSet}s, the layouter will try to match both collections to find an appropriate port. In case - * there is no matching port candidate, a {@link yfiles.layout.PortCandidate} specified for the edge is preferred. Since their - * simultaneous existence at the same node may be ambiguous, it is not recommended to use a combination of - * {@link yfiles.layout.PortConstraint}s and {@link yfiles.layout.PortCandidate}s in the same layout. - *

- *

- * This algorithm specifies a {@link yfiles.layout.LabelLayoutTranslator} instance as the current {@link yfiles.layout.MultiStageLayout#labeling} and configures it such that the - * node labels are passed to it by setting {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} to true. - *

- *

- * In order to enable integrated edge labeling of this algorithm, make sure {@link yfiles.layout.LabelLayoutTranslator} is - * registered and edge labels are being translated and written back after the layout. - *

- *

- * Moreover, this algorithm supports layer and sequence constraints. These constraints can be specified using a {@link yfiles.hierarchic.ILayerConstraintFactory} - * and {@link yfiles.hierarchic.ISequenceConstraintFactory}, respectively. - *

- * @see yfiles.hierarchic.HierarchicLayout - * @see yfiles.hierarchic.ILayerer - * @see yfiles.hierarchic.ISequencer - * @see yfiles.hierarchic.IPortAllocator - * @see yfiles.hierarchic.IDrawingDistanceCalculator - * @see yfiles.hierarchic.INodePlacer - * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface HierarchicLayoutCore extends yfiles.layout.MultiStageLayout{} - export class HierarchicLayoutCore { - /** - * Creates a new {@link yfiles.hierarchic.HierarchicLayoutCore} instance with the default settings. - * @see yfiles.hierarchic.HierarchicLayoutCore#createLayerer - * @see yfiles.hierarchic.HierarchicLayoutCore#createIncrementalLayerer - * @see yfiles.hierarchic.HierarchicLayoutCore#createSequencer - * @see yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator - * @see yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer - */ - constructor(); - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator} if the given {@link yfiles.hierarchic.IDrawingDistanceCalculator} - * instance is null. - *

- * The default implementation returns a {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} instance. It may be overridden - * to return a custom {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator - * @protected - */ - createDrawingDistanceCalculator():yfiles.hierarchic.IDrawingDistanceCalculator; - /** - * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and reates an appropriate {@link yfiles.hierarchic.IEdgeReverser} - * implementation. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.IEdgeReverser} is returned. It may be overridden to - * return a custom {@link yfiles.hierarchic.IEdgeReverser} implementation. - *

- * @returns an implementation - * @protected - */ - createEdgeReverser():yfiles.hierarchic.IEdgeReverser; - /** - * Factory method that is called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates a {@link yfiles.layout.GroupingSupport} - * instance in case of a grouped graph. - * @param graph the input graph - * @returns a {@link } instance or null if the graph is not grouped - * @protected - */ - createGrouping(graph:yfiles.layout.LayoutGraph):yfiles.layout.GroupingSupport; - /** - * Creates an {@link yfiles.hierarchic.IIncrementalHintsFactory} implementation used for obtaining hint objects associated with - * nodes and edges of the graph prior to the invocation of the layout algorithm. - *

- * Incremental hints can be obtained from a {@link yfiles.algorithms.IDataProvider} that is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. - *

- * @returns an {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY - */ - createIncrementalHintsFactory():yfiles.hierarchic.IIncrementalHintsFactory; - /** - * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates an appropriate {@link yfiles.hierarchic.ILayerer} - * implementation. - *

- * By default, a {@link yfiles.hierarchic.ConstraintIncrementalLayerer} instance with a {@link yfiles.hierarchic.TopologicalLayerer} - * instance as argument is returned. This method may be overridden to return a custom {@link yfiles.hierarchic.ILayerer} - * implementation. - *

- * @returns a {@link } implementation - * @protected - */ - createIncrementalLayerer():yfiles.hierarchic.ILayerer; - /** - * Callback method that is called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore}, creates the {@link yfiles.hierarchic.INodeData} - * and {@link yfiles.hierarchic.IEdgeData} instances and binds them to the elements using the given {@link yfiles.hierarchic.IItemFactory itemFactory}. - * @param g the input graph - * @param itemFactory the given {@link } instance - * @protected - */ - createItemData(g:yfiles.layout.LayoutGraph,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Creates a {@link yfiles.hierarchic.ILayerConstraintFactory layer constraint factory} that allows to create hints that affect the assignment of the nodes to layers. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.ILayerConstraintFactory} is returned. - *

- * @param graph the given graph - * @returns a {@link } instance - */ - createLayerConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ILayerConstraintFactory; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#layerer} if no {@link yfiles.hierarchic.ILayerer} instance is given as input. - *

- * The default implementation returns a new MultiComponentLayerer(new WeightedLayerer()) instance. It may be overridden to - * return a custom {@link yfiles.hierarchic.ILayerer} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#layerer - * @see yfiles.hierarchic.MultiComponentLayerer - * @see yfiles.hierarchic.WeightedLayerer - * @protected - */ - createLayerer():yfiles.hierarchic.ILayerer; - /** - * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates an appropriate {@link yfiles.hierarchic.ILayers} - * implementation using the given {@link yfiles.hierarchic.ILayoutDataProvider} instance. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.ILayers} is returned. It may be overridden to return - * custom implementations of the {@link yfiles.hierarchic.ILayers} interface. - *

- * @param ldp the given {@link } instance - * @returns a {@link } implementation - * @protected - */ - createLayers(ldp:yfiles.hierarchic.ILayoutDataProvider):yfiles.hierarchic.ILayers; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer} if the given {@link yfiles.hierarchic.INodePlacer} instance is null. - *

- * The default implementation returns a {@link yfiles.hierarchic.SimplexNodePlacer} instance. It may be overridden to return a - * custom {@link yfiles.hierarchic.INodePlacer} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#nodePlacer - * @see yfiles.hierarchic.SimplexNodePlacer - * @protected - */ - createNodePlacer():yfiles.hierarchic.INodePlacer; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#portAllocator} if the given {@link yfiles.hierarchic.IPortAllocator} instance is - * null. - *

- * The default implementation returns a {@link yfiles.hierarchic.DefaultPortAllocator} instance. It may be overridden to return a - * custom {@link yfiles.hierarchic.IPortAllocator} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#portAllocator - * @protected - */ - createPortAllocator():yfiles.hierarchic.IPortAllocator; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} if the given {@link yfiles.hierarchic.IPortConstraintOptimizer} - * instance is null. - *

- * The default implementation returns null. It may be overridden to return a custom {@link yfiles.hierarchic.IPortConstraintOptimizer} - * instance. - *

- * @returns null - * @see yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer - * @protected - */ - createPortConstraintOptimizer():yfiles.hierarchic.IPortConstraintOptimizer; - /** - * Creates sequence constraints that affect the sequence of the nodes within each layer. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.ISequenceConstraintFactory} is returned. - *

- * @param graph the given graph - * @returns a {@link } instance - */ - createSequenceConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ISequenceConstraintFactory; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer} if the given {@link yfiles.hierarchic.ISequencer} instance is null. - *

- * The default implementation returns a {@link yfiles.hierarchic.DefaultLayerSequencer} instance. It may be overridden to return a - * custom {@link yfiles.hierarchic.ISequencer} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#sequencer - * @see yfiles.hierarchic.DefaultLayerSequencer - * @protected - */ - createSequencer():yfiles.hierarchic.ISequencer; - /** - * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates a {@link yfiles.hierarchic.ISequencer} - * implementation that can sequence subgraphs incrementally. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.ISequencer} is returned. It may be overridden to - * return custom implementations of the {@link yfiles.hierarchic.ISequencer} interface. - *

- * @returns a {@link } implementation - * @protected - */ - createSubgraphLayerSequencer():yfiles.hierarchic.ISequencer; - /** - * Provides access to implementation specific properties of the algorithms used. - *

- * Used for internal purposes. - *

- * @param key the key to a property - * @returns the associated value or null - * @see yfiles.hierarchic.HierarchicLayoutCore#setAlgorithmProperty - */ - getAlgorithmProperty(key:any):any; - /** - * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} - * that holds the {@link yfiles.hierarchic.EdgeLayoutDescriptor} information. - *

- * The {@link yfiles.algorithms.IDataProvider} holding the information about the node layout is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- * @param graph the input graph - * @returns a {@link } instance or null - * @see yfiles.hierarchic.EdgeLayoutDescriptor - * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @protected - */ - getEdgeLayoutDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} - * that holds the incremental hints information. - *

- * The {@link yfiles.algorithms.IDataProvider} holding the information about incremental hints is registered with the graph using - * key {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. - *

- * @param graph the input graph - * @returns a {@link } instance or null - * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY - * @protected - */ - getIncrementalHints(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} - * that holds the {@link yfiles.hierarchic.NodeLayoutDescriptor} information. - *

- * The {@link yfiles.algorithms.IDataProvider} holding the information about the node layout is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- * @param graph the input graph - * @returns a {@link } instance or null - * @see yfiles.hierarchic.NodeLayoutDescriptor - * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY - * @protected - */ - getNodeLayoutDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} - * that holds the {@link yfiles.hierarchic.SwimlaneDescriptor} information. - *

- * The {@link yfiles.algorithms.IDataProvider} holding the information about swimlanes is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY}. - *

- * @param graph the input graph - * @returns a {@link } instance or null - * @see yfiles.hierarchic.SwimlaneDescriptor - * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY - * @protected - */ - getSwimLaneDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Callback method that publishes the layering information. - *

- * The layering information is stored in a {@link yfiles.algorithms.IDataProvider} registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY}. - *

- * @param graph the input graph - * @param layers the {@link } implementation that provides the layering information - * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY - * @protected - */ - publishLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers):void; - /** - * Callback method that publishes the sequencing information. - *

- * The sequencing information is stored in a {@link yfiles.algorithms.IDataProvider} registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#SEQUENCE_INDEX_DP_KEY}. - *

- * @param graph the input graph - * @param layers the {@link } implementation that provides the layering information - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY - * @protected - */ - publishSequences(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Removes the bends which are obviously not necessary. - *

- * By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on - * a line with its preceding and succeeding bend point. It may be overridden for a custom implementation of bend removal. - *

- * @param graph the input graph - * @param bendReductionThreshold this method removes a bend, if its horizontal/vertical distance to the closest collinear bend is above this value - * @protected - */ - reduceBendCount(graph:yfiles.layout.LayoutGraph,bendReductionThreshold:number):void; - /** - * Removes the bends which are obviously not necessary. - *

- * By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on - * a line with its preceding and succeeding bend point. It may be overridden for a custom implementation of bend removal. - *

- * @param graph the input graph - * @protected - */ - reduceBendCount(graph:yfiles.layout.LayoutGraph):void; - /** - * Provides access to implementation specific properties of the algorithms used. - *

- * Used for internal purposes. - *

- * @param key the key to a property - * @param value the value to associate with the key - * @see yfiles.hierarchic.HierarchicLayoutCore#setAlgorithmProperty - */ - setAlgorithmProperty(key:any,value:any):void; - /** - * Data provider key for specifying incremental hints - *

- * Incremental hints are created using an {@link yfiles.hierarchic.HierarchicLayoutCore#createIncrementalHintsFactory incremental hints factory}. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY - * @see yfiles.hierarchic.IIncrementalHintsFactory - * @const - * @static - * @type {yfiles.algorithms.GraphObjectDpKey.} - */ - static INCREMENTAL_HINTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey; - /** - * Data provider key for providing layout information for each edge - * @see yfiles.hierarchic.IEdgeData#edgeLayoutDescriptor - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for providing layout information for each node - * @see yfiles.hierarchic.INodeData#nodeLayoutDescriptor - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for providing information about swimlanes - *

- * If this key is present during the layout, the layout algorithm will arrange nodes in swimlanes. The information about - * the swimlanes is finally written back to the descriptor instances. - *

- *

- * Instances can be shared among multiple nodes in the same lane, but don't have to be shared. - *

- * @see yfiles.hierarchic.SwimlaneDescriptor - * @see yfiles.hierarchic.INodeData#swimLaneDescriptor - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SWIMLANE_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data acceptor key for publishing the layer IDs for all nodes in the graph - * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LAYER_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data acceptor key for publishing the index inside their layer for all nodes in the graph - * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SEQUENCE_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for internal use only - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static INCREMENTAL_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Factory method called during the initialization of this {@link yfiles.hierarchic.HierarchicLayoutCore} instance that creates a - * {@link yfiles.layout.MultiStageLayout#labeling label layouter}. - *

- * In order to use the integrated node label awareness feature one has to use a {@link yfiles.layout.LabelLayoutTranslator} - * instance and set {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} to true. Likewise, in order to make use of the integrated edge labeling {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} must be set to true and also - * {@link yfiles.layout.LabelLayoutTranslator#writeBackEdgeLabels} must be set to true (which is the default). - *

- * @protected - * @type {yfiles.layout.ILayoutStage} - */ - createLabelLayout:yfiles.layout.ILayoutStage; - /** - * Gets or sets whether or not the {@link yfiles.layout.ComponentLayout} should be enabled. - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Gets or sets the time limit (in milliseconds) set for the layout algorithm. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance responsible for generating the layer assignment (first phase of the - * layout algorithm). - *

- * To set the default layerer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createLayerer}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createLayerer - * @type {yfiles.hierarchic.ILayerer} - */ - layerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance responsible for calculating the sequence of nodes within each - * layer (second phase of the layout algorithm). - *

- * To set the default sequencer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createSequencer}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ISequencer} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createSequencer - * @type {yfiles.hierarchic.ISequencer} - */ - sequencer:yfiles.hierarchic.ISequencer; - /** - * Gets or sets the {@link yfiles.hierarchic.INodePlacer} instance responsible for the assignment of the x-(sequence) and - * preliminary y-coordinates of the nodes. - *

- * To set the default node placer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.INodePlacer} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer - * @type {yfiles.hierarchic.INodePlacer} - */ - nodePlacer:yfiles.hierarchic.INodePlacer; - /** - * Gets or sets the {@link yfiles.hierarchic.IPortAllocator} instance responsible for assigning port coordinates to the adjacent - * edges of each node. - *

- * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createPortAllocator}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.IPortAllocator} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createPortAllocator - * @type {yfiles.hierarchic.IPortAllocator} - */ - portAllocator:yfiles.hierarchic.IPortAllocator; - /** - * Gets or sets the {@link yfiles.hierarchic.IPortConstraintOptimizer} instance responsible for optimizing the assignment of port - * constraints to the adjacent edges of each node. - *

- * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createPortConstraintOptimizer}. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#createPortConstraintOptimizer - * @type {yfiles.hierarchic.IPortConstraintOptimizer} - */ - portConstraintOptimizer:yfiles.hierarchic.IPortConstraintOptimizer; - /** - * Gets or sets the {@link yfiles.hierarchic.IDrawingDistanceCalculator} instance responsible for determining the minimum distances - * between elements that belong to the same layer. - *

- * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.IDrawingDistanceCalculator} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator - * @type {yfiles.hierarchic.IDrawingDistanceCalculator} - */ - drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator; - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * When the spacing is negative or zero, no grid is defined, otherwise nodes and edges are placed on multiples of the grid - * spacing. - *

- * @see yfiles.hierarchic.IIncrementalHintsFactory - * @type {number} - */ - gridSpacing:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.HierarchicLayoutCore; - } - /** - * This interface determines the minimum distances between elements that belong to the same layer. - *

- * {@link yfiles.hierarchic.IDrawingDistanceCalculator} is implemented by a helper class used by {@link yfiles.hierarchic.HierarchicLayoutCore} - * during the phase of node placement (i.e. when the final coordinates for all nodes are calculated). {@link yfiles.hierarchic.INodePlacer} - * uses instances of this interface to determine the minimum distances between elements that belong to the same layer. - *

- *

- * Information about graph elements (i.e. nodes or edges) is given using a {@link yfiles.hierarchic.ILayoutDataProvider} while - * information about layers is given through {@link yfiles.hierarchic.ILayer} (describes a single layer of the hierarchic layout) - * or {@link yfiles.hierarchic.ILayers} (manages multiple {@link yfiles.hierarchic.ILayer layers} of the hierarchic layout). - *

- *

- * Implementations not needed any more should be {@link yfiles.hierarchic.IDrawingDistanceCalculator#dispose disposed of}. - *

- *

- * The default implementation used by the {@link yfiles.hierarchic.HierarchicLayoutCore} is - * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator}. - *

- * @interface - */ - export interface IDrawingDistanceCalculator extends yfiles.lang.Object{ - /** - * Disposes of internal data structures. - *

- * Implementations should release internally held data structures when they are not needed any more. - *

- * @param graph the input graph that contains all elements that are used during the node placement - * @param layers the {@link } object that will be used during subsequent calls - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @see yfiles.hierarchic.IDrawingDistanceCalculator#initialize - * @abstract - */ - dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Main interface method called by {@link yfiles.hierarchic.INodePlacer} instances to determine the minimum distance between - * {@link yfiles.algorithms.Node}s of same layer. - * @param graph the input graph - * @param layer the {@link } object that will be used during subsequent calls - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param left the left of the two {@link }s whose minimum distance is to be determined or null if only the left border - * of the right {@link } is of interest - * @param right the right of the two {@link }s whose minimum distance is to be determined or null if only the right border - * of the left {@link } is of interest - * @returns the minimum distance between two {@link }s of the same layer - * @abstract - */ - getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; - /** - * Initializes internal data structures. - *

- * Implementations may cache lengthy calculations in the initialization phase. - *

- * @param graph the input graph that contains all elements that are used during the node placement - * @param layers the {@link } object that will be used during subsequent calls - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @see yfiles.hierarchic.IDrawingDistanceCalculator#dispose - * @abstract - */ - initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - } - var IDrawingDistanceCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IDrawingDistanceCalculator; - }; - /** - * This interface provides layout information about the edges of the graph during the layout. - *

- * {@link yfiles.hierarchic.IEdgeData} is a multi-purpose edge descriptor for each edge, holding information about the {@link yfiles.hierarchic.IEdgeData#type type} of an - * edge, associated {@link yfiles.layout.PortConstraint port constraints}, {@link yfiles.layout.PortCandidate port candidates}, edge groups as well as the current edge state. - *

- *

- * It is used in all phases of the {@link yfiles.hierarchic.HierarchicLayoutCore} to store edge information. - *

- * @interface - */ - export interface IEdgeData extends yfiles.lang.Object{ - /** - * Gets the type of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. - * @abstract - * @type {yfiles.hierarchic.EdgeDataType} - */ - type:yfiles.hierarchic.EdgeDataType; - /** - * Gets the {@link yfiles.algorithms.Node} associated with this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * If no {@link yfiles.algorithms.Node} is associated with this {@link yfiles.hierarchic.IEdgeData} instance, null should be returned. - *

- * @abstract - * @type {yfiles.algorithms.Node} - */ - associatedNode:yfiles.algorithms.Node; - /** - * Gets the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * If no {@link yfiles.algorithms.Edge} is associated with this {@link yfiles.hierarchic.IEdgeData} instance, null should be returned. - *

- * @abstract - * @type {yfiles.algorithms.Edge} - */ - associatedEdge:yfiles.algorithms.Edge; - /** - * Gets the {@link yfiles.layout.PortConstraint port constraints} for the source port of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance. - *

- * {@link yfiles.layout.PortConstraint}s are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. - *

- * @abstract - * @type {yfiles.layout.PortConstraint} - */ - sourcePortConstraint:yfiles.layout.PortConstraint; - /** - * Gets the ID of the edge port group at the source node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance belongs (if any). - *

- * Information about edge port grouping at the source node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with - * the graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_GROUP_ID_DP_KEY}. - *

- * @abstract - * @type {any} - */ - sourcePortGroup:any; - /** - * Gets the {@link yfiles.collections.ICollection. collection} of {@link yfiles.layout.PortCandidate}s for the source port of the {@link yfiles.algorithms.Edge} associated with - * this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * {@link yfiles.layout.PortCandidate Source port candidates} are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY}. - *

- * @abstract - * @type {yfiles.collections.ICollection.} - */ - sourcePortCandidates:yfiles.collections.ICollection; - /** - * Gets the {@link yfiles.layout.PortConstraint port constraints} for the target port of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance. - *

- * {@link yfiles.layout.PortConstraint}s are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}. - *

- * @abstract - * @type {yfiles.layout.PortConstraint} - */ - targetPortConstraint:yfiles.layout.PortConstraint; - /** - * Gets the ID of the edge port group at the target node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance belongs (if any). - *

- * Information about edge port grouping at the target node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with - * the graph with key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_GROUP_ID_DP_KEY}. - *

- * @abstract - * @type {any} - */ - targetPortGroup:any; - /** - * Gets the {@link yfiles.collections.ICollection. collection} of {@link yfiles.layout.PortCandidate}s for the target port of the {@link yfiles.algorithms.Edge} associated with - * this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * {@link yfiles.layout.PortCandidate Target port candidates} are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY}. - *

- * @abstract - * @type {yfiles.collections.ICollection.} - */ - targetPortCandidates:yfiles.collections.ICollection; - /** - * Gets the ID of the edge group at the source node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance belongs (if any). - *

- * Information about edge grouping at the source node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY}. - *

- * @abstract - * @type {any} - */ - sourceGroup:any; - /** - * Gets the ID of the edge group at the target node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance belongs (if any). - *

- * Information about edge grouping at the target node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with key {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. - *

- * @abstract - * @type {any} - */ - targetGroup:any; - /** - * Gets the group that is represented by the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance. - * @abstract - * @type {any} - */ - group:any; - /** - * Gets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance has been - * reversed. - * @abstract - * @type {boolean} - */ - reversed:boolean; - /** - * Gets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance is an upper - * same-layer edge. - *

- * An upper same-layer edge is an edge connecting two nodes of the same layer with polyline segments (not directly, with a - * straight-line) and is routed above the layer. - *

- * @abstract - * @type {boolean} - */ - upperSameLayerEdge:boolean; - /** - * Gets the {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance bound to the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance. - *

- * If no {@link yfiles.hierarchic.EdgeLayoutDescriptor} is bound to the edge, null should be returned. - *

- * @abstract - * @type {yfiles.hierarchic.EdgeLayoutDescriptor} - */ - edgeLayoutDescriptor:yfiles.hierarchic.EdgeLayoutDescriptor; - /** - * Gets or sets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance should - * be an upper same-layer edge (if it is a same-layer edge). - *

- * An upper same-layer edge is an edge connecting two nodes of the same layer with polyline segments (not directly, with a - * straight-line) and is routed above the layer. - *

- *

- * If enabled the edge will be routed above the layer, otherwise below it. - *

- * @abstract - * @type {boolean} - */ - fallbackUpperSameLayerEdge:boolean; - /** - * Gets the thickness of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * The thickness is considered when calculating minimum distances so that there are no overlaps between edges and other - * graph elements. - *

- *

- * The thickness must have a non-negative value. - *

- * @abstract - * @type {number} - */ - thickness:number; - } - var IEdgeData:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IEdgeData; - }; - /** - * This interface handles edges that should be reversed during the hierarchic layout process. - *

- * {@link yfiles.hierarchic.IEdgeReverser} contains methods for reversing all (or a given edge) that point to the wrong direction, - * i.e. the layer indices of the source nodes are greater than the layer indices of the target nodes. It also provides - * methods to restore the edges that have been reversed at the end of the layout algorithm. - *

- *

- * Implementations of this interface perform operations after the layering phase of the hierarchic layout algorithm. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore - * @interface - */ - export interface IEdgeReverser extends yfiles.lang.Object{ - /** - * Reverses all edges which point to the wrong direction. - *

- * It is called after the layering phase of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. - *

- *

- * An edge is reversed if the layer index of its source node is greater than the layer index of its target node. - *

- * @param graph the input graph - * @param ldp the {@link } containing layering information about the nodes and edges of the graph - * @see yfiles.hierarchic.ILayoutDataProvider#getNodeData - * @see yfiles.hierarchic.INodeData#layer - * @abstract - */ - normalizeEdges(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Restores the original direction of edges marked as reversed. - *

- * It is called at the end of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. - *

- * @param graph the input graph - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @abstract - */ - restoreEdgeDirections(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Reverses a given edge which points to the wrong direction. - *

- * It may be called by the incremental parts of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. - *

- * @param graph the input graph - * @param ldp the {@link } containing layering information about the nodes and edges of the graph - * @param edge the edge to be reversed - * @see yfiles.hierarchic.ILayoutDataProvider#getNodeData - * @see yfiles.hierarchic.INodeData#layer - * @abstract - */ - reverse(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,edge:yfiles.algorithms.Edge):void; - } - var IEdgeReverser:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IEdgeReverser; - }; - /** - * This interface provides factory methods for creating incremental hints for the hierarchic layout. - *

- * Incremental hints can be used for specifying that a subset of nodes (called incremental nodes) should be added to an existing graph - * layout. A layer hint specifies that both, a node's layer and its position within the layer should be freely determined - * by the algorithm. A sequence hint specifies that the algorithm should consider the current layer of a node while its - * position within the layer should be freely determined by the algorithm. A node without any hint is called a fixed node. - *

- *

- * Sequence hints can also be specified for edges. These incremental edges are inserted in a suitable position within the layers - * crossed by the edges. For fixed edges the given input route is considered to calculate the position with the layers. - *

- *

- * Information about incremental hints is provided by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY}. - *

- *

- * An instance of a class implementing this interface can be obtained through method - * {@link yfiles.hierarchic.HierarchicLayout#createIncrementalHintsFactory}. - *

- * @interface - */ - export interface IIncrementalHintsFactory extends yfiles.lang.Object{ - /** - * Creates a hint {@link any} for a group {@link yfiles.algorithms.Node} that should be inserted incrementally during the layering phase. - *

- * The group will be placed on a suitable position. The descendants of the group may be associated with hints created by - * methods {@link yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint}, {@link yfiles.hierarchic.IIncrementalHintsFactory#createSequenceIncrementallyHint} - * or this method (if the descendant is an inner group). - *

- *

- * All hints of the descendants of a group are interpreted relative to the group node. Descendants without hints maintain - * their relative order within the group node (but not with elements outside the group). - *

- *

- * The positions of groups without incremental hints depend on the position of their descendants (i.e., the group is not - * interpreted as fixed - it is simply ignored). - *

- * @param forItemId the group node to be inserted incrementally - * @returns an {@link } that can be interpreted as a hint by {@link } - * @abstract - */ - createIncrementalGroupHint(forItemId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} that should be inserted incrementally during the layering phase. - *

- * This will place the node in a suitable layer, possibly creating new layers. - *

- *

- * Neighbors of this node may be also marked such that they are laid out incrementally. This makes it possible to - * incrementally add whole subgraphs to the current layout. - *

- * @param forNodeId the node to be layered and sequenced incrementally - * @returns an {@link } that can be interpreted as a hint by {@link } - * @abstract - */ - createLayerIncrementallyHint(forNodeId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} that should be inserted incrementally during the - * sequencing phase. - *

- * All nodes that are not incrementally inserted during the layering phase (see - * {@link yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint}) stay in their current layer. More precisely, - * the default {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer} implementation is an instance of {@link yfiles.hierarchic.AsIsLayerer} that determines the layer of the "fixed" - * nodes by analyzing the current node coordinates. Note that for the other nodes, the layout algorithm may insert new - * layers in between the existing layers. - *

- *

- * For edges associated with this hint (or which are incident to an incremental node), the algorithm automatically - * calculates a suitable sequencing (position within the layer). For edges between two non-incremental nodes that do not - * have a hint, the sequencing phase considers the current route. - *

- * @param forItemId the node or edge to be sequenced/inserted incrementally - * @returns an {@link } that can be interpreted as a hint by {@link } - * @abstract - */ - createSequenceIncrementallyHint(forItemId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current - * position. - *

- * As for nodes without hints, the algorithm uses the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer} instance to determine the layer of such nodes and the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} instance to - * determine the position within the layer. By default, both implementations use the current coordinates of the nodes to - * derive the layer/position. However, for nodes marked with this hint, the algorithm should also preserve the exact - * coordinates while for nodes without hints the coordinates may be changed (these nodes only keep their relative - * positions). - *

- * @param forNodeId the node to be placed on its exact current position - * @returns an {@link } that can be interpreted as a hint by {@link } - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint - * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement - * @abstract - */ - createUseExactCoordinatesHint(forNodeId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current - * layer position. - *

- * The algorithm uses the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer} instance to determine the layer of such nodes and the {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer} instance to determine the sequencing. - *

- * @param forNodeId the node to be placed on its exact current layer position - * @returns an {@link } that can be interpreted as a hint by {@link } - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactCoordinatesHint - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint - * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement - * @abstract - */ - createUseExactLayerCoordinatesHint(forNodeId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current - * sequence position. - *

- * The algorithm uses the {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer} instance to determine the layer of such nodes and the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} instance to determine the sequencing. - *

- * @param forNodeId the node to be placed on its exact current sequence position - * @returns an {@link } that can be interpreted as a hint by {@link } - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactCoordinatesHint - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint - * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement - * @abstract - */ - createUseExactSequenceCoordinatesHint(forNodeId:any):any; - } - var IIncrementalHintsFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IIncrementalHintsFactory; - }; - /** - * This interface is a factory for creating and destroying helper structures used in the graph during layout. - *

- * An implementation of this interface is provided by the {@link yfiles.hierarchic.HierarchicLayoutCore} during the layout for the - * different sub-modules. - *

- * @interface - */ - export interface IItemFactory extends yfiles.lang.Object{ - /** - * Converts a given {@link yfiles.algorithms.Node} to a label node. - * @param dummyNode the given {@link } to be converted - * @abstract - */ - convertToLabelNode(dummyNode:yfiles.algorithms.Node):void; - /** - * Creates a bend {@link yfiles.algorithms.Node} for the given {@link yfiles.algorithms.Edge} in the given {@link yfiles.hierarchic.ILayer} and - * assigns it to the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance. - * @param layer the given {@link } instance - * @param edge the given {@link } - * @param [laneDescriptor=null] a given {@link } instance - * @returns the new bend {@link } - * @abstract - */ - createBendNode(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; - /** - * Creates a {@link yfiles.hierarchic.INodeData} object for a bend {@link yfiles.algorithms.Node} and associates it with the - * {@link yfiles.algorithms.Node}. - *

- * The bend is assigned to the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance. - *

- * @param node the given {@link } - * @param edge the given {@link } - * @param [laneDescriptor=null] the given {@link } instance - * @returns a {@link } object for the given bend {@link } - * @abstract - */ - createBendNodeData(node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.hierarchic.INodeData; - /** - * Creates a dummy {@link yfiles.algorithms.Node} that mimics a connector to a group {@link yfiles.algorithms.Node}. - * @param groupNode the given group {@link } - * @param groupId the given group ID - * @param layer the given {@link } instance - * @param edge the given {@link } - * @returns the new {@link } - * @abstract - */ - createConnectorProxyForGroup(groupNode:yfiles.algorithms.Node,groupId:any,layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; - /** - * Creates a dummy node that mimics a connector to a group node from a descendant. - * @param groupNode the group node to which the edge is connected - * @param groupId the id of the group node - * @param layer the layer to which the dummy node will be assigned - * @param e the edge that connects to the dummy node - * @returns the dummy node - * @abstract - */ - createContentConnectorProxyForGroup(groupNode:yfiles.algorithms.Node,groupId:any,layer:yfiles.hierarchic.ILayer,e:yfiles.algorithms.Edge):yfiles.algorithms.Node; - /** - * Creates a spacer {@link yfiles.algorithms.Node} for the drawing phase using the given bounds in the given - * {@link yfiles.hierarchic.ILayer}. - * @param layer the given {@link } instance - * @param size the given bounds - * @param edges an array of {@link }s - * @returns the new spacer {@link } - * @abstract - */ - createDistanceNode(layer:yfiles.hierarchic.ILayer,size:yfiles.algorithms.Rectangle2D,edges:yfiles.algorithms.Edge[]):yfiles.algorithms.Node; - /** - * Creates a dummy {@link yfiles.algorithms.Edge} using the given data. - * @param newSource the source node of the {@link } - * @param newTarget the target node of the {@link } - * @param oldEdge the old {@link } from which to retrieve the data - * @param sourceEnd true if the source node of the edge is referred, false otherwise - * @param targetEnd true if the target node of the edge is referred, false otherwise - * @returns a new dummy {@link } - * @abstract - */ - createDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; - /** - * Creates an edge group {@link yfiles.algorithms.Node} in the given {@link yfiles.hierarchic.ILayer}. - * @param layer the given {@link } instance - * @param groupId the ID of the edge group - * @returns the new group {@link } - * @abstract - */ - createEdgeGroupNode(layer:yfiles.hierarchic.ILayer,groupId:any):yfiles.algorithms.Node; - /** - * Creates a {@link yfiles.hierarchic.INodeData} object for an edge group {@link yfiles.algorithms.Node} and associates it with the - * {@link yfiles.algorithms.Node}. - * @param node the given {@link } - * @param groupId the given group ID - * @param source true if the edge group is referred to the source node, false otherwise - * @returns a {@link } object for the given edge group {@link } - * @abstract - */ - createEdgeGroupNodeData(node:yfiles.algorithms.Node,groupId:any,source:boolean):yfiles.hierarchic.INodeData; - /** - * Creates an {@link yfiles.algorithms.Edge} that connects two group border {@link yfiles.algorithms.Node}s. - * @param source the source {@link } - * @param target the target {@link } - * @returns the new {@link } connecting the two group {@link }s - * @abstract - */ - createGroupBorderEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Creates a group boundary {@link yfiles.algorithms.Node} for a group node in the given {@link yfiles.hierarchic.ILayer}. - * @param groupNode the given group {@link } - * @param layer the given {@link } - * @param type one of {@link #GROUP_BEGIN} or {@link #GROUP_END} - * @returns the new group boundary {@link } - * @abstract - */ - createGroupBorderNode(groupNode:yfiles.algorithms.Node,layer:yfiles.hierarchic.ILayer,type:yfiles.hierarchic.NodeDataType):yfiles.algorithms.Node; - /** - * Create a dummy {@link yfiles.algorithms.Node} for a group {@link yfiles.hierarchic.ILayer layer}. - * @returns a new dummy {@link } - * @abstract - */ - createGroupLayerDummyNode():yfiles.algorithms.Node; - /** - * Creates a group node connector {@link yfiles.algorithms.Edge} between two group {@link yfiles.algorithms.Node}s. - * @param groupNode1 the first group node - * @param groupNode2 the first group node - * @param representative the given representative {@link } - * @returns a new connector {@link } between two group {@link }s - * @abstract - */ - createGroupNodeConnectorEdge(groupNode1:yfiles.algorithms.Node,groupNode2:yfiles.algorithms.Node,representative:yfiles.algorithms.Edge):yfiles.algorithms.Edge; - /** - * Creates an {@link yfiles.hierarchic.IEdgeData} object for a normal {@link yfiles.algorithms.Edge} and associates it with the edge. - * @param edge the given {@link } - * @returns an {@link } object for the given {@link } - * @abstract - */ - createNormalEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; - /** - * Creates a {@link yfiles.hierarchic.INodeData} object for a normal {@link yfiles.algorithms.Node} and associates it with the - * {@link yfiles.algorithms.Node}. - * @param node the given {@link } - * @returns a {@link } object for the given {@link } - * @abstract - */ - createNormalNodeData(node:yfiles.algorithms.Node):yfiles.hierarchic.INodeData; - /** - * Creates a proxy {@link yfiles.algorithms.Node} for an {@link yfiles.algorithms.Edge} during the drawing phase, changing the {@link yfiles.algorithms.Edge} - * to end/start at the proxy and assigns it to a {@link yfiles.hierarchic.SwimlaneDescriptor} instance. - * @param edge the given {@link } - * @param source true if the node is the source node of the edge, false otherwise - * @param [laneDescriptor=null] a given {@link } instance - * @returns the new proxy {@link } - * @abstract - */ - createProxyNode(edge:yfiles.algorithms.Edge,source:boolean,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; - /** - * Creates a {@link yfiles.hierarchic.INodeData} object for a proxy {@link yfiles.algorithms.Node} and associates it with the proxy node. - * @param node the given {@link } - * @param proxy the given proxy node - * @param edge the given {@link } - * @returns a {@link } object for the given proxy node - * @abstract - */ - createProxyNodeData(node:yfiles.algorithms.Node,proxy:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):yfiles.hierarchic.INodeData; - /** - * Creates a dummy edge that belongs to a recursive {@link yfiles.algorithms.Edge}. - * @param newSource the source node of the {@link } - * @param newTarget the target node of the {@link } - * @param oldEdge the old {@link } from which to retrieve the data - * @param sourceEnd true if the source node of the edge is referred, false otherwise - * @param targetEnd true if the target node of the edge is referred, false otherwise - * @returns a new dummy {@link } - * @abstract - */ - createRecursiveDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; - /** - * Creates a dummy {@link yfiles.algorithms.Node} that represents a bend node of a recursive {@link yfiles.algorithms.Edge}. - * @param layer the given {@link } to which the dummy {@link } is assigned - * @param edge the given {@link } to which the dummy {@link } belongs - * @param laneDescriptor the given {@link } instance - * @returns the new {@link } - * @abstract - */ - createRecursiveEdgeDummy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,laneDescriptor:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; - /** - * Creates a {@link yfiles.hierarchic.INodeData} for a dummy {@link yfiles.algorithms.Node} of a recursive {@link yfiles.algorithms.Edge}. - * @param node the given {@link } - * @param edge the given {@link } to which the dummy {@link } belongs - * @param laneDescriptor the given {@link } instance - * @returns the new {@link } instance - * @abstract - */ - createRecursiveEdgeNodeData(node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,laneDescriptor:yfiles.hierarchic.SwimlaneDescriptor):yfiles.hierarchic.INodeData; - /** - * Creates an {@link yfiles.hierarchic.IEdgeData} object for a same-layer recursive {@link yfiles.algorithms.Edge} and associates it with - * the edge. - * @param edge the given {@link } - * @param originalEdgeData the {@link } object of the original edge - * @param isUpper true is the recursive edge is an upper same layer edge, false otherwise - * @returns an {@link } object for the recursive same-layer {@link } - * @abstract - */ - createRecursiveSameLayerEdgeData(edge:yfiles.algorithms.Edge,originalEdgeData:yfiles.hierarchic.IEdgeData,isUpper:boolean):yfiles.hierarchic.IEdgeData; - /** - * Creates a redirected {@link yfiles.algorithms.Edge} to replace an {@link yfiles.algorithms.Edge} connected to a group - * {@link yfiles.algorithms.Node}. - * @param newSource the source node of the {@link } - * @param newTarget the target node of the {@link } - * @param groupEdge the given group {@link } - * @returns a new redirected {@link } - * @abstract - */ - createRedirectedGroupEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,groupEdge:yfiles.algorithms.Edge):yfiles.algorithms.Edge; - /** - * Creates a reversed dummy {@link yfiles.algorithms.Edge} using the given data. - * @param newSource the source node of the {@link } - * @param newTarget the target node of the {@link } - * @param oldEdge the old {@link } from which to retrieve the data - * @param sourceEnd true if the source node of the edge is referred, false otherwise - * @param targetEnd true if the target node of the edge is referred, false otherwise - * @returns a new reversed dummy {@link } - * @abstract - */ - createReverseDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; - /** - * Creates an {@link yfiles.hierarchic.IEdgeData} object for a same-layer {@link yfiles.algorithms.Edge} and associates it with the edge. - * @param edge the given {@link } - * @returns an {@link } object for the same-layer {@link } - * @abstract - */ - createSameLayerEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; - /** - * Creates a same-layer {@link yfiles.algorithms.Edge} proxy connecting a newly created proxy {@link yfiles.algorithms.Node} and a given - * proxy {@link yfiles.algorithms.Node} in the given {@link yfiles.hierarchic.ILayer}. - * @param layer the given {@link } - * @param edge the given {@link } - * @param toProxy the given proxy {@link } - * @returns a new redefined same-layer {@link } - * @abstract - */ - createSameLayerProxy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,toProxy:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Creates a proxy {@link yfiles.algorithms.Node} for a same-layer {@link yfiles.algorithms.Edge} during the drawing phase that ends at the - * side of a node. - * @param inLayer the given {@link } instance - * @param forNode the given {@link } - * @param edge the given {@link } - * @param [sld=null] a given {@link } instance - * @returns the new proxy {@link } - * @abstract - */ - createSameLayerSideProxy(inLayer:yfiles.hierarchic.ILayer,forNode:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,sld?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; - /** - * Creates a same-layer switch proxy {@link yfiles.algorithms.Node} (switching between two same-layer - * {@link yfiles.algorithms.Edge}s on two different sides of the layer). - * @param layer the given {@link } - * @param edge the given {@link } - * @returns the new same-layer switch proxy {@link } - * @abstract - */ - createSameLayerSwitchProxy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; - /** - * Creates an {@link yfiles.hierarchic.IEdgeData} object for a self-loop {@link yfiles.algorithms.Edge} and associates it with the edge. - * @param edge the given {@link } - * @returns an {@link } object for a self-loop {@link } - * @abstract - */ - createSelfLoopEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; - /** - * Destroys a spacer {@link yfiles.algorithms.Node} for the drawing phase created using - * {@link yfiles.hierarchic.IItemFactory#createDistanceNode}. - * @param distanceNode the {@link } to be destroyed - * @abstract - */ - destroyDistanceNode(distanceNode:yfiles.algorithms.Node):void; - /** - * Removes the given layer for proxies at groups to handle direct group content connector edges between a node in the - * first/last layer of the group node and the groups border. - * @param layer the layer to destroy - * @param useInEdges whether the incoming edges should be used as the resulting edges - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - * @abstract - */ - destroyGroupConnectorLayer(layer:yfiles.hierarchic.ILayer,useInEdges:boolean):void; - /** - * Destroys a previously created label layer - * @param layer the layer to destroy - * @param useInEdges whether the incoming edges should be used as the resulting edges - * @abstract - */ - destroyLabelNodeLayer(layer:yfiles.hierarchic.ILayer,useInEdges:boolean):void; - /** - * Destroys a proxy {@link yfiles.algorithms.Node} created using {@link yfiles.hierarchic.IItemFactory#createProxyNode} for the drawing - * phase. - * @param proxyNode the proxy {@link } to be destroyed - * @returns - * @abstract - */ - destroyProxyNode(proxyNode:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Destroys a same-layer {@link yfiles.algorithms.Edge} proxy created using {@link yfiles.hierarchic.IItemFactory#createSameLayerProxy}. - * @param edge the {@link } whose proxy will be destroyed - * @returns the redefined {@link } after the removal of the proxy {@link } - * @abstract - */ - destroySameLayerProxy(edge:yfiles.algorithms.Edge):yfiles.algorithms.Edge; - /** - * Destroys a proxy {@link yfiles.algorithms.Node} created using {@link yfiles.hierarchic.IItemFactory#createProxyNode} for the drawing - * phase. - * @param proxyNode the proxy {@link } to be destroyed - * @abstract - */ - destroySameLayerSideProxy(proxyNode:yfiles.algorithms.Node):void; - /** - * Destroys a same-layer switch proxy {@link yfiles.algorithms.Node} created using - * {@link yfiles.hierarchic.IItemFactory#createSameLayerSwitchProxy}. - * @param node the {@link } to be destroyed - * @returns the redefined {@link } after the removal of the same-layer switch proxy {@link } - * @abstract - */ - destroySameLayerSwitchProxy(node:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Inserts a same-layer {@link yfiles.algorithms.Edge} or an {@link yfiles.algorithms.Edge} that may span multiple layers into the data - * structure and returns the resulting list of - * {@link yfiles.algorithms.Edge}s that has been created if this edge spans multiple layers. - * @param edge the given {@link } - * @returns the resulting list of {@link }s that has been created if this edge spans multiple layers - * @abstract - */ - insertEdge(edge:yfiles.algorithms.Edge):yfiles.algorithms.EdgeList; - /** - * Inserts a layer for proxies at groups to handle direct group content connector edges between a node in the first/last - * layer of the group node and the groups border. - * @param top true if this layer is placed above a group nodes, false if placed below - * @param index the index where the layer is inserted - * @returns the new layer - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - * @abstract - */ - insertGroupConnectorLayer(top:boolean,index:number):yfiles.hierarchic.ILayer; - /** - * Inserts a {@link yfiles.hierarchic.ILayer layer} for group {@link yfiles.algorithms.Node}s. - * @param source true if the group refers to the source node of an edge, false otherwise - * @param index the index at which the specified {@link layer} is to be inserted - * @returns a {@link layer} instance - * @abstract - */ - insertGroupNodeLayer(source:boolean,index:number):yfiles.hierarchic.ILayer; - /** - * Inserts a {@link yfiles.hierarchic.ILayer} for labels. - * @param source true if the source node of the edge, false otherwise - * @param index the index at which the specified {@link } is to be inserted - * @returns a {@link layer} instance - * @abstract - */ - insertLabelNodeLayer(source:boolean,index:number):yfiles.hierarchic.ILayer; - /** - * Registers an {@link yfiles.algorithms.Edge} as a same-layer {@link yfiles.algorithms.Edge} appropriately into all data structures. - * @param edge the given {@link } to be registered - * @abstract - */ - registerSameLayerEdge(edge:yfiles.algorithms.Edge):void; - /** - * Converts a same-layer {@link yfiles.algorithms.Edge} to an {@link yfiles.algorithms.Edge} of type - * {@link yfiles.hierarchic.EdgeDataType#DIRECT_SAME_LAYER_EDGE}. - * @param sameLayerEdge the given same-layer {@link } - * @abstract - */ - setDirectlyConnectSameLayerEdge(sameLayerEdge:yfiles.algorithms.Edge):void; - /** - * Specifies an edge group constraint for an {@link yfiles.algorithms.Edge} and assigns it to an {@link yfiles.hierarchic.IEdgeData} - * object. - * @param edge the given {@link } - * @param sgId the ID of the edge group at the source node - * @param tgId the ID of the edge group at the target node - * @returns an {@link } object - * @abstract - */ - setTemporaryEdgeGroups(edge:yfiles.algorithms.Edge,sgId:any,tgId:any):yfiles.hierarchic.IEdgeData; - /** - * Specifies the thickness for an {@link yfiles.algorithms.Edge} and defines it in an {@link yfiles.hierarchic.IEdgeData} object. - * @param edge the given {@link } - * @param thickness the new edge thickness - * @returns an {@link } object with an adjusted {@link } - * @abstract - */ - setTemporaryEdgeThickness(edge:yfiles.algorithms.Edge,thickness:number):yfiles.hierarchic.IEdgeData; - /** - * Specifies a port constraint for an {@link yfiles.algorithms.Edge} at the given side and assigns it to an {@link yfiles.hierarchic.IEdgeData} - * object. - * @param edge the given {@link } - * @param source true of the port constraint is defined on the source node of the {@link }, false otherwise - * @param pc the given {@link } instance - * @returns an {@link } object - * @abstract - */ - setTemporaryPortConstraint(edge:yfiles.algorithms.Edge,source:boolean,pc:yfiles.layout.PortConstraint):yfiles.hierarchic.IEdgeData; - /** - * Reverts a label node to the normal {@link yfiles.algorithms.Node}. - * @param labelNode the given label node to be converted - * @abstract - */ - unconvertToLabelNode(labelNode:yfiles.algorithms.Node):void; - } - var IItemFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IItemFactory; - }; - /** - * This interface describes a single layer in a hierarchic layout. - *

- * A layer consists of nodes along with the associated same-layer edges. Each layer has a {@link yfiles.hierarchic.ILayer#type type} and an index representing - * its order in the {@link yfiles.hierarchic.ILayers list of layers}. - *

- * @see yfiles.hierarchic.ILayers - * @see yfiles.hierarchic.HierarchicLayoutCore - * @see yfiles.hierarchic.ILayerer - * @interface - */ - export interface ILayer extends yfiles.lang.Object{ - /** - * Adds a newly created {@link yfiles.algorithms.Node} to this {@link yfiles.hierarchic.ILayer} instance. - * @param node the {@link } to be added - * @abstract - */ - add(node:yfiles.algorithms.Node):void; - /** - * Adds a same-layer {@link yfiles.algorithms.Edge} to this {@link yfiles.hierarchic.ILayer} instance. - * @param edge the same-layer {@link } to be added - * @abstract - */ - addSameLayerEdge(edge:yfiles.algorithms.Edge):void; - /** - * Removes a {@link yfiles.algorithms.Node} from this {@link yfiles.hierarchic.ILayer} instance. - * @param node the {@link } to be removed - * @abstract - */ - remove(node:yfiles.algorithms.Node):void; - /** - * Removes the current layer from the {@link yfiles.hierarchic.ILayers list of layers}. - * @abstract - */ - remove():void; - /** - * Adjusts the order of the {@link yfiles.algorithms.Node}s of this {@link yfiles.hierarchic.ILayer} instance according to the given - * order. - * @param list the given list to be used - * @abstract - */ - setNodeOrder(list:yfiles.algorithms.YList):void; - /** - * Gets a list of all same-layer {@link yfiles.algorithms.Edge}s associated with this {@link yfiles.hierarchic.ILayer} instance. - * @abstract - * @type {yfiles.algorithms.YList} - */ - sameLayerEdges:yfiles.algorithms.YList; - /** - * Gets a list of the {@link yfiles.algorithms.Node}s associated with this {@link yfiles.hierarchic.ILayer} instance. - * @abstract - * @type {yfiles.algorithms.NodeList} - */ - list:yfiles.algorithms.NodeList; - /** - * Gets the type of this {@link yfiles.hierarchic.ILayer} instance. - * @abstract - * @type {yfiles.hierarchic.LayerType} - */ - type:yfiles.hierarchic.LayerType; - /** - * Gets the index of this {@link yfiles.hierarchic.ILayer} instance in the {@link yfiles.hierarchic.ILayers list of all layers}. - * @abstract - * @type {number} - */ - index:number; - /** - * Gets or sets the {@link yfiles.layout.RowDescriptor} associated with this {@link yfiles.hierarchic.ILayer} instance. - * @abstract - * @type {yfiles.layout.RowDescriptor} - */ - row:yfiles.layout.RowDescriptor; - } - var ILayer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayer; - }; - /** - * This interface merges two {@link yfiles.hierarchic.ILayers} instances whose nodes reside in the same graph. - *

- * Implementations of this interface may provide different strategies for merging. - *

- *

- * {@link yfiles.hierarchic.DefaultLayeredComponentsMerger Default implementations} of this interface are used internally by {@link yfiles.hierarchic.HierarchicLayoutCore} and {@link yfiles.hierarchic.MultiComponentLayerer} - * when e.g. the graph is grouped or it consists of more than one connected component. - *

- * @interface - */ - export interface ILayeredComponentsMerger extends yfiles.lang.Object{ - /** - * Merges two {@link yfiles.hierarchic.ILayers} instances. - *

- * All nodes that belong to the source and target {@link yfiles.hierarchic.ILayers} are part of the graph at the moment of - * invocation. - *

- *

- * The state of the source {@link yfiles.hierarchic.ILayers} instance is discarded after this call and does not need to be updated - * to reflect the changes. The target {@link yfiles.hierarchic.ILayers} instance must be updated accordingly. - *

- * @param graph the graph containing the nodes of source and target {@link } instances - * @param ldp the {@link } used for querying the layer indices - * @param srcLayers the source {@link } instance that will be merged into the target {@link } instance - * @param targetLayers the {@link } instance that will be modified to contain the resulting layering - * @abstract - */ - merge(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,srcLayers:yfiles.hierarchic.ILayers,targetLayers:yfiles.hierarchic.ILayers):void; - } - var ILayeredComponentsMerger:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayeredComponentsMerger; - }; - /** - * This interface is used by classes capable of generating a layer assignment. - *

- * Layer assignment takes place during the first part of the hierarchic layout algorithms. During this phase, each node of - * the graph is assigned to a {@link yfiles.hierarchic.ILayer layer}. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#layerer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer - * @interface - */ - export interface ILayerer extends yfiles.lang.Object{ - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - *

- * In order to create new layers, factory method {@link yfiles.hierarchic.ILayers#insert} has to be used. - *

- *

- * Information about the nodes is provided by a {@link yfiles.hierarchic.ILayoutDataProvider}. However, positional information (see - * {@link yfiles.hierarchic.INodeData#position} and {@link yfiles.hierarchic.INodeData#layer}) is not available during this phase. - *

- * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - * @see yfiles.hierarchic.ILayers#insert - * @see yfiles.hierarchic.ILayer#add - * @abstract - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - } - var ILayerer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayerer; - }; - /** - * This interface manages multiple {@link yfiles.hierarchic.ILayer} instances. - *

- * {@link yfiles.hierarchic.HierarchicLayoutCore} creates instances of this class and passes them to the instances that handle the - * various sub-tasks of the layout process during automatic layout. - *

- *

- * Method {@link yfiles.hierarchic.ILayers#createInstance} can be used as a factory method to obtain temporary {@link yfiles.hierarchic.ILayers} - * instances. - *

- * @see yfiles.hierarchic.ILayer - * @interface - */ - export interface ILayers extends yfiles.lang.Object{ - /** - * Creates a new and empty {@link yfiles.hierarchic.ILayers} instance that can be used on the same graph instance for temporary - * results. - * @returns a new and empty {@link } instance - * @abstract - */ - createInstance():yfiles.hierarchic.ILayers; - /** - * Returns the {@link yfiles.hierarchic.ILayer layer} at the specified position in this {@link yfiles.hierarchic.ILayers list of layers}. - * @param i the zero-based index of the {@link layer} to return - * @returns the {@link layer} at the specified position - * @abstract - */ - getLayer(i:number):yfiles.hierarchic.ILayer; - /** - * Creates, inserts and returns a {@link yfiles.hierarchic.ILayer layer} of a given type associated with this {@link yfiles.hierarchic.ILayers list of layers}. - * @param type one of the predefined layer types as defined in {@link } interface - * @param position the index at which the specified {@link layer} is to be inserted - * @returns a new {@link } instance - * @abstract - */ - insert(type:yfiles.hierarchic.LayerType,position:number):yfiles.hierarchic.ILayer; - /** - * Removes the {@link yfiles.hierarchic.ILayer layer} at the specified position from this {@link yfiles.hierarchic.ILayers list of layers}. - * @param index the zero-based index of the {@link layer} to remove - * @abstract - */ - remove(index:number):void; - /** - * Returns the number of {@link yfiles.hierarchic.ILayer layers} associated with this {@link yfiles.hierarchic.ILayers} instance. - * @returns the number of layers of this {@link } instance - * @abstract - */ - size():number; - } - var ILayers:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayers; - }; - /** - * This interface retrieves {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} instances for elements in the - * current layout graph. - *

- * Instances of this interface are provided by {@link yfiles.hierarchic.HierarchicLayoutCore} for instances implementing sub-tasks - * during the layout. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore - * @interface - */ - export interface ILayoutDataProvider extends yfiles.lang.Object{ - /** - * Returns the {@link yfiles.hierarchic.IEdgeData} instance associated with the given {@link yfiles.algorithms.Edge}. - * @param edge the given edge - * @returns the {@link } instance associated with the edge - * @abstract - */ - getEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; - /** - * Returns the {@link yfiles.hierarchic.INodeData} instance associated with the given {@link yfiles.algorithms.Node}. - * @param node the given node - * @returns the {@link } instance associated with the node - * @abstract - */ - getNodeData(node:yfiles.algorithms.Node):yfiles.hierarchic.INodeData; - } - var ILayoutDataProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayoutDataProvider; - }; - /** - * This interface provides layout information about the nodes of the graph during the layout. - *

- * {@link yfiles.hierarchic.INodeData} is a multi-purpose node descriptor for each node of the graph during the hierarchic layout - * used internally by the algorithm implementations. - *

- *

- * Instances of this interface can be obtained during the layout from instances of the {@link yfiles.hierarchic.ILayoutDataProvider} - * interface. - *

- *

- * {@link yfiles.hierarchic.INodeData} typically carries the {@link yfiles.hierarchic.INodeData#type type} of the node and depending on the type an optional {@link yfiles.hierarchic.INodeData#associatedEdge associated edge} - * and - * {@link yfiles.hierarchic.INodeData#associatedNode associated node}. Optionally, it may carry a geometric description of the borders of the node and descriptors for various - * aspects of the layout. - *

- * @interface - */ - export interface INodeData extends yfiles.lang.Object{ - /** - * Creates, stores and returns a {@link yfiles.algorithms.BorderLine} for the given side or returns the current {@link yfiles.algorithms.BorderLine} - * instance if it already exists. - *

- * Not every {@link yfiles.hierarchic.INodeData#type type} of node supports this operation. {@link yfiles.hierarchic.NodeDataType#NORMAL} supports - * {@link yfiles.algorithms.BorderLine}s. - *

- *

- * Side value must be inside [0,3] interval, where 0 corresponds to the top side, 1 to the right side, 2 to the bottom side - * and 3 to the left side. - *

- * @param side an integer value from [0,3] interval - * @param nodeLayout the {@link } of the current node - * @returns a {@link } instance - * @throws {Stubs.Exceptions.NotSupportedError} if this {@link yfiles.hierarchic.INodeData#type type} of node does not support node borders - * @see yfiles.hierarchic.INodeData#getNormalizedBorderLine - * @abstract - */ - createBorderLine(side:number,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.BorderLine; - /** - * Returns a {@link yfiles.algorithms.BorderLine} for the given side which is treated as if the position of the node is at (0,0). - *

- * Clients may modify this instance but should always reset it to the original position, since this is a shared instance. - *

- *

- * It may return null to indicate that the {@link yfiles.algorithms.BorderLine} can be determined through the {@link yfiles.layout.INodeLayout} - * instance. - *

- *

- * Side value must be inside [0,3] interval, where 0 corresponds to the top side, 1 to the right side, 2 to the bottom side - * and 3 to the left side. - *

- * @param side an integer value from [0,3] interval - * @returns a {@link } instance or null - * @see yfiles.hierarchic.INodeData#createBorderLine - * @abstract - */ - getNormalizedBorderLine(side:number):yfiles.algorithms.BorderLine; - /** - * Returns the number of same-layer edges associated with the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} - * instance. - * @returns the number of same-layer edges associated with the node - * @abstract - */ - sameLayerEdgeCount():number; - /** - * Gets the group node this node belongs to. - * @abstract - * @type {yfiles.algorithms.Node} - */ - groupNode:yfiles.algorithms.Node; - /** - * Gets the first same-layer edge {@link yfiles.algorithms.ListCell} of all same-layer edges or null if there exists no same-layer - * edge. - * @abstract - * @type {yfiles.algorithms.ListCell} - */ - firstSameLayerEdgeCell:yfiles.algorithms.ListCell; - /** - * Gets the type constant for the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance. - * @abstract - * @type {yfiles.hierarchic.NodeDataType} - */ - type:yfiles.hierarchic.NodeDataType; - /** - * Gets the group ID of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance if it is a bus-group node. - * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE - * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE - * @abstract - * @type {any} - */ - groupId:any; - /** - * Gets the associated {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance (in case of e.g. - *

- * back-loop proxy and side proxy). - *

- * @abstract - * @type {yfiles.algorithms.Node} - */ - associatedNode:yfiles.algorithms.Node; - /** - * Gets the associated {@link yfiles.algorithms.Edge} of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance - * (in case of e.g. - *

- * bend or same-layer center node). - *

- * @abstract - * @type {yfiles.algorithms.Edge} - */ - associatedEdge:yfiles.algorithms.Edge; - /** - * Gets the index of the {@link yfiles.hierarchic.ILayer} instance to which the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} - * instance belongs. - * @abstract - * @type {number} - */ - layer:number; - /** - * Gets the current position of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance within its layer. - * @abstract - * @type {number} - */ - position:number; - /** - * Gets the parent group node of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance (if any). - * @abstract - * @type {yfiles.algorithms.Node} - */ - parentGroupNode:yfiles.algorithms.Node; - /** - * Gets the inner layers of the group {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance. - *

- * If this node is of type {@link yfiles.hierarchic.NodeDataType#GROUP}, this method returns the {@link yfiles.hierarchic.ILayers} object - * that describes the layering in the subgraph. - *

- * @abstract - * @type {yfiles.hierarchic.ILayers} - */ - groupLayers:yfiles.hierarchic.ILayers; - /** - * Gets the hint of the incremental mode of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance if this - * node is of type {@link yfiles.hierarchic.NodeDataType#NORMAL}. - *

- * The corresponding hint has been set by a {@link yfiles.algorithms.IDataProvider} using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. - *

- * @abstract - * @type {any} - */ - incrementalHint:any; - /** - * Gets the {@link yfiles.hierarchic.NodeLayoutDescriptor} instance initially bound to the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} - * instance or null if no {@link yfiles.hierarchic.NodeLayoutDescriptor} has been registered. - * @abstract - * @type {yfiles.hierarchic.NodeLayoutDescriptor} - */ - nodeLayoutDescriptor:yfiles.hierarchic.NodeLayoutDescriptor; - /** - * Gets the {@link yfiles.hierarchic.SwimlaneDescriptor} instance initially bound to the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} - * instance or null if no {@link yfiles.hierarchic.SwimlaneDescriptor} has been registered. - * @abstract - * @type {yfiles.hierarchic.SwimlaneDescriptor} - */ - swimLaneDescriptor:yfiles.hierarchic.SwimlaneDescriptor; - } - var INodeData:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.INodeData; - }; - /** - * This interface is responsible for the assignment of the x-(sequence) and preliminary y-coordinates of the nodes in a - * hierarchic layout. - *

- * Implementations of this interface are used during the drawing phase of - * {@link yfiles.hierarchic.HierarchicLayoutCore}. They determine preliminary y-coordinates (which may be adjusted during the final - * edge routing) and the resulting x-coordinates of all elements that are part of the graph during the node placement - * phase. - *

- *

- * The minimum distance between each pair of nodes of the graph is determined by a {@link yfiles.hierarchic.IDrawingDistanceCalculator} - * instance. - *

- *

- * The default implementation used by the {@link yfiles.hierarchic.HierarchicLayoutCore} is {@link yfiles.hierarchic.SimplexNodePlacer}. - * Custom implementations of {@link yfiles.hierarchic.INodePlacer} interface can be used for hierarchic layout algorithms using - * methods {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer} or {@link yfiles.hierarchic.HierarchicLayout#nodePlacer}. - *

- * @see yfiles.hierarchic.SimplexNodePlacer - * @see yfiles.hierarchic.IDrawingDistanceCalculator - * @see yfiles.hierarchic.HierarchicLayoutCore - * @see yfiles.hierarchic.HierarchicLayoutCore#nodePlacer - * @see yfiles.hierarchic.HierarchicLayout#nodePlacer - * @interface - */ - export interface INodePlacer extends yfiles.lang.Object{ - /** - * Assigns preliminary y-coordinates for each layer of a hierarchic layout. - *

- * The distance between two layers will be adjusted later by the edge routing algorithm. This method is responsible for - * assigning the relative positions of the nodes within each layer. - *

- * @param graph the input graph - * @param layoutDataProvider the {@link } containing information about the elements - * @param layers the {@link } instance that will be calculated by this method - * @abstract - */ - assignLayerCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers):void; - /** - * Determines the resulting x-coordinates of a hierarchic layout. - *

- * The minimum distance between each pair of nodes of the graph is determined by a {@link yfiles.hierarchic.IDrawingDistanceCalculator} - * instance. - *

- * @param graph the input graph - * @param layoutDataProvider the {@link } containing information about the elements - * @param layers the {@link } instance that will be calculated by this method - * @param drawingDistanceCalculator the given {@link } instance - * @abstract - */ - assignSequenceCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers,drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator):void; - } - var INodePlacer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.INodePlacer; - }; - /** - * This interface is responsible for assigning port coordinates to the adjacent edges of each node of the graph. - *

- * {@link yfiles.hierarchic.IPortAllocator} is used by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore - * @interface - */ - export interface IPortAllocator extends yfiles.lang.Object{ - /** - * Assigns to each edge of the graph a source port and target port coordinate pair. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. - *

- * @param graph the input graph - * @param layers the given {@link } instance containing the elements in the layering - * @param ldp the {@link } containing layering information about the nodes and edges of the graph - * @param itemFactory the {@link } used temporarily for modifying the graph instance - * @abstract - */ - assignPorts(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - } - var IPortAllocator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IPortAllocator; - }; - /** - * This interface serves as a callback for {@link yfiles.hierarchic.HierarchicLayoutCore} after the layering and sequencing - * phases. - *

- * Implementations of this interface may modify the {@link yfiles.layout.PortConstraint port constraint} information via - * {@link yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint}. - *

- * @interface - */ - export interface IPortConstraintOptimizer extends yfiles.lang.Object{ - /** - * Assigns new temporary port constraints after the layering information has been determined. - * @param graph the input graph - * @param layers the given {@link } instance - * @param ldp the {@link } containing information about the elements - * @param itemFactory the {@link } to set the temporary port constraints with - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @abstract - */ - optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Assigns new temporary port constraints after the sequence of the nodes has been determined. - * @param graph the input graph - * @param layers the given {@link } instance - * @param ldp the {@link } containing information about the elements - * @param itemFactory the {@link } to set the temporary port constraints with - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @abstract - */ - optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - } - var IPortConstraintOptimizer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IPortConstraintOptimizer; - }; - /** - * This interface is used by {@link yfiles.hierarchic.HierarchicLayoutCore} to calculate the order of the nodes within each {@link yfiles.hierarchic.ILayers layer}. - *

- * Implementations are used during the second phase of the hierarchic layout process and can be set using method {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} or {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer}). - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#sequencer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer - * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer - * @interface - */ - export interface ISequencer extends yfiles.lang.Object{ - /** - * Calculates the sequence of the nodes within each {@link yfiles.hierarchic.ILayers layer}. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} during the second phase and finally writes back the - * calculated sequence using the {@link yfiles.hierarchic.ILayer#setNodeOrder} method. - *

- * @param graph the input graph - * @param layers the given {@link } instance containing the elements in the layering - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link } used temporarily for modifying the graph instance - * @abstract - */ - sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - } - var ISequencer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ISequencer; - }; - /** - * This class is a wrapper {@link yfiles.hierarchic.ILayerer} implementation that delegates the actual layering to a delegate - * {@link yfiles.hierarchic.ILayerer}. - *

- * If the graph consists of multiple components, they will be identified and sorted and each of the components will be - * layered separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that they will all be merged using the - * specified {@link yfiles.hierarchic.ILayeredComponentsMerger} instance. - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface MultiComponentLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class MultiComponentLayerer { - /** - * Creates a new instance of {@link yfiles.hierarchic.MultiComponentLayerer} using the given {@link yfiles.hierarchic.ILayeredComponentsMerger} - * and {@link yfiles.collections.IComparer.} instances. - * @param singleComponentLayerer - * @param merger - * @param componentComparer - * @throws {Stubs.Exceptions.ArgumentError} if the given layerer or merger is null - */ - constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer,merger:yfiles.hierarchic.ILayeredComponentsMerger,componentComparer:yfiles.collections.IComparer); - /** - * Creates a new instance of {@link yfiles.hierarchic.MultiComponentLayerer} using the given delegate {@link yfiles.hierarchic.ILayerer}. - *

- * A new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} will be used as merger while no component {@link yfiles.collections.IComparer.} will be - * used. - *

- * @param singleComponentLayerer - * @throws {Stubs.Exceptions.ArgumentError} if the given layerer is null - */ - constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer); - /** - * - * @param graph - * @param layers - * @param ldp - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Sorts an array which consists of - * {@link yfiles.algorithms.NodeList}s each of which contains nodes that belong to the same component. - *

- * It is called during {@link yfiles.hierarchic.MultiComponentLayerer#assignLayers}. - *

- *

- * By default this method uses the {@link yfiles.hierarchic.MultiComponentLayerer#componentComparer ComponentComparator} to sort the list and has no effect if the instance is null. - *

- * @param nodeLists the array of {@link }s each of which containing nodes that belong to the same component - * @param componentIndexProvider the {@link } that returns an object (the component index) for each node (this value can be either - * integer or object) - * @protected - */ - sort(nodeLists:yfiles.algorithms.NodeList[],componentIndexProvider:yfiles.algorithms.IDataProvider):void; - /** - * Gets or sets the delegate {@link yfiles.hierarchic.ILayerer} instance. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null - * @type {yfiles.hierarchic.ILayerer} - */ - singleComponentLayerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets the {@link yfiles.hierarchic.ILayeredComponentsMerger merger} instance. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayeredComponentsMerger} is null - * @type {yfiles.hierarchic.ILayeredComponentsMerger} - */ - merger:yfiles.hierarchic.ILayeredComponentsMerger; - /** - * Gets or sets the component {@link yfiles.collections.IComparer.} instance. - * @type {yfiles.collections.IComparer.} - */ - componentComparer:yfiles.collections.IComparer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.MultiComponentLayerer; - } - /** - * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases to provide the drawing details of - * the nodes of the graph. - *

- * A {@link yfiles.hierarchic.NodeLayoutDescriptor} instance can be specified individually for single nodes using a {@link yfiles.algorithms.IDataProvider} - * that returns a {@link yfiles.hierarchic.NodeLayoutDescriptor} instance for each node of the graph, or null if no {@link yfiles.hierarchic.NodeLayoutDescriptor} - * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph with key - * {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- *

- * This class is designed as a class to allow future additions of new getter methods. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY - * @see yfiles.hierarchic.EdgeLayoutDescriptor - * @class - */ - export interface NodeLayoutDescriptor extends yfiles.lang.Object{} - export class NodeLayoutDescriptor { - /** - * Creates a new instance of a {@link yfiles.hierarchic.NodeLayoutDescriptor} with the default values. - */ - constructor(); - /** - * Returns the port border gap ratio for the port distribution at a given side of the node. - *

- * This ratio determines the gap between a corner of the node and the first assigned port. - *

- *

- * The ratio should be greater than 0. - *

- *

- * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). - *

- *

- * A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of - * the node and the first port is half as wide as the distance between two adjacent ports. - *

- *

- * A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point. - *

- * @param side the zero-based clockwise side index for top-to-bottom layouts (i.e., top is 0) - * @returns the border gap ratio of a given side - * @see yfiles.hierarchic.NodeLayoutDescriptor#portBorderGapRatios - * @see yfiles.hierarchic.NodeLayoutDescriptor#setPortBorderGapRatio - */ - getPortBorderGapRatio(side:number):number; - /** - * Specifies the port border gap ratio for the port distribution at a given side of the node. - *

- * This ratio determines the gap between a corner of the node and the first assigned port. - *

- *

- * The ratio should be greater than 0. - *

- *

- * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). - *

- *

- * A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of - * the node and the first port is half as wide as the distance between two adjacent ports. - *

- *

- * A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point. - *

- * @param side the zero-based clockwise side index for top-to-bottom layouts (i.e., top is 0) - * @param ratio the given ratio - * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative - * @see yfiles.hierarchic.NodeLayoutDescriptor#portBorderGapRatios - */ - setPortBorderGapRatio(side:number,ratio:number):void; - /** - * Sets the port border gap ratio for the port distribution on all sides of the node. - *

- * This ratio determines the gap between a corner of the node and the first assigned port. - *

- *

- * The ratio should be greater than 0. - *

- *

- * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). - *

- *

- * A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of - * the node and the first port is half as wide as the distance between two adjacent ports. - *

- *

- * A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative - * @see yfiles.hierarchic.NodeLayoutDescriptor#setPortBorderGapRatio - * @type {number} - */ - portBorderGapRatios:number; - /** - * Gets or sets the alignment of the {@link yfiles.algorithms.Node node} of this {@link yfiles.hierarchic.NodeLayoutDescriptor} instance within its layer. - *
    - *
  • A value of 0.0d corresponds to top-alignment.
  • - *
  • A value of 0.5d corresponds to center-alignment.
  • - *
  • A value of 1.0d corresponds to bottom-alignment.
  • - *
- *

- * This value should be within [0,1] interval. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the alignment is not within [0.0d .. 1.0d] - * @type {number} - */ - layerAlignment:number; - /** - * Gets or sets the mode that determines how node labels are handled by the algorithm during the layout. - * @throws {Stubs.Exceptions.ArgumentError} if the constant is unknown. - * @see yfiles.hierarchic.HierarchicLayout#considerNodeLabels - * @type {yfiles.hierarchic.NodeLabelMode} - */ - nodeLabelMode:yfiles.hierarchic.NodeLabelMode; - /** - * Gets or sets the minimum height of the layer to which this node is assigned. - *

- * Values should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum height is negative - * @type {number} - */ - minimumLayerHeight:number; - /** - * Gets or sets the preferred minimum distance to obstacles. - *

- * The minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative - * @type {number} - */ - minimumDistance:number; - /** - * Gets or sets a reference point relative to the center of the node which will be placed on a grid coordinate. - * @type {yfiles.algorithms.YPoint} - */ - gridReference:yfiles.algorithms.YPoint; - /** - * Gets or sets the assignment strategy which distributes the ports along the node borders. - * @type {yfiles.hierarchic.PortAssignmentMode} - */ - portAssignment:yfiles.hierarchic.PortAssignmentMode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.NodeLayoutDescriptor; - } - /** - * This class implements a {@link yfiles.layout.ILayoutStage layout stage} that handles a given {@link yfiles.layout.PartitionGrid partition grid} structure. - *

- * Information about the {@link yfiles.layout.PartitionGrid partition grid} structure are held by a {@link yfiles.algorithms.IDataProvider} registered with the graph - * with key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. - *

- * @see yfiles.layout.PartitionGrid - * @see yfiles.hierarchic.HierarchicLayout - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PartitionGridLayoutStage extends yfiles.layout.LayoutStageBase{} - export class PartitionGridLayoutStage { - /** - * Creates a new instance of {@link yfiles.hierarchic.PartitionGridLayoutStage}. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.PartitionGridLayoutStage; - } - /** - * This class is an implementation of the {@link yfiles.hierarchic.IPortConstraintOptimizer} interface that tries to assign the - * edges of the graph to {@link yfiles.layout.PortConstraint ports} considering the specified {@link yfiles.layout.PortCandidate}s. - *

- * Instances of this class can be set using property {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer}. - *

- *

- * This implementation will query for {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys - * {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY}, {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY} - * and {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY}. It will try to assign each edge one of the matching - * {@link yfiles.layout.PortCandidate}s without introducing too many crossings and without violating the {@link yfiles.layout.PortCandidate#cost cost} or {@link yfiles.layout.PortCandidateSet#connectionCount capacity} - * constraints. - *

- * @see yfiles.layout.PortCandidate#cost - * @see yfiles.layout.PortCandidateSet#entries - * @see yfiles.layout.PortCandidateSet#connectionCount - * @class - * @extends {yfiles.hierarchic.PortConstraintOptimizerBase} - */ - export interface PortCandidateOptimizer extends yfiles.hierarchic.PortConstraintOptimizerBase{} - export class PortCandidateOptimizer { - /** - * Creates a new instance of {@link yfiles.hierarchic.PortCandidateOptimizer} with the default settings. - */ - constructor(); - /** - * Returns the data provider that provides the port candidate sets for nodes. - * @param graph The graph that stores the data provider - * @returns - * @protected - */ - getPortCandidateSetDataProvider(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Gets or sets whether or not this implementation uses a deterministic algorithm to assign the - * {@link yfiles.layout.PortCandidate}s. - * @type {boolean} - */ - deterministic:boolean; - /** - * Gets or sets the penalty cost associated with each back-loop. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the penalty cost is negative - * @type {number} - */ - backLoopPenalty:number; - /** - * Gets or sets the penalty cost associated with a crossing that would occur if a given combination of - * {@link yfiles.layout.PortCandidate}s would be chosen. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the crossing penalty is negative - * @type {number} - */ - crossingPenalty:number; - /** - * Gets or sets the penalty cost associated with each edge being assigned to a port which has already reached its - * {@link yfiles.layout.IPortCandidateSetEntry#connections capacity}. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the penalty cost is negative - * @see yfiles.layout.IPortCandidateSetEntry#connections - * @type {number} - */ - overUsagePenalty:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.PortCandidateOptimizer; - } - /** - * This static class provides information about the same-layer structures created by class - * {@link yfiles.hierarchic.PortConstraintOptimizerBase}. - * @class - */ - export interface PortConstraintOptimizerSameLayerData extends yfiles.lang.Object{} - export class PortConstraintOptimizerSameLayerData { - /** - * Creates a new {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance. - */ - constructor(); - /** - * Adds a given dummy {@link yfiles.algorithms.Node} to this {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance and - * associates it with the given original (same-layer) {@link yfiles.algorithms.Edge}. - * @param sameLayerDummy a dummy node - * @param originalEdge the original (same-layer) edge - */ - addDummyNode(sameLayerDummy:yfiles.algorithms.Node,originalEdge:yfiles.algorithms.Edge):void; - /** - * Returns the original (same-layer) edge associated with the given dummy {@link yfiles.algorithms.Node}. - * @param sameLayerDummy a given dummy node - * @returns the original (same-layer) edge associated with the given dummy node - */ - getOriginalEdge(sameLayerDummy:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Gets all dummy nodes of this {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance. - * @type {yfiles.algorithms.NodeList} - */ - dummyNodes:yfiles.algorithms.NodeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.PortConstraintOptimizerSameLayerData; - } - /** - * This class is an abstract implementation of the {@link yfiles.hierarchic.IPortConstraintOptimizer} interface that minimizes the - * effort required to modify the port assignment after the sequencing phase of hierarchic layout algorithm. - *

- * The {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing callback method invoked after sequencing} performs the following three steps: - *

- *
    - *
  1. - * Restores temporarily all same-layer edges which are not currently present in the layout graph at this time of the layout - * algorithm. - *
  2. - *
  3. Invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode the hook} in which the custom port assignment should be done.
  4. - *
  5. Restores the original state of the layout graph by removing the temporary same-layer edges added in Step 1.
  6. - *
- * @class - * @implements {yfiles.hierarchic.IPortConstraintOptimizer} - */ - export interface PortConstraintOptimizerBase extends yfiles.lang.Object,yfiles.hierarchic.IPortConstraintOptimizer{} - export class PortConstraintOptimizerBase { - /** - * Creates a new {@link yfiles.hierarchic.PortConstraintOptimizerBase} instance with default settings. - * @protected - */ - constructor(); - /** - * Inserts a same-layer edge structure for each same-layer edge of the original graph. - * @param graph the input graph - * @param layers the given {@link } instance holding the layering information - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @returns - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @protected - */ - insertSameLayerStructures(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):yfiles.hierarchic.PortConstraintOptimizerSameLayerData; - /** - * Assigns new temporary port constraints after the nodes have been assigned to layers. - *

- * More precisely, it is called after the layering information has been determined. In this phase, it is possible to create - * back-loops by assigning incoming edges to the south (i.e. bottom) side or outgoing edges to the north (i.e. top) side, - * respectively. - *

- * @param graph the input graph - * @param layers the given {@link } instance holding the layering information - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @abstract - */ - optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Assigns new temporary port constraints after the order of the nodes in each layer has been determined. - *

- * More precisely, it is called after the sequence of the nodes has been determined. It {@link yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures inserts the same-layer structures}, - * invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode the hook} in which the custom port assignment should be done, and finally {@link yfiles.hierarchic.PortConstraintOptimizerBase#removeSameLayerStructures restores the original state} of the - * layout graph by removing the temporary edges. - *

- * @param graph the input graph - * @param layers the given {@link } instance holding the layering information - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @see yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures - * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing - * @see yfiles.hierarchic.PortConstraintOptimizerBase#removeSameLayerStructures - */ - optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Assigns new temporary port constraints after the order of the nodes in each layer has been determined. - *

- * More precisely, it is called after the sequence of the nodes has been determined. It invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode} - * for every node of the original layout graph and omits the nodes of the same-layer structures. - *

- *

- * Incoming and outgoing edges are sorted using {@link yfiles.collections.IComparer.} instances which define the preferred ordering of the incoming and outgoing - * edges from left to right. - *

- * @param inEdgeOrder a given {@link } instance for incoming edges - * @param outEdgeOrder a given {@link } instance for outgoing edges - * @param graph the input graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @param layers - * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing - * @protected - */ - optimizeAfterSequencingForAllNodes(inEdgeOrder:yfiles.collections.IComparer,outEdgeOrder:yfiles.collections.IComparer,graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Assigns new temporary port constraints to a given node of the graph after the order of the nodes in each layer has been - * determined. - *

- * More precisely, it is called after the sequence of the nodes has been determined. - *

- *

- * Incoming and outgoing edges are sorted using {@link yfiles.collections.IComparer.} instances which define the preferred ordering of the incoming and outgoing - * edges from left to right. - *

- * @param node the original node to set temporary port constraints - * @param inEdgeOrder a given {@link } instance for incoming edges - * @param outEdgeOrder a given {@link } instance for outgoing edges - * @param graph the input graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing - * @protected - * @abstract - */ - optimizeAfterSequencingForSingleNode(node:yfiles.algorithms.Node,inEdgeOrder:yfiles.collections.IComparer,outEdgeOrder:yfiles.collections.IComparer,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Removes the same-layer edge structure created using - * {@link yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures}. - * @param sameLayerData a given {@link } instance holding the information about the same-layer - * structures. - * @param graph the input graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @protected - */ - removeSameLayerStructures(sameLayerData:yfiles.hierarchic.PortConstraintOptimizerSameLayerData,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Gets or sets the mirror mask that defines which orientations should be mirrored. - *

- * Setting a layout orientation can be considered as rotating the graph by 90, 180 or 270 degrees. Afterwards, the graph - * can be mirrored at the x-axis (for horizontal layout orientations) or y-axis (for vertical layout orientations). Which - * directions are mirrored can be defined by the given mask. - *

- * @see yfiles.layout.OrientationLayout - * @see yfiles.layout.LayoutOrientation - * @type {yfiles.layout.MirrorModes} - */ - mirrorMode:yfiles.layout.MirrorModes; - /** - * Gets or sets the layout orientation. - *

- * This setting is necessary to correctly interpret the values provided by the {@link yfiles.layout.PortCandidate}s since the {@link yfiles.layout.OrientationLayout} - * cannot automatically adjust these values. - *

- * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @type {yfiles.layout.LayoutOrientation} - */ - layoutOrientation:yfiles.layout.LayoutOrientation; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.PortConstraintOptimizerBase; - } - /** - * This class is used by {@link yfiles.hierarchic.EdgeLayoutDescriptor} to specify the routing style for different types of edges. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#routingStyle - * @see yfiles.hierarchic.IEdgeData#type - * @class - */ - export interface RoutingStyle extends yfiles.lang.Object{} - export class RoutingStyle { - /** - * Creates a new {@link yfiles.hierarchic.RoutingStyle} instance with the given routing style for each edge. - * @param routingStyle one of the predefined routing styles - * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - */ - constructor(routingStyle:yfiles.hierarchic.EdgeRoutingStyle); - /** - * Gets or sets the routing style for back-loop edges. - *

- * This style is used for routing U-turns of common edges (i.e., edges that are neither self-loops nor same-layer edges). A - * U-turn is a non-monotonic part of the edge route that is required for reversed edges if option {@link yfiles.hierarchic.HierarchicLayout#backLoopRouting} is enabled or in some - * other scenarios with port constraints/candidates. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - backLoopRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - /** - * Gets or sets the routing style for grouped edges at the common segments. - *

- * More precisely, grouped edges are routed in a bus-style fashion (i.e., the paths of the edges will share a common edge - * segment) and this option allows to specify the routing style at the bus. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - edgeGroupRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - /** - * Gets or sets the default routing style for edges that have no individual routing style. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - defaultEdgeRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - /** - * Gets or sets the routing style for same-layer edges. - *

- * A same-layer edge is an edge whose source/target are assigned to the same layer. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - sameLayerEdgeRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - /** - * Gets or sets the routing style for self-loops. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - selfLoopRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.RoutingStyle; - } - /** - * This class calculates bend points for self-loops routed in orthogonal or octilinear fashion. - *

- * It is used during the layout phase of {@link yfiles.hierarchic.HierarchicLayoutCore}, but can be used as a stand-alone tool. - *

- * @class - */ - export interface SelfLoopCalculator extends yfiles.lang.Object{} - export class SelfLoopCalculator { - /** - * Creates a new instance of {@link yfiles.hierarchic.SelfLoopCalculator} using the given parameters. - * @param minFirstSegmentLength the minimum length of the first and last segment of an orthogonally routed self-loop - * @param minEdgeDistance the minimum distance between a pair of self-loops - */ - constructor(minFirstSegmentLength:number,minEdgeDistance:number); - /** - * Convenience method that calculates a list of self-loops that belong to a given node. - *

- * The current port positions will be used for determining the start and end ports. The {@link yfiles.algorithms.IDataProvider} - * instances hold information about the source/target ports of the edges and can be used for specifying the direction of - * first and last segments. - *

- * @param graph the input graph - * @param node the node whose self-loops will be routed - * @param selfLoops a list of {@link }s that will be routed - * @param spc the {@link } that returns the {@link } object associated with the source - * ports of the edges - * @param tpc the {@link } that returns the {@link } object associated with the target - * ports of the edges - */ - calculateSelfLoops(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,selfLoops:yfiles.algorithms.YList,spc:yfiles.algorithms.IDataProvider,tpc:yfiles.algorithms.IDataProvider):void; - /** - * Calculates all self-loops at the given node of the given input graph. - *

- * The current port positions will be used for determining the start and end ports. The {@link yfiles.algorithms.IDataProvider} - * instances hold information about the source/target ports of the edges and can be used for specifying the direction of - * first and last segments. - *

- * @param graph the input graph - * @param node the node whose self-loops will be routed - * @param spc the {@link } that returns the {@link } object associated with the source - * ports of the edges - * @param tpc the {@link } that returns the {@link } object associated with the target - * ports of the edges - */ - calculateSelfLoops(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,spc:yfiles.algorithms.IDataProvider,tpc:yfiles.algorithms.IDataProvider):void; - /** - * Returns the minimum length between two edges associated with the given edge. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_EDGE_DISTANCE_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns the minimum length between two edges - * @protected - */ - getMinimumDistance(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Returns the minimum length of the first segment of the given edge. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns the minimum length of the first segment of an edge - * @protected - */ - getMinimumFirstSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Returns the minimum length of the last segment of the given edge. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns the minimum length of the last segment of the given edge - * @protected - */ - getMinimumLastSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Returns the minimum distance between two nodes associated with the given node. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_NODE_DISTANCE_DP_KEY}. - *

- * @param graph the input graph - * @param node the given node - * @returns the minimum distance between two nodes - * @protected - */ - getMinimumNodeDistance(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; - /** - * Returns the minimum octilinear segment length of the given edge. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns the minimum octilinear segment length of the given edge - * @protected - */ - getMinimumOctilinearSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Returns whether or not the given edge is octilinear. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#OCTILINEAR_EDGES_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns true if the edge is octilinear, false otherwise - * @protected - */ - isOctilinearEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):boolean; - /** - * Data provider key for defining for each node a minimum distance to the self-loop edges - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static MINIMUM_NODE_DISTANCE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying whether or not an edge is octilinear - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static OCTILINEAR_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the minimum length of the octilinear segments of an octilinear edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the minimum length of the first segment of each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the minimum length of the last segment of each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the minimum distance to the next edge or node side - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static MINIMUM_EDGE_DISTANCE_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.SelfLoopCalculator; - } - /** - * This class is a {@link yfiles.hierarchic.INodePlacer} implementation based on {@link yfiles.algorithms.RankAssignments rank assignment}. - *

- * The drawer works with integer values and rounds double values to integers using sophisticated quantizing. - *

- * @class - * @implements {yfiles.hierarchic.INodePlacer} - */ - export interface SimplexNodePlacer extends yfiles.lang.Object,yfiles.hierarchic.INodePlacer{} - export class SimplexNodePlacer { - constructor(); - /** - * - * @param graph - * @param layoutDataProvider - * @param layers - */ - assignLayerCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers):void; - /** - * Assigns the nodes of a given layer to the corresponding upper/lower sublayer if {@link yfiles.hierarchic.SimplexNodePlacer#nodeCompaction node compaction} is enabled. - *

- * Information about sublayers is given by a {@link yfiles.algorithms.INodeMap} whose GetBool method has to return true for each - * node that should be placed in the lower sublayer (values are set by this method). - *

- * @param layerNodes a {@link list} of all @link y.layout.hierarchic.incremental.NodeData#TYPE_NORMAL normal nodes} of a layer - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param graph the given graph - * @param lowerSublayer the {@link } holding sublayer information - * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction - * @protected - */ - assignNodesToSublayer(layerNodes:yfiles.algorithms.NodeList,ldp:yfiles.hierarchic.ILayoutDataProvider,graph:yfiles.layout.LayoutGraph,lowerSublayer:yfiles.algorithms.INodeMap):void; - /** - * - * @param graph - * @param layoutDataProvider - * @param layers - * @param drawingDistanceCalculator - */ - assignSequenceCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers,drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator):void; - /** - * Returns the alignment of the node with a specified layer. - *

- * This callback method used by {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates}. - *

- * @param graph the input graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param node the given node - * @param layerIndex the index of the layer - * @param minLayerHeight the minimum height of the layer - * @returns - * @protected - */ - getLayerAlignment(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,layerIndex:number,minLayerHeight:number):number; - /** - * Specifies the minimum allowed distance between two nodes of the same given layer. - *

- * This callback method is used by {@link yfiles.hierarchic.SimplexNodePlacer#assignSequenceCoordinates}. - *

- * @param graph the graph that contains the nodes - * @param layer the layer that contains the nodes - * @param predNode the node to the left of the other one, may be null to indicate a border line - * @param succ the node to the right of the other one, may be null to indicate a border line - * @returns the minimum distance allowed between those two nodes ( >=0 ) - * @see yfiles.hierarchic.IDrawingDistanceCalculator - * @protected - */ - getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,predNode:yfiles.algorithms.Node,succ:yfiles.algorithms.Node):number; - /** - * Returns the minimum height of a given {@link yfiles.hierarchic.ILayer layer}. - *

- * This callback method is used by {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates}. - *

- * @param graph the given graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param layer the given {@link } object - * @returns the minimum height - * @protected - */ - getMinimumLayerHeight(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,layer:yfiles.hierarchic.ILayer):number; - /** - * Returns whether or not the given node should be treated as a node with fixed (given) coordinates. - *

- * This callback method is used by both {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates} and - * {@link yfiles.hierarchic.SimplexNodePlacer#assignSequenceCoordinates}. - *

- *

- * If inLayer argument is true, this method is called from within the {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates} - * method. - *

- * @param graph the given graph - * @param provider the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param node the given node - * @param inLayer true if the layer coordinate of the node is queried, false if the sequence coordinate is queried - * @returns true if the node should be treated as fixed, false otherwise - * @protected - */ - isFixedNode(graph:yfiles.layout.LayoutGraph,provider:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,inLayer:boolean):boolean; - /** - * Gets or sets whether or not nodes should be placed in a more compact style with respect to layout width. - *

- * If enabled, the algorithm may place the nodes of a layer in a stacked style (horizontally interleaving), i.e., it splits - * the layer into an upper and lower sublayer and places adjacent nodes into different sublayers if this reduces the width - * of the layer. - *

- * @see yfiles.hierarchic.SimplexNodePlacer#minimumSublayerDistance - * @see yfiles.hierarchic.SimplexNodePlacer#assignNodesToSublayer - * @type {boolean} - */ - nodeCompaction:boolean; - /** - * Gets or sets the minimum distance between the upper and lower sublayer. - *

- * A too small distance value may prevent adjacent nodes from being placed in a stacked style (horizontally interleaving) - * because the vertical distance between these nodes must be greater than or equal to the value specified by {@link yfiles.hierarchic.NodeLayoutDescriptor#minimumDistance}. - *

- *

- * Values should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if minimum sublayer distance is negative - * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction - * @type {number} - */ - minimumSublayerDistance:number; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} places labels in a more compact style. - *

- * If this option is enabled the algorithm tries to place adjacent label elements in a stacked style, i.e., horizontally - * interleaving. - *

- * @type {boolean} - */ - labelCompaction:boolean; - /** - * Gets or sets whether or not an optimization step should be applied that tries to further reduce the number of bends. - * @see yfiles.hierarchic.SimplexNodePlacer#maximumDuration - * @type {boolean} - */ - bendReduction:boolean; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} tries to create a maximally compact horizontal - * layout at the cost of more bends. - *

- * For best results, {@link yfiles.hierarchic.SimplexNodePlacer#breakLongSegments} and {@link yfiles.hierarchic.SimplexNodePlacer#labelCompaction} should also be enabled. - *

- * @see yfiles.hierarchic.SimplexNodePlacer#labelCompaction - * @see yfiles.hierarchic.SimplexNodePlacer#breakLongSegments - * @type {boolean} - */ - horizontalCompaction:boolean; - /** - * Gets or sets whether or not a postprocessing step should be applied to reduce the number of bends. - *

- * Furthermore, enabling this option may violate some minimum distances specified by the user and the edge distribution is - * no longer uniform. - *

- * @type {boolean} - */ - straightenEdges:boolean; - /** - * Gets or sets the strategy used for controlling the horizontal compactness of group nodes. - * @type {yfiles.hierarchic.GroupCompactionPolicy} - */ - groupCompactionStrategy:yfiles.hierarchic.GroupCompactionPolicy; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} enforces the placement of nodes at their exact - * current positions, even if this violates minimum distance constraints. - * @type {boolean} - */ - exactPlacement:boolean; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} should try to use the coordinates given from the - * current sketch for the determination of the layer coordinates. - * @type {boolean} - */ - fromSketchLayerAssignment:boolean; - /** - * Gets or sets the time limit (in milliseconds) set for the layout algorithm. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the relative weight of edges crossing a swimlane relative to edges that stay in their lane. - *

- * Higher values lead to more compact drawings but may cause additional bends. - *

- *

- * Values should lie within [0,1] interval. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the relative weight does not lie within [0,1] - * @type {number} - */ - swimLaneCrossingWeight:number; - /** - * Gets or sets whether or not a barycenter drawing mode should be used. - *

- * If this mode is enabled the resulting drawing is likely to have more bends, but may be more symmetric. - *

- * @type {boolean} - */ - barycenterMode:boolean; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} should break long edge segments in favor of a - * potentially more compact layout. - *

- * A long edge is an edge that spans multiple layers. For each layer, a dummy node is necessary to model the edge path from - * source to target. - *

- *
    - *
  • - * Not breaking such edges means that there is a constraint that enforces the alignment of all these dummy nodes (same - * x-coordinate). This favors straight edge paths. - *
  • - *
  • - * Breaking an edge means that the dummy nodes are not necessarily aligned, but additional bends can be generated if that - * leads to a horizontally more compact layout result. - *
  • - *
- * @type {boolean} - */ - breakLongSegments:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.SimplexNodePlacer; - } - /** - * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases and models a swimlane structure. - *

- * For layout orientation - * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}, swimlanes partition the drawing area into vertical stripes. Each node is - * placed within a user-specified lane. Swimlanes are, for example, often used in flow diagrams to separate logical units. - *

- *

- * Each node should be associated with a SwimLaneDescriptor instance; nodes in the same lane may share one instance. The - * results of the calculation of the swimlanes' geometry will be stored by the instances after the layout. - *

- *

- * A {@link yfiles.hierarchic.SwimlaneDescriptor} instance can be bound to the layout algorithm using a {@link yfiles.algorithms.IDataProvider} - * registered with the graph using key {@link yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY} that returns a {@link yfiles.hierarchic.SwimlaneDescriptor} - * instance for each node of the graph. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface SwimlaneDescriptor extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class SwimlaneDescriptor { - /** - * Creates a new {@link yfiles.hierarchic.SwimlaneDescriptor} instance with a given client {@link any} and a given {@link yfiles.collections.IComparer.}. - *

- * The given client {@link any} should be an instance of {@link yfiles.lang.IComparable} if the given {@link yfiles.collections.IComparer.} is null. - *

- * @param clientObject a client {@link } used for sorting the lanes - * @param comparer a {@link } used for comparing the client objects - * @throws {Stubs.Exceptions.ArgumentError} if the specified client {@link any} is null or the specified {@link yfiles.collections.IComparer.} is null but the specified client {@link any} is not an instance of - * {@link yfiles.lang.IComparable}. - */ - constructor(clientObject:any,comparer:yfiles.collections.IComparer); - /** - * Creates a new {@link yfiles.hierarchic.SwimlaneDescriptor} instance with a given {@link yfiles.lang.IComparable} object. - * @param clientObject a {@link } used for determining the order of the lanes - * @throws {Stubs.Exceptions.ArgumentError} if the specified client object is null. - */ - constructor(clientObject:yfiles.lang.IComparable); - /** - * Implements the {@link yfiles.lang.IComparable} interface using the {@link yfiles.hierarchic.SwimlaneDescriptor#comparer} and {@link yfiles.hierarchic.SwimlaneDescriptor#clientObject} fields. - * @param o - * @returns - */ - compareTo(o:any):number; - /** - * Gets or sets whether or not an index of a swimlane is fixed (based on the result of the comparison with the other - * swimlanes) or whether the index should be chosen automatically in order to minimize edge lengths. - *

- * For all swimlanes where this property is set to - * true, the relative ordering given by the client objects is preserved. The remaining swimlanes may be sorted again so - * that the overall edge lengths are minimized. - *

- * @type {boolean} - */ - indexFixed:boolean; - /** - * Gets or sets the client {@link any object}. - *

- * The given client {@link any} should be an instance of {@link yfiles.lang.IComparable}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if there is currently no {@link yfiles.collections.IComparer. comparator} and the specified object is not a {@link yfiles.lang.IComparable} instance - * @see yfiles.hierarchic.SwimlaneDescriptor#comparer - * @see yfiles.hierarchic.SwimlaneDescriptor#comparer - * @type {any} - */ - clientObject:any; - /** - * Gets or sets the tightness factor of the lane. - *

- * This value should lie within [0,1] interval. - *

- *

- * The greater the value, the more will the lane be forced to obtain its minimum possible width. - *

- *
    - *
  • A value of 0.0d will disable compression of the lane.
  • - *
  • A value of 1.0d will try to force the lane to obtain its {@link yfiles.hierarchic.SwimlaneDescriptor#minimumLaneWidth minimum width}.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside [0,1] interval - * @type {number} - */ - laneTightness:number; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} instance used for sorting the lanes. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.collections.IComparer.} is null. - * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the minimum width of the swimlane. - *

- * The minimum width should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value negative - * @type {number} - */ - minimumLaneWidth:number; - /** - * Gets or sets the left insets of the swimlane in which no element will lie in the resulting layout. - *

- * The inset should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0. - * @type {number} - */ - leftLaneInset:number; - /** - * Gets or sets the right insets of the swimlane in which no element will lie in the resulting layout. - *

- * The inset should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0. - * @type {number} - */ - rightLaneInset:number; - /** - * Gets the computed position (smaller coordinate) of the swimlane after the layout has been calculated. - * @type {number} - */ - computedLanePosition:number; - /** - * Gets the computed width of the swimlane after the layout has been calculated. - * @type {number} - */ - computedLaneWidth:number; - /** - * Gets the computed zero-based index of the swimlane after the layout has been calculated. - * @type {number} - */ - computedLaneIndex:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.SwimlaneDescriptor; - } - /** - * This {@link yfiles.layout.ILayoutStage layout stage} can be used for automatically assigning {@link yfiles.hierarchic.SwimlaneDescriptor} instances to nodes by - * treating top-level group nodes as swimlanes. - *

- * This stage will modify the hierarchy by temporarily removing the top-level group nodes and assigning corresponding - * descriptors to the remaining nodes. After running the core layout, the top-level group nodes will be arranged to - * function as swimlanes. This class allows using the current coordinates of the group nodes to - * {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage#orderSwimlanesFromSketch arrange the swimlanes from sketch}. Also, the {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage#spacing spacing} between swimlanes may be specified. - *

- *

- * This stage can be {@link yfiles.layout.MultiStageLayout#appendStage appended} to the {@link yfiles.hierarchic.HierarchicLayout}. - *

- * @see yfiles.hierarchic.HierarchicLayout - * @see yfiles.hierarchic.SwimlaneDescriptor - * @see yfiles.layout.GroupingKeys - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface TopLevelGroupToSwimlaneStage extends yfiles.layout.LayoutStageBase{} - export class TopLevelGroupToSwimlaneStage { - /** - * Creates a new instance of {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage} with the default settings. - */ - constructor(); - /** - * Gets or sets the spacing between the swimlanes. - *

- * The spacing should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative - * @type {number} - */ - spacing:number; - /** - * Gets or sets whether or not the order of the swimlanes should be determined based on the current sketch. - * @type {boolean} - */ - orderSwimlanesFromSketch:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.TopLevelGroupToSwimlaneStage; - } - /** - * This class implements the layering phase of the {@link yfiles.hierarchic.HierarchicLayout} (i.e., assignment of the nodes to - * layers). - *

- * It uses topological sorting to assign layers to the nodes. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[63.79,0,[[73.45,24.35,10.67,18.7,"1"]]],[121,150,[[130.66,174.35,10.67,18.7,"2"]]],[71,150,[[80.66,174.35,10.67,18.7,"3"]]],[162.99,0,[[172.65,24.35,10.67,18.7,"6"]]],[162.99,70,[[172.65,94.35,10.67,18.7,"7"]]],[112.99,70,[[122.65,94.35,10.67,18.7,"8"]]],[30.99,70,[[37.31,94.35,17.35,18.7,"12"]]],[35.5,220,[[45.16,244.35,10.67,18.7,"8"]]],[0,150,[[9.66,174.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,0,-15,[127.99,120,136,120]],[0,1,10,15,-10,-15,[88.79,50,92.49,50,92.49,130,126,130]],[0,2,0,15,0,-15,[78.79,50,81.49,50,81.49,120,86,120]],[4,1,0,15,10,-15,[177.99,120,146,120]],[3,4,0,15,0,-15],[0,6,-10,15,0,-15,[68.79,50,45.99,50]],[6,7,7.5,15,0,-15,[53.49,120,50.5,120]],[6,8,-7.5,15,0,-15,[38.49,120,15,120]],[8,7,0,15,-10,-15,[15,200,40.5,200]],[2,7,0,15,10,-15,[86,200,60.5,200]]],"vp":[0.0,0.0,193.0,250.0]}} - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface TopologicalLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class TopologicalLayerer { - /** - * Creates a new instance of {@link yfiles.hierarchic.TopologicalLayerer} with default settings. - */ - constructor(); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Gets or sets the (re-)ranking policy used by this {@link yfiles.hierarchic.TopologicalLayerer} instance. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown ranking policy is given - * @type {yfiles.hierarchic.RankingPolicy} - */ - rankingPolicy:yfiles.hierarchic.RankingPolicy; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.TopologicalLayerer; - } - /** - * This class is a {@link yfiles.hierarchic.IDrawingDistanceCalculator} implementation that returns the minimum distances for each - * kind of node pair based on their type as returned by {@link yfiles.hierarchic.INodeData#type}. - * @class - * @implements {yfiles.hierarchic.IDrawingDistanceCalculator} - */ - export interface TypeBasedDrawingDistanceCalculator extends yfiles.lang.Object,yfiles.hierarchic.IDrawingDistanceCalculator{} - export class TypeBasedDrawingDistanceCalculator { - /** - * Creates a new instance of {@link yfiles.hierarchic.TypeBasedDrawingDistanceCalculator} with default settings. - */ - constructor(); - /** - * - * @param graph - * @param layers - * @param ldp - */ - dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * - * @param graph - * @param layer - * @param ldp - * @param left - * @param right - * @returns - */ - getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; - /** - * - * @param graph - * @param layers - * @param ldp - */ - initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Gets or sets whether or not the compaction option is enabled. - * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction - * @see yfiles.hierarchic.SimplexNodePlacer#labelCompaction - * @type {boolean} - */ - compaction:boolean; - /** - * Gets or sets the minimum distance between two {@link yfiles.algorithms.Node}s. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - nodeToNodeDistance:number; - /** - * Gets or sets the minimum distance between a {@link yfiles.algorithms.Node} and an (non-adjacent) {@link yfiles.algorithms.Edge}. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - nodeToEdgeDistance:number; - /** - * Gets or sets the minimum distance between two edges. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - edgeToEdgeDistance:number; - /** - * Gets or sets the minimum length of the first segment of the edge path (at the source node). - *

- * The minimum length should be greater than 0. - *

- *

- * If the value is 0.0d the first segment does not need to be orthogonal. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative - * @type {number} - */ - minimumFirstSegmentLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.TypeBasedDrawingDistanceCalculator; - } - /** - * This class implements the layering phase of the {@link yfiles.hierarchic.HierarchicLayout} (i.e., the assignment of the nodes to - * layers). - *

- * It first makes the directed graph acyclic. Then, it assigns the layers such that edge weights are respected. A weight - * defines a minimum distance between the two end points of an edge. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[100,70,[[109.66,94.35,10.67,18.7,"1"]]],[45.59,140,[[55.25,164.35,10.67,18.7,"2"]]],[95.59,140,[[105.25,164.35,10.67,18.7,"3"]]],[0,0,[[9.66,24.35,10.67,18.7,"6"]]],[0,70,[[9.66,94.35,10.67,18.7,"7"]]],[50,70,[[59.66,94.35,10.67,18.7,"8"]]],[145.59,140,[[151.91,164.35,17.35,18.7,"12"]]],[125.59,280,[[135.25,304.35,10.67,18.7,"8"]]],[125.59,210,[[135.25,234.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,0,-15,[65,120,60.59,120]],[0,1,-10,15,10,-15,[105,120,70.59,120]],[0,2,0,15,0,-15,[115,120,110.59,120]],[4,1,0,15,-10,-15,[15,120,50.59,120]],[3,4,0,15,0,-15],[0,6,10,15,0,-15,[125,120,160.59,120]],[6,7,7.5,15,10,-15,[168.09,190,176.09,190,176.09,260,150.59,260]],[6,8,-7.5,15,0,-15,[153.09,190,140.59,190]],[8,7,0,15,0,-15],[2,7,0,15,-10,-15,[110.59,190,105.09,190,105.09,260,130.59,260]]],"vp":[0.0,0.0,177.0,310.0]}} - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface WeightedLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class WeightedLayerer { - /** - * Creates an instance of {@link yfiles.hierarchic.WeightedLayerer} with the given key that provides access to the {@link yfiles.algorithms.IDataProvider} - * that holds the edge weights and unlimited maximum duration for the {@link yfiles.hierarchic.WeightedLayerer}. - * @param [key=null] the key to access the {@link } that holds the edge weights - */ - constructor(key?:any); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Assigns all nodes of the graph to layers. - * @param graph the graph for which the layers are determined - * @param layerID the {@link } that will be filled by the layout algorithm and returns a zero-based layer index for each - * node - * @returns the number of layers - */ - assignLayersFast(graph:yfiles.algorithms.Graph,layerID:yfiles.algorithms.INodeMap):number; - /** - * Assigns all nodes of the graph to layers. - * @param graph the graph for which the layers are determined - * @param layerID the {@link } that will be filled by the layout algorithm and returns the zero-based index of the layer - * to which each node belongs - * @returns the number of layers - */ - assignLayersToMap(graph:yfiles.algorithms.Graph,layerID:yfiles.algorithms.INodeMap):number; - /** - * Assigns all nodes of the graph to layers. - * @param graph the graph for which the layers are determined - * @param layerID the {@link } that will be filled by the layout algorithm and returns a zero-based layer index for each - * node - * @param reversedEdges an {@link } containing the edges which had been reversed - * @param weight the {@link } that returns an integer value (weight) for each edge - * @returns the number of layers - */ - assignNodeLayerWithDataProvider(graph:yfiles.layout.LayoutGraph,layerID:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList,weight:yfiles.algorithms.IDataProvider):number; - /** - * Returns the edge weight of the given edge using the weight based cycle removal heuristic. - *

- * By default, all edges are considered to have weight 1.0. - *

- *

- * It may be overridden if non-uniform weights are desired. - *

- * @param edge given edge - * @returns the edge weight of the specified edge - * @see yfiles.hierarchic.WeightedLayerer#weightedCycleRemoval - * @see yfiles.hierarchic.WeightedLayerer#weightedCycleRemoval - * @protected - */ - getWeight(edge:yfiles.algorithms.Edge):number; - /** - * Removes cycles from the graph using a depth first search. - * @param graph the graph - * @param reversedEdges an {@link } containing the edges which will be reversed - */ - makeDFSAcyclic(graph:yfiles.algorithms.Graph,reversedEdges:yfiles.algorithms.EdgeList):void; - /** - * This is a {@link yfiles.algorithms.IDataProvider} that holds for each {@link yfiles.algorithms.Edge} an integer value representing its - * weight. - * @protected - * @type {yfiles.algorithms.IDataProvider} - */ - weight:yfiles.algorithms.IDataProvider; - /** - * The key to access the {@link yfiles.algorithms.IDataProvider} that holds the edge weights. - *

- * More precisely, the corresponding {@link yfiles.algorithms.IDataProvider} maps each edge of the input graph to an integer value - * representing the edge's weight. - *

- * @protected - * @type {any} - */ - key:any; - /** - * Gets or sets whether or not the edges that need to be reversed are determined using an edge weight based heuristic or - * using a depth first search based approach. - *

- * The weight based approach may result in fewer reversed edges (especially for cases with many multi-edges) whereas the - * DFS based approach is likely to be faster. - *

- * @type {boolean} - */ - weightedCycleRemoval:boolean; - /** - * Gets or sets the time limit in milliseconds set for the layout algorithm. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.WeightedLayerer; - } - /** - * Specifies custom data for the {@link yfiles.hierarchic.HierarchicLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface HierarchicLayoutData extends yfiles.layout.LayoutData{} - export class HierarchicLayoutData { - constructor(); - /** - * Gets or sets a mapping from edges to alternative paths for edges connecting to groups, group content or folder nodes. - * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_EDGE_PATH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - alternativeEdgePath:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from group/folder nodes to alternative bounds for these nodes. - * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - alternativeGroupBounds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their priority to be a 'critical' edge. - *

- * The layout tries to vertically align each node pair that is connected by a critical edge (integer value > 0). - *

- * @see yfiles.hierarchic.HierarchicLayout#CRITICAL_EDGE_PRIORITY_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - criticalEdgePriorities:yfiles.layout.ItemMapping; - /** - * Gets or sets the collection of folder nodes used for recursive edge styles in incremental mode. - * @see yfiles.hierarchic.HierarchicLayout#FOLDER_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - folderNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping of edges to their {@link yfiles.hierarchic.EdgeLayoutDescriptor}. - *

- * If an edge is mapped to null, the {@link yfiles.hierarchic.HierarchicLayout#edgeLayoutDescriptor default descriptor} is used. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping of nodes to their {@link yfiles.hierarchic.NodeLayoutDescriptor} - *

- * If a node is mapped to null, the {@link yfiles.hierarchic.HierarchicLayout#nodeLayoutDescriptor default descriptor} is used. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source port group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target port group. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the factory to specify layer constraints. - * @see yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory - * @see yfiles.hierarchic.ILayerConstraintFactory - * @type {yfiles.hierarchic.ILayerConstraintFactory} - */ - layerConstraintFactory:yfiles.hierarchic.ILayerConstraintFactory; - /** - * Gets or sets the factory to specify sequence constraints. - * @see yfiles.hierarchic.HierarchicLayout#createSequenceConstraintFactory - * @see yfiles.hierarchic.ISequenceConstraintFactory - * @type {yfiles.hierarchic.ISequenceConstraintFactory} - */ - sequenceConstraintFactory:yfiles.hierarchic.ISequenceConstraintFactory; - /** - * Gets or sets a mapping from nodes and edges to their incrementally hints. - * @see yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY - * @type {yfiles.hierarchic.IncrementalHintItemMapping} - */ - incrementalHints:yfiles.hierarchic.IncrementalHintItemMapping; - /** - * Gets or sets a mapper from nodes to the index of their layer. - *

- * If this property is set, the mapper is filled by the layout with the layer information. - *

- * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY - * @type {yfiles.collections.IMapper.} - */ - layerIndices:yfiles.collections.IMapper; - /** - * Gets or sets a mapper from nodes to the sequence index in their layer. - *

- * If this property is set, the mapper is filled by the layout with the sequence information. - *

- * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY - * @type {yfiles.collections.IMapper.} - */ - sequenceIndices:yfiles.collections.IMapper; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the partition grid layout data. - * @type {yfiles.layout.PartitionGridData} - */ - partitionGridData:yfiles.layout.PartitionGridData; - /** - * Gets or sets the layout data for the {@link yfiles.hierarchic.SelfLoopCalculator}. - * @type {yfiles.hierarchic.SelfLoopCalculatorData} - */ - selfLoopCalculatorData:yfiles.hierarchic.SelfLoopCalculatorData; - /** - * Gets or sets the mapping from edges to an additional weight used by the {@link yfiles.hierarchic.ConstraintIncrementalLayerer}. - *

- * The Layerer tries to keep edges with higher weights short. - *

- * @see yfiles.hierarchic.ConstraintIncrementalLayerer#ADDITIONAL_EDGE_WEIGHT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - constraintIncrementalLayererAdditionalEdgeWeights:yfiles.layout.ItemMapping; - /** - * Gets or sets the collection of core nodes used by the {@link yfiles.hierarchic.BFSLayerer}. - *

- * The {@link yfiles.hierarchic.BFSLayerer} is used when {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy} is set to {@link yfiles.hierarchic.LayeringStrategy#BFS}. - *

- * @see yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - bfsLayererCoreNodes:yfiles.layout.ItemCollection; - /** - * Gets or set the mapping from nodes to their layer index when using the {@link yfiles.hierarchic.GivenLayersLayerer}. - *

- * The {@link yfiles.hierarchic.GivenLayersLayerer} is used when {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy} is set to {@link yfiles.hierarchic.LayeringStrategy#USER_DEFINED}. - *

- * @see yfiles.hierarchic.GivenLayersLayerer#LAYER_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - givenLayersLayererIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their directedness. - *

- * Generally, the hierarchic layout algorithm assigns nodes to layers such that most of the edges point in the - * {@link yfiles.layout.MultiStageLayout#layoutOrientation main layout direction}. The directedness of an edge specifies whether it should comply with this strategy. More - * precisely, a value of 1 means that the edge should fully comply, a value of -1 that it should comply inversely (the edge - * should point against the main layout direction), and a value of 0 means that the direction doesn't matter at all and the - * endpoints of the edges may be placed at the same layer. If there are conflicting preferences, edges with higher absolute - * values are more likely to point in the desired direction. - *

- * @see yfiles.hierarchic.HierarchicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeDirectedness:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their thickness. - *

- * The specified non-negative thickness is considered when calculating minimum distances so that there are no overlaps - * between edges and other graph elements. By default, each edge has thickness 0. - *

- * @see yfiles.hierarchic.HierarchicLayout#EDGE_THICKNESS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeThickness:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.HierarchicLayoutData; - } - /** - * Provides different ways to define a mapping from model items to incremental hints for use with - * {@link yfiles.hierarchic.HierarchicLayoutData}. - *

- * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties of - * this class should be set on an instance. - *

- * @class - * @extends {yfiles.layout.ContextItemMapping.} - * @final - */ - export interface IncrementalHintItemMapping extends yfiles.layout.ContextItemMapping{} - export class IncrementalHintItemMapping { - constructor(); - /** - * Gets or sets an item collection of nodes that are mapped to {@link yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint incremental layering hints}. - * @type {yfiles.layout.ItemCollection.} - */ - incrementalLayeringNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets an item collection of nodes that are mapped to {@link yfiles.hierarchic.IIncrementalHintsFactory#createSequenceIncrementallyHint incremental sequencing hints}. - * @type {yfiles.layout.ItemCollection.} - */ - incrementalSequencingItems:yfiles.layout.ItemCollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.IncrementalHintItemMapping; - } - /** - * Specifies custom data for the {@link yfiles.hierarchic.SelfLoopCalculator}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface SelfLoopCalculatorData extends yfiles.layout.LayoutData{} - export class SelfLoopCalculatorData { - constructor(); - /** - * Gets or sets the collection of edges that are octilinear. - * @see yfiles.hierarchic.SelfLoopCalculator#OCTILINEAR_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - octilinearEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from nodes to their minimum distance to selfloop edges. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_NODE_DISTANCE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumNodeDistances:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their minimum distance to the next edge and to node sides. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_EDGE_DISTANCE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumEdgeDistances:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to the minimum length of their first segment. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumFirstSegmentLengths:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to the minimum length of their last segment. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumLastSegmentLengths:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to the minimum length of their octilinear segments. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumOctilinearSegmentLengths:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.SelfLoopCalculatorData; - } - }export namespace labeling{ - export enum OptimizationStrategy{ - /** - * An optimization strategy aiming at a good balance between the available optimization options. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - BALANCED, - /** - * An optimization strategy that especially reduces overlaps between labels and nodes as well as labels and node halos. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - NODE_OVERLAP, - /** - * An optimization strategy that especially reduces overlaps between labels. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - LABEL_OVERLAP, - /** - * An optimization strategy that especially reduces overlaps between labels and edges. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - EDGE_OVERLAP, - /** - * An optimization strategy that mainly tries to satisfy the preferences described by a {@link yfiles.layout.PreferredPlacementDescriptor} - * associated with edge labels. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - PREFERRED_PLACEMENT, - /** - * Use no optimization strategy. - */ - NONE - } - /** - * A generic labeling algorithm for placing the labels of a graph. - *

- * {@graph {"ann":{"s":[30,30],"d":1,"c":1,"lblFlip":1,"lblB":1},"n":[[249.44,602.63,[[212.75,626.98,32.69,18.7,"Node"]]],[306.92,686.94,[[270.24,711.29,32.69,18.7,"Node"]]],[481.7,787.85,[[515.7,812.2,32.69,18.7,"Node"]]],[219.36,505.12,[[182.67,529.47,32.69,18.7,"Node"]]],[386.71,750.57,[[350.02,774.92,32.69,18.7,"Node"]]],[885,353.19,[[883.66,405.89,32.69,18.7,"Node"]]],[840.72,261.25,[[839.38,257.25,32.69,18.7,"Node"]]],[583.46,112.72,[[582.11,108.72,32.69,18.7,"Node"]]],[249.44,305.56,[[212.75,329.91,32.69,18.7,"Node"]]],[682.94,135.42,[[681.6,131.42,32.69,18.7,"Node"]]],[481.7,120.34,[[480.35,116.34,32.69,18.7,"Node"]]],[771.32,186.45,[[769.97,182.45,32.69,18.7,"Node"]]],[219.36,403.07,[[182.67,427.42,32.69,18.7,"Node"]]],[306.92,221.25,[[270.24,245.6,32.69,18.7,"Node"]]],[386.71,157.62,[[385.36,153.62,32.69,18.7,"Node"]]]],"e":[[0,1,[],[[259.45,643.51,32.03,18.7,0.826238774315996,-0.5633200580636204,"Edge"]]],[3,0,[],[[221.61,542.21,32.03,18.7,0.9555728057861415,-0.294755174410902,"Edge"]]],[1,4,[],[[349.3,723.77,32.03,18.7,0.6234898018587343,-0.7818314824680294,"Edge"]]],[4,2,[],[[418.05,771.98,32.03,18.7,0.36534102436639637,-0.9308737486442037,"Edge"]]],[3,5,[],[[262.64,513.66,32.03,18.7,-0.2225209339563144,-0.9749279121818236,"Edge"]]],[2,5,[],[[534.29,789.82,32.03,18.7,-0.7330518718298267,-0.680172737770919,"Edge"]]],[4,5,[],[[427.6,744.91,32.03,18.7,-0.6234898018587336,-0.7818314824680299,"Edge"]]],[1,5,[],[[350.46,685.47,32.03,18.7,-0.5000000000000003,-0.8660254037844386,"Edge"]]],[0,5,[],[[298.89,624.2,32.03,18.7,-0.3653410243663947,-0.9308737486442044,"Edge"]]],[5,6,[],[[878.37,323.28,32.03,18.7,0.9009688679024184,-0.4338837391175598,"Edge"]]],[7,5,[],[[611.91,162.36,32.03,18.7,0.6234898018587336,-0.7818314824680299,"Edge"]]],[8,5,[],[[292.35,341.41,32.03,18.7,0.07473009358642455,-0.9972037971811801,"Edge"]]],[9,7,[],[[645.8,157.7,32.03,18.7,0.2225209339563144,-0.9749279121818236,"Edge"]]],[7,10,[],[[549.55,131.38,32.03,18.7,-0.07473009358642278,-0.9972037971811804,"Edge"]]],[10,5,[],[[515.14,167.59,32.03,18.7,0.5000000000000003,-0.8660254037844386,"Edge"]]],[6,11,[],[[796.42,239.83,32.03,18.7,0.7330518718298267,-0.680172737770919,"Edge"]]],[11,9,[],[[733.51,192.55,32.03,18.7,0.4999999999999995,-0.866025403784439,"Edge"]]],[8,12,[],[[267.76,373.25,32.03,18.7,-0.9555728057861401,-0.29475517441090626,"Edge"]]],[12,3,[],[[253.06,467.1,32.03,18.7,-1.0,-2.7257675990577433E-15,"Edge"]]],[12,5,[],[[265.18,415.76,32.03,18.7,-0.07473009358642366,-0.9972037971811802,"Edge"]]],[13,5,[],[[347.6,261.29,32.03,18.7,0.22252093395631525,-0.9749279121818234,"Edge"]]],[13,8,[],[[284.16,291.63,32.03,18.7,-0.826238774315993,-0.5633200580636247,"Edge"]]],[10,14,[],[[450.54,153.46,32.03,18.7,-0.3653410243663931,-0.930873748644205,"Edge"]]],[14,13,[],[[349.3,214.42,32.03,18.7,-0.6234898018587314,-0.7818314824680315,"Edge"]]],[14,5,[],[[424.24,201.56,32.03,18.7,0.36534102436639554,-0.930873748644204,"Edge"]]]],"vp":[182.0,90.0,735.0,728.0]}} Node labels and edge labels placed by the labeling algorithm - *

- *

- * This algorithm can switch between two internal implementations. By default, it generates high quality label placements - * even for difficult instances. This especially holds if the label models allow a large number of different - * {@link yfiles.layout.LabelCandidate}s, i.e., there is a high potential for optimizations. - *

- *

- * If the duration of the calculation is of utmost importance, the internal algorithm can be changed to a simpler - * implementation by setting {@link yfiles.labeling.GenericLabeling#maximumDuration} to 0. On the downside, the results will not be as good as the ones of the default mode. - *

- *

- * In default mode, this algorithm reduces the labeling problem to the maximum independent set (MIS) problem and solves the - * problem using simulated annealing. It is inspired by the article from Christensen, Marks and Shieber: A General - * Cartographic Labelling Algorithm. - *

- *

- * It is recommended to use {@link yfiles.layout.IEdgeLabelLayoutModel}s and - * {@link yfiles.layout.INodeLabelLayoutModel}s which allow free positioning of labels to achieve best results with this generic - * labeling algorithm. - *

- *

- * This algorithm works according to the general labeling concept defined by {@link yfiles.labeling.LabelingBase}. - *

- * @see yfiles.labeling.LabelingBase - * @class - * @extends {yfiles.labeling.MISLabelingBase} - */ - export interface GenericLabeling extends yfiles.labeling.MISLabelingBase{} - export class GenericLabeling { - /** - * Creates a new instance of {@link yfiles.labeling.GenericLabeling} with default settings. - */ - constructor(); - /** - * Gets or sets whether or not this algorithm behaves deterministically. - *

- * If enabled, it produces the same results given the same input graph and settings. - *

- * @type {boolean} - */ - deterministic:boolean; - /** - * Gets or sets the time limit for this algorithm in milliseconds. - *

- * 0x7FFFFFFF denotes that there is no time limit. Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given maximum duration is negative - * @type {number} - */ - maximumDuration:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.labeling.GenericLabeling; - } - /** - * An abstract base class for generic labeling algorithms which place labels of graphs. - *

- * Labeling algorithms compute positions for labels in a given graph. The main goal is to place labels such that they do - * not overlap with other graph elements. Labeling algorithms do not modify positions of nodes and edges. - *

- *

- * Concept - *

- *

- * Generic labeling algorithms use the model associated with a label (i.e. {@link yfiles.layout.INodeLabelLayout#labelModel node label model} for nodes and {@link yfiles.layout.IEdgeLabelLayout#labelModel edge label model} - * for edges). The models are necessary to compute a set of {@link yfiles.layout.LabelCandidate}s, i.e., candidate positions for a - * label. Then, one best matching candidate from the set will be selected. This selection depends on several preferences, e.g., if {@link yfiles.labeling.LabelingBase#removeNodeOverlaps overlaps with nodes} - * are not allowed, candidates encoding overlapping positions will be ignored. - *

- *

- * After one {@link yfiles.layout.LabelCandidate} has been chosen, the label model's parameter is used for encoding the label - * position. Therefore, the result of a generic labeling algorithm is one model parameter per label. The parameter is {@link yfiles.layout.ILabelLayout#modelParameter stored with the label} - * and expresses the label position with respect to the underlying label model. - *

- *

- * Features - *

- *

- * This class provides a general frame, offering functionality which can be shared by other generic labeling algorithms. - *

- *

- * To only place labels or a subset of labels, the main labeling methods {@link yfiles.labeling.LabelingBase#label}, {@link yfiles.labeling.LabelingBase#label} - * and {@link yfiles.labeling.LabelingBase#label} are offered. - *

- *

- * As this class represents an {@link yfiles.layout.LayoutStageBase}, it allows usage as a generic labeling stage. By combining it - * with a - * {@link yfiles.layout.LayoutStageBase#coreLayout core layouter}, the labeling will take place after the core layouter was executed - * ({@link yfiles.labeling.LabelingBase#applyLayout}). This is especially useful if the core layouter does not support label - * handling. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface LabelingBase extends yfiles.layout.LayoutStageBase{} - export class LabelingBase { - /** - * Creates a new {@link yfiles.labeling.LabelingBase} instance with default settings. - */ - constructor(); - /** - * Returns the profit for placing a {@link yfiles.layout.LabelCandidate} with respect to the current {@link yfiles.labeling.LabelingBase#profitModel profit model}. - *

- * Method {@link yfiles.layout.IProfitModel#getProfit} on the current profit model will be invoked to compute the actual profit - * value. - *

- *

- * The higher the profit (rank) of a candidate is, the more likely it will be chosen as actual position by the algorithm. - *

- * @param candidate a label candidate - * @returns the profit value between 0 and 1 - */ - getProfit(candidate:yfiles.layout.LabelCandidate):number; - /** - * Places the labels of the input graph restricting the placement to labels contained in the given lists. - *

- * The {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey selection} will not be considered; the given lists will define the selection of labels that are to be placed. - *

- * @param graph the input graph - * @param nodeLabels a list of {@link }s defining the set of node labels that will be placed - * @param edgeLabels a list of {@link }s defining the set of edge labels that will be placed - */ - label(graph:yfiles.layout.LayoutGraph,nodeLabels:yfiles.algorithms.YList,edgeLabels:yfiles.algorithms.YList):void; - /** - * Places the labels of the input graph using a {@link yfiles.algorithms.IDataProvider} registered to the input graph with the - * given key for determining which labels to place. - *

- * Instead of considering the current {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey selection key}, the {@link yfiles.algorithms.IDataProvider} registered with the given key will - * be used for selecting labels. Invoking this method has the same effect as first {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey specifying the key} as selection key and - * then invoking {@link yfiles.labeling.LabelingBase#label}. - *

- * @param graph the input graph - * @param [key=null] the {@link } key for label selection - */ - label(graph:yfiles.layout.LayoutGraph,key?:any):void; - /** - * Data provider key for mapping models to edge/node labels - *

- * The {@link yfiles.layout.INodeLabelLayoutModel}s and {@link yfiles.layout.IEdgeLabelLayoutModel}s linked to - * {@link yfiles.layout.INodeLabelLayout}s and {@link yfiles.layout.IEdgeLabelLayout}s by this {@link yfiles.algorithms.IDataProvider} are taken as - * replacement models. This means that the original model is internally replaced by another model when computing valid - * positions for the label. A model parameter that fits the calculated position of the replacement model best is set for - * the original label model. - *

- * @const - * @static - * @type {yfiles.algorithms.ILabelLayoutDpKey.} - */ - static LABEL_MODEL_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; - /** - * Gets or sets the {@link yfiles.layout.IProfitModel} for ranking the {@link yfiles.layout.LabelCandidate}s for labels. - *

- * The profit model is used when {@link yfiles.labeling.LabelingBase#getProfit calculating the profit} of a candidate. - *

- *

- * The higher the profit (rank) of a candidate is, the more likely it will be chosen as actual position by the algorithm. - *

- * @see yfiles.layout.IProfitModel - * @see yfiles.layout.SimpleProfitModel - * @see yfiles.labeling.LabelingBase#getProfit - * @type {yfiles.layout.IProfitModel} - */ - profitModel:yfiles.layout.IProfitModel; - /** - * Gets or sets whether or not internal node labels are allowed to move. - *

- * A node label is internal if the label's boundaries are completely within the node's boundaries. - *

- * @type {boolean} - */ - moveInternalNodeLabels:boolean; - /** - * Gets or sets whether or not a post-processing step to reduce the number of label overlaps is applied. - * @type {boolean} - */ - reduceLabelOverlaps:boolean; - /** - * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with nodes are removed. - *

- * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely - * that an overlapping candidate is finally chosen. - *

- *

- * The detection and removal of labels that overlap with nodes may increase the runtime of this algorithm. - *

- * @type {boolean} - */ - removeNodeOverlaps:boolean; - /** - * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with edges are removed. - *

- * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely - * that an overlapping candidate is finally chosen. - *

- *

- * The detection and removal of labels that overlap with edges may increase the runtime of this algorithm. - *

- * @type {boolean} - */ - removeEdgeOverlaps:boolean; - /** - * Gets or sets whether or not labels assigned to nodes are placed. - * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey - * @type {boolean} - */ - placeNodeLabels:boolean; - /** - * Gets or sets whether or not labels assigned to edges are placed. - * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey - * @type {boolean} - */ - placeEdgeLabels:boolean; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to mark labels as selected for placement. - *

- * If a {@link yfiles.algorithms.IDataProvider} is registered with this key, only the selected labels will be placed, while all - * other labels are considered fixed. - *

- *

- * The registered {@link yfiles.algorithms.IDataProvider} needs to map from {@link yfiles.layout.ILabelLayout} to {@link boolean} where true indicates - * that a label should be placed and false indicates that a label should be ignored. - *

- * @type {any} - */ - affectedLabelsDpKey:any; - /** - * Gets or sets whether or not edge labels are automatically flipped if otherwise they would be upside-down. - * @type {boolean} - */ - autoFlipping:boolean; - /** - * Gets or sets whether or not edge labels may overlap with edges belonging to the same edge group as the label's edge. - *

- * An edge group is a set of edges which share a common bus near the target or source node. They are defined using - * {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} and - * {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {boolean} - */ - edgeGroupOverlapAllowed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.labeling.LabelingBase; - } - /** - * A base class for generic labeling algorithms which solve the labeling problem by reducing it to the maximum independent - * set (MIS) problem. - *

- * Different optimization strategies are available; an optimization strategy defines which criteria the algorithm should - * try to optimize. For example, reducing the number of overlaps between labels and nodes may be considered more important - * than reducing the number of overlaps between labels and edges. - *

- * @see yfiles.labeling.GenericLabeling - * @class - * @extends {yfiles.labeling.LabelingBase} - */ - export interface MISLabelingBase extends yfiles.labeling.LabelingBase{} - export class MISLabelingBase { - /** - * Creates a new {@link yfiles.labeling.MISLabelingBase} instance with default settings. - */ - constructor(); - /** - * Returns a {@link yfiles.algorithms.INodeMap} which assigns a profit value to each node in the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. - *

- * As the conflict graph's nodes represent {@link yfiles.layout.LabelCandidate}s, this mapping gives the profit value of label - * candidates. The assigned value is defined as the difference between the {@link yfiles.labeling.LabelingBase#getProfit profit induced by the profit model} and the - * candidate's {@link yfiles.layout.LabelCandidate#overlapPenalty overlap penalty}. - *

- *

- * The returned map is a mapping from each {@link yfiles.algorithms.Node} (representing a label candidate) in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} - * to a {@link number} representing the profit value of the candidate. - *

- * @returns a mapping from nodes (i.e. label candidates) to their profit value - */ - assignProfit():yfiles.algorithms.INodeMap; - /** - * Creates the edges in the conflict graph, i.e., one edge between two nodes if the corresponding - * {@link yfiles.layout.LabelCandidate}s intersect. - *

- * The nodes of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph} represent - * {@link yfiles.layout.LabelCandidate}s. An edge between candidates signals that they overlap. A maximum independent set will be - * computed on the conflict graph to choose candidates such that no two candidates overlap. - *

- *

- * This method may be overridden to change the structure of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. Edges between two - * {@link yfiles.layout.LabelCandidate}s in the conflict graph signal that the two candidates should not be selected together. By - * overriding this method, arbitrary reasons for indicating that two label candidates should not be chosen at the same time - * can be modeled. - *

- * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#nodesToBoxes - * @see yfiles.labeling.MISLabelingBase#boxesToNodes - * @see yfiles.labeling.MISLabelingBase#nodesToID - * @protected - */ - createEdges():void; - /** - * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and an {@link yfiles.algorithms.Edge} of the input graph has - * been found. - *

- * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor - * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. - *

- *

- * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and edges. - *

- * @param labelCandidate the {@link } overlapping with the given {@link } - * @param edge the {@link } overlapping with the given {@link } - * @param eSegment the {@link } of the given edge overlapping with the given candidate - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#createEdges - */ - foundEdgeOverlap(labelCandidate:yfiles.layout.LabelCandidate,edge:yfiles.algorithms.Edge,eSegment:yfiles.algorithms.LineSegment):void; - /** - * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and a {@link yfiles.layout.NodeHalo} of the input graph has - * been found. - *

- * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor - * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. - *

- *

- * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and node - * halos. - *

- * @param labelCandidate the {@link } overlapping with a node halo - * @param node the {@link } whose {@link } is overlapping with the given label candidate - * @param haloRect the bounding box of the {@link } overlapping with the given label candidate - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#createEdges - */ - foundHaloOverlap(labelCandidate:yfiles.layout.LabelCandidate,node:yfiles.algorithms.Node,haloRect:yfiles.algorithms.YRectangle):void; - /** - * Indicates that an overlap between two {@link yfiles.layout.LabelCandidate}s has been found. - *

- * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the - * {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor indicating how much the two candidates overlap. The factor influences the penalty - * assigned when both candidates are chosen, i.e., the penalty for the corresponding overlap. - *

- *

- * This method may be overridden to realize a custom strategy for reacting to overlaps among - * {@link yfiles.layout.LabelCandidate}s. - *

- * @param candidate1 the first overlapping {@link } - * @param candidate2 the second overlapping {@link } - * @param edge the {@link } in {@link #conflictGraph} representing the found overlap - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#createEdges - */ - foundLabelOverlap(candidate1:yfiles.layout.LabelCandidate,candidate2:yfiles.layout.LabelCandidate,edge:yfiles.algorithms.Edge):void; - /** - * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and a {@link yfiles.algorithms.Node} of the input graph has - * been found. - *

- * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor - * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. - *

- *

- * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and nodes. - *

- * @param labelCandidate the {@link } overlapping with the given node - * @param node the {@link } overlapping with the given label candidate - * @param nodeBox the bounding box of the given node - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#createEdges - */ - foundNodeOverlap(labelCandidate:yfiles.layout.LabelCandidate,node:yfiles.algorithms.Node,nodeBox:yfiles.algorithms.YRectangle):void; - /** - * The input graph that will be labeled. - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * The conflict graph modeling - * {@link yfiles.layout.LabelCandidate}s as nodes and edges between them as conflicts, i.e., overlaps among candidates. - * @see yfiles.labeling.MISLabelingBase#createEdges - * @type {yfiles.algorithms.Graph} - */ - conflictGraph:yfiles.algorithms.Graph; - /** - * The mapping from each node in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} to the corresponding {@link yfiles.layout.LabelCandidate} - * instance. - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @type {yfiles.algorithms.INodeMap} - */ - nodesToBoxes:yfiles.algorithms.INodeMap; - /** - * The mapping from the {@link yfiles.layout.LabelCandidate}s to the corresponding nodes in the - * {@link yfiles.labeling.MISLabelingBase#conflictGraph}. - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @type {yfiles.collections.IMap.} - */ - boxesToNodes:yfiles.collections.IMap; - /** - * The mapping from nodes in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} to a corresponding integer value (ID). - *

- * The ID denotes the actual label which a {@link yfiles.layout.LabelCandidate} (i.e. a node in the conflict graph) belongs to. - *

- * @type {yfiles.algorithms.INodeMap} - */ - nodesToID:yfiles.algorithms.INodeMap; - /** - * Gets or sets the ratio between the internal profit (ip) and the profit computed using the specified {@link yfiles.labeling.LabelingBase#profitModel profit model} (sp). - *

- * This ratio defines how to weight the two profit values (ip) and (sp). The overall ratio is then computed as - * ratio * sp + (1 - ratio) * ip. The profit of a {@link yfiles.layout.LabelCandidate} defines how likely it is that the candidate - * will be chosen as actual label position. - *

- *

- * The ratio is defined to be a value from the interval [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative or larger than 1 - * @see yfiles.labeling.LabelingBase#profitModel - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - * @type {number} - */ - customProfitModelRatio:number; - /** - * Gets or sets the optimization strategy which defines the importance of criteria when optimizing labeling results. - *

- * Depending on the strategy, criteria like label-node overlaps, label-label overlaps and others are more or less - * important. For example, if the number of overlaps between labels and nodes is the most important criterion for the - * result, strategy {@link yfiles.labeling.OptimizationStrategy#NODE_OVERLAP} should be chosen. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given strategy is unknown - * @type {yfiles.labeling.OptimizationStrategy} - */ - optimizationStrategy:yfiles.labeling.OptimizationStrategy; - /** - * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with nodes are removed. - *

- * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely - * that an overlapping candidate is finally chosen. - *

- *

- * The detection and removal of labels that overlap with nodes may increase the runtime of this algorithm. - *

- * @type {boolean} - */ - removeNodeOverlaps:boolean; - /** - * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with edges are removed. - *

- * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely - * that an overlapping candidate is finally chosen. - *

- *

- * The detection and removal of labels that overlap with edges may increase the runtime of this algorithm. - *

- * @type {boolean} - */ - removeEdgeOverlaps:boolean; - /** - * Gets or sets whether or not the number of ambiguous label placements is reduced by applying an additional optimization - * step. - *

- * A label position is considered to be ambiguous if it might not be possible to identify to which graph element the label - * belongs. For example, an edge label placed in between two edges is ambiguous. - *

- *

- * Enabling this reduction step does not guarantee that no ambiguous placements are selected. The algorithm will try to - * avoid them if other good positions without ambiguity are available. Other aspects like {@link yfiles.layout.PreferredPlacementDescriptor preferred placement} for edge - * labels will still be more important than the reduction of ambiguity. - *

- * @type {boolean} - */ - reduceAmbiguity:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.labeling.MISLabelingBase; - } - /** - * Specifies custom data for the {@link yfiles.labeling.GenericLabeling}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface LabelingData extends yfiles.layout.LayoutData{} - export class LabelingData { - constructor(); - /** - * Gets or sets the collection of labels that shall be placed by the algorithm. - *

- * Note that the {@link yfiles.layout.DpKeyItemCollection.#dpKey} has to be set to the key assigned to {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey}. - *

- * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedLabels:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the mapping from node labels to an {@link yfiles.layout.INodeLabelLayoutModel} used by the labeling algorithm - * instead of the original label model. - *

- * If a label has no mapping, the original model is used as normal. - *

- * @see yfiles.labeling.LabelingBase#LABEL_MODEL_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeLabelModels:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edge labels to an {@link yfiles.layout.IEdgeLabelLayoutModel} used by the labeling algorithm - * instead of the original label model. - *

- * If a label has no mapping, the original model is used as normal. - *

- * @see yfiles.labeling.LabelingBase#LABEL_MODEL_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelModels:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.labeling.LabelingData; - } - }export namespace organic{ - export enum InitialPlacement{ - /** - * Initial placement strategy for starting with randomly chosen node locations. - * @see yfiles.organic.ClassicOrganicLayout#initialPlacement - */ - RANDOM, - /** - * Initial placement strategy for starting with all node location coordinates set to 0. - *

- * This strategy is best if the initial placement should be maximally neutral, ignoring the existing layout of the input - * graph. - *

- * @see yfiles.organic.ClassicOrganicLayout#initialPlacement - */ - ZERO, - /** - * Initial placement strategy for starting with the node locations as they are in the input graph. - *

- * This strategy is best if the existing layout should change as little as possible. - *

- * @see yfiles.organic.ClassicOrganicLayout#initialPlacement - */ - AS_IS - } - export enum GroupsPolicy{ - /** - * Group handling policy for considering and arranging the nodes contained in a group such that their togetherness is - * highlighted. - * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy - */ - LAYOUT, - /** - * Group handling policy for keeping the relative positions of nodes that belong to the same group fixed. - *

- * The fixed groups will be taken into account when placing the other nodes of the graph. - *

- *

- * By registering a {@link yfiles.algorithms.IDataProvider} with key - * {@link yfiles.organic.ClassicOrganicLayout#FIXED_GROUP_NODES_DP_KEY}, the individual group nodes can be marked as fixed or not - * fixed. If there is no data provider registered with the mentioned key, then all group nodes of the graph will be treated - * as fixed. - *

- * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy - */ - FIXED, - /** - * Group handling policy for completely ignoring group nodes during the layout process. - * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy - */ - IGNORE - } - export enum Scope{ - /** - * Scope mode indicating that the algorithm should place all nodes of the graph. - * @see yfiles.organic.ClassicOrganicLayout#scope - */ - ALL, - /** - * Scope mode indicating that the algorithm should mainly place a subset of nodes. - *

- * The subset is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY}. Nodes that don't belong to the subset may be moved to a - * certain degree but will keep their relative positions to the other nodes outside the subset. - *

- * @see yfiles.organic.ClassicOrganicLayout#scope - * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY - */ - MAINLY_SUBSET, - /** - * Scope mode indicating that the algorithm should only place a subset of nodes. - *

- * The subset is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY}. Nodes not being part of the subset will remain at their - * location. - *

- * @see yfiles.organic.ClassicOrganicLayout#scope - * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY - */ - SUBSET - } - export enum HorizontalOverlapCriterion{ - /** - * Horizontal overlap criterion defining an overlap as horizontal if the overlapping area is greater in height than in - * width. - *

- * Otherwise, if the overlap area's width is greater than or equal to its height, an overlap will be categorized as - * vertical. - *

- *

- * The area of an overlap is defined as the rectangle where two nodes intersect with each other. - *

- * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion - */ - INTERSECTION_BOX, - /** - * Horizontal overlap criterion categorizing an overlap as horizontal if the center-to-center difference between the - * overlapping nodes is greater in horizontal direction (x-coordinates) than in vertical direction (y-coordinates). - *

- * Otherwise, if the center-to-center difference between two overlapping nodes is greater in vertical direction - * (y-coordinates), the corresponding overlap is categorized as vertical. The same applies if the differences in vertical - * and horizontal direction are equal. - *

- * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion - */ - NODE_CENTER, - /** - * Horizontal overlap criterion categorizing an overlap as horizontal if the required movement for solving the overlap is - * shorter in horizontal direction than in vertical direction. - *

- * Otherwise, an overlap will be categorized as vertical. - *

- *

- * This criterion tries to avoid moving nodes too much because the direction for resolving overlaps will be chosen such - * that the shorter movement is preferred. - *

- * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion - */ - LESS_MOVEMENT - } - export enum ChainSubstructureStyle{ - /** - * Substructure style specifier for chains that indicates that the algorithm does not handle such structures in a special - * way. - * @see yfiles.organic.OrganicLayout#chainSubstructureStyle - */ - NONE, - /** - * Substructure style specifier for chains that leads to a compact (rotated) rectangular layout style for chains. - * @see yfiles.organic.OrganicLayout#chainSubstructureStyle - */ - RECTANGULAR, - /** - * Substructure style specifier for chains that leads to a straight-line layout style for chains. - * @see yfiles.organic.OrganicLayout#chainSubstructureStyle - */ - STRAIGHT_LINE - } - export enum StarSubstructureStyle{ - /** - * Substructure style specifier for stars that indicates that the algorithm does not handle such structures in a special - * way. - * @see yfiles.organic.OrganicLayout#starSubstructureStyle - */ - NONE, - /** - * Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed in the - * middle. - * @see yfiles.organic.OrganicLayout#starSubstructureStyle - */ - RADIAL, - /** - * Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed on the - * outside (separated from the nodes with degree one). - * @see yfiles.organic.OrganicLayout#starSubstructureStyle - */ - SEPARATED_RADIAL, - /** - * Substructure style specifier for stars that leads to a circular layout style for stars where the root is placed in the - * middle. In contrast to the radial layout style, all nodes (except the root) are placed on a single cycle. - * @see yfiles.organic.OrganicLayout#starSubstructureStyle - */ - CIRCULAR - } - export enum ParallelSubstructureStyle{ - /** - * Substructure style specifier for parallel structures that indicates that the algorithm does not handle such structures - * in a special way. - * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle - */ - NONE, - /** - * Substructure style specifier for parallel structures that leads to a (rotated) rectangular layout style for the inner - * nodes. - * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle - */ - RECTANGULAR, - /** - * Substructure style specifier for parallel structures that leads to a radial layout style for the inner nodes. - * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle - */ - RADIAL, - /** - * Substructure style specifier for parallel structures that places the inner nodes on a straight-line. - * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle - */ - STRAIGHT_LINE - } - export enum CycleSubstructureStyle{ - /** - * Substructure style specifier for cycle structures that indicates that the algorithm does not handle such structures in a - * special way. - * @see yfiles.organic.OrganicLayout#cycleSubstructureStyle - */ - NONE, - /** - * Substructure style specifier for cycle structures that leads to a circular layout style. - * @see yfiles.organic.OrganicLayout#cycleSubstructureStyle - */ - CIRCULAR - } - export enum GroupNodeMode{ - /** - * A mode constant for placing and resizing the group nodes and their content by the layout algorithm. The size of the - * group is adjusted to the space that is needed by the placement of its contained nodes. - * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY - */ - NORMAL, - /** - * A mode constant for placing the group nodes and their content with respect to the original bounds of the group node. The - * bounds of the group nodes are treated as fixed and cannot be exceeded by the content of the group nodes. - * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY - */ - FIX_BOUNDS, - /** - * A mode constant for placing group nodes with fixed content. Although these particular group nodes can move like all - * other ordinary group nodes, their content remains fixed relative to the position of the group node. - * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY - */ - FIX_CONTENTS - } - /** - * This layout algorithm removes overlaps between nodes in a graph. - *

- * Note: The usage of {@link yfiles.organic.RemoveOverlapsStage} instead of this class is recommended for most use cases involving the - * mere removal of overlaps. That stage offers a more powerful strategy to do the task. - *

- *

- * Layout Style - *

- *

- * The style of results often resembles the look of tiles which have been dropped onto each other, where tiles correspond - * to nodes of the graph. The reason is that overlapping nodes are moved in order to resolve the overlap. During this - * process, several nodes moving in the same direction may be stacked next to or above each other. - *

- *

- * This algorithm does not route the edges of the input graph - edges might although be stretched due to the node - * movement. - *

- *

- * {@graph {"ann":{"s":[88,86],"d":0},"n":[[10,161.5,100,157],[-14,262.5],[-44,292.5],[-74,322.5],[-104,352.5],[-134,382.5],[46,262.5],[76,292.5],[106,322.5],[136,352.5],[166,382.5],[-100,198.5,320,46],[37.5,139,45,45],[195,181.5,30,73.5],[-105,181.5,30,73.5],[537.5,56,100,157],[513.5,219],[483.5,311],[453.5,403],[423.5,495],[393.5,587],[607.5,219],[603.5,311],[633.5,403],[663.5,495],[693.5,587],[458.5,4,320,46],[565,-55.5,45,45],[784.5,-13.25,30,73.5],[422.5,-13.25,30,73.5]],"e":[],"vp":[-134.0,-56.0,949.0,729.0]}} Example with overlaps (left) and after executing the shuffle layout (right) {@graph {"ann":{"s":[65.2,39.6],"d":0},"n":[[360.9,272.2],[360.9,345.2],[575.9,369.2],[378.9,401.2],[494.4,369.2],[528.4,257.7],[538.4,313.2],[657.4,369.2],[619.9,313.2],[-2.6,293],[-2.6,365.8],[173.4,369.2],[15.4,391],[130.6,383],[165.2,278.6],[174.8,296.2],[203.8,383],[191.4,309.2]],"e":[[6,0],[6,3],[1,6],[1,0],[6,5],[8,2],[15,9],[15,12],[10,15],[10,9],[15,14],[17,11]],"vp":[-3.0,257.0,726.0,184.0]}} Example with overlaps (left) and after - * executing the shuffle layout (right) Concept Nodes overlapping with other nodes will be moved in horizontal or vertical - * direction in order to remove overlaps. The concept behind this removal step is based on a famous Russian arcade game. Features - *

- *

- * This layout stage can also be {@link yfiles.organic.ShuffleLayout#applyLayout executed} on its own, without specifying a {@link yfiles.organic.ShuffleLayout#coreLayout core layout algorithm}. - *

- *

- * A minimum distance between nodes can be specified such that not only overlaps will be removed but nodes will keep this - * specified distance to other nodes. This distance can be defined separately for each node using a {@link yfiles.algorithms.IDataProvider} - * registered with key {@link yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY}. The minimum distance can also be specified - * globally via {@link yfiles.organic.ShuffleLayout#minimumNodeDistance}. - *

- *

- * To specify that specific nodes should not be moved, they can be marked as fixed using a {@link yfiles.algorithms.IDataProvider} - * registered with key {@link yfiles.organic.ShuffleLayout#FIXED_NODE_DP_KEY}. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface ShuffleLayout extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class ShuffleLayout { - /** - * Creates a new instance of {@link yfiles.organic.ShuffleLayout} with default settings. - */ - constructor(); - /** - * Performs the overlap removal (shuffle) algorithm on the given graph, after the {@link yfiles.organic.ShuffleLayout#coreLayout core layout algorithm} was applied to it. - * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for specifying a minimum distance for each node - *

- * The default minimum distance specified by {@link yfiles.organic.ShuffleLayout#minimumNodeDistance} will be ignored for a node if the {@link yfiles.algorithms.IDataProvider} registered - * with this key contains a valid minimum distance for that node. - *

- *

- * Minimum distance values need to be greater than 0. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static MINIMUM_DISTANCE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking nodes as fixed - *

- * A node marked as fixed will not be moved by this algorithm but stay at its current position. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the criterion for marking an overlap as horizontal. - *

- * This criterion influences how overlaps will be resolved. If an overlap is considered horizontal, it will preferably be solved by - * moving nodes horizontally, else vertically. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given criterion is unknown - * @type {yfiles.organic.HorizontalOverlapCriterion} - */ - horizontalOverlapCriterion:yfiles.organic.HorizontalOverlapCriterion; - /** - * Gets or sets the default minimum distance that has to be obeyed between any two nodes. - *

- * This default distance will be considered for a node if the {@link yfiles.algorithms.IDataProvider} registered with the graph - * with key {@link yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY} does not contain a valid, positive distance for that node. - * If there is no {@link yfiles.algorithms.IDataProvider} registered with the mentioned key, then this default distance will be - * applied to all nodes. - *

- *

- * The minimum distance needs to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - * @see yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets whether or not the simple, fast layout mode of this algorithm is active. - *

- * Enabling this mode, the overlap removal step will be executed using a simpler and less sophisticated approach. All - * overlaps will only be solved by moving nodes vertically. The algorithm will not try to figure out which direction might - * be better for overlap removal. - *

- *

- * The runtime will improve, but results may be of lower quality when using this mode. - *

- * @type {boolean} - */ - simpleMode:boolean; - /** - * Gets or sets whether or not the barycenter mode is used for node shuffling when removing overlaps. - *

- * If this mode is active, the overlap removal step will be executed two times for each direction, once with the normal - * node ordering and once with the reversed ordering. Finally, the barycenter between both results will be used for - * assigning the node coordinates. - *

- *

- * Activating the barycenter mode allows more symmetric results for some graphs. However, the runtime might increase. - *

- * @type {boolean} - */ - barycenterMode:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.ShuffleLayout; - } - /** - * A layout algorithm that arranges graphs in an organic fashion, using a force-directed drawing approach. - *

- * Layout Style - *

- *

- * The organic layout style is characterized by a natural distribution of nodes. It is well suited to exhibit clusters and - * symmetric properties of a graph. Nodes are placed in a space-saving manner, close to their adjacent nodes. Distances - * between neighbors and edge lengths are highly uniform and edges are drawn as straight-line segments without bends. - *

- *

- * Organic diagrams are well suited for visualizing relations in large networks, for example, in bioinformatics, enterprise - * networking, social networks visualization, mesh visualization or system management. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[595.38,758.73,90,90],[1117.49,809.3],[536.78,520.64],[1003.62,223.83,60,60],[144.24,1098.18,60,60],[821.57,320.27,60,60],[1021.74,95.55],[546.05,952.52],[339.03,1117.6],[619.72,286.05,60,60],[459.77,255.26],[819.8,180.32],[352.63,758.67],[602.52,1268.98],[418.51,994.58],[1203,194.02],[474.19,1194.71],[1369.52,207.86],[1229.77,66.55],[1130.53,480.76],[1026.12,377.23],[416.54,865.26],[1405.72,431.59],[742.7,1277.43],[576.4,127.48],[818.41,57.66],[609.01,0],[107.77,1267.45],[468.43,35.76],[168.05,858.48],[1479.05,113.81],[347.41,29.93],[363.19,151.7],[1317.66,551.96],[648.62,1164.37],[1213.89,683.56],[1463.15,308.66],[343.86,303.87],[1583.67,28.36],[221.25,1242],[551.17,1091.78],[652.84,482.26,90,90],[257.56,950.62],[1317.11,333.14],[1249.57,431.4],[1180.69,326.71],[1213.95,579.36],[987.92,896.99],[798.79,926.46,60,60],[766.38,1113.01,60,60],[1027.6,1013.7],[921.45,1059.25],[900.59,1191.83],[863.5,1315.51],[0,1086.46],[73.01,996.02],[17.49,1193.73],[1112.66,599.54],[1026.84,506.48]],"e":[[5,3,-2.34,-4.42,-2.34,-4.42],[5,3,-0,5.66,0,5.66],[6,3],[0,7],[8,4],[5,9,-0.84,4.93,-0.84,4.93],[5,9,0,-5.07,0,-5.07],[9,10],[5,11],[7,14],[14,8],[3,15],[8,16],[13,16],[15,17],[15,18],[5,20],[3,20],[20,19],[14,21],[0,21,1.55,4.23,1.55,4.23],[0,21,0,-4.79,0,-4.79],[21,12],[23,13],[9,24],[11,25],[24,26],[4,27],[24,28],[17,30],[28,31],[10,32],[32,31],[22,33],[34,13],[33,35],[35,1],[17,36],[36,22],[10,37],[30,38],[4,39],[7,40],[34,40],[40,16],[0,41,-4.9,-1.02,-4.9,-1.02],[0,41,15.32,0,15.32,0],[0,41,5.11,0,5.11,0],[0,41,-15.32,0,-15.32,0],[41,2],[41,9,-4.88,1.11,-4.88,1.11],[41,5],[41,9,5.13,0,5.13,0],[41,5,0,15.25,13.25,0],[41,5,0,-15.25,-13.25,0],[4,42],[21,42],[42,29],[17,43],[22,43],[33,44],[43,44],[44,19],[15,45],[43,45],[45,44],[45,20],[33,46],[46,19],[46,35],[47,1],[0,48],[0,48,0,-12.87,0,-12.87],[48,47],[48,0,0,12.87,0,12.87],[49,34],[49,23],[49,48,-4.93,-0.86,-4.93,-0.86],[49,48,5.07,0,5.07,0],[50,47],[50,51],[51,48],[51,52],[52,49],[52,53],[53,23],[54,4],[55,4],[4,56],[19,57],[57,46],[57,35],[20,58],[58,19],[58,57]],"vp":[0.0,0.0,1614.0,1346.0]}} Organic layout obtained using default settings {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[791.09,783.74],[562.01,0],[0,578.93],[654.52,397.12],[398.71,661.82],[289.49,301.35],[607.55,181.65],[486.39,286.91],[431.7,133.95],[585.61,83.22],[526.07,132.08],[499.31,59.31],[643.49,286.85],[577.45,334.93],[570.46,256.07],[384.63,282.87],[349.44,208.68],[428.89,217.67],[735.86,604.59],[609.97,735.23],[576.81,577.73],[708.83,495.34],[664.78,560.98],[627.87,490.62],[768.83,700.17],[706.56,764.55],[692.13,688.28],[499.4,712.48],[490.84,632.17],[563.39,666.04],[178.72,621.75],[126.84,449.31],[282.43,497.82],[287.3,654.44],[253.43,582.88],[333.1,587.05],[74.97,603.05],[57.42,516.13],[124.98,543.53],[198.43,365.41],[274.03,396.79],[209.79,443.73]],"e":[[1,9],[9,6],[6,10],[10,9],[10,8],[9,11],[8,11],[11,1],[11,10],[6,12],[12,3],[3,13],[13,12],[13,7],[12,14],[7,14],[14,6],[14,13],[7,15],[15,5],[5,16],[16,15],[16,8],[15,17],[8,17],[17,7],[17,16],[3,21],[21,18],[18,22],[22,21],[22,20],[21,23],[20,23],[23,3],[23,22],[18,24],[24,0],[0,25],[25,24],[25,19],[24,26],[19,26],[26,18],[26,25],[19,27],[27,4],[4,28],[28,27],[28,20],[27,29],[20,29],[29,19],[29,28],[4,33],[33,30],[30,34],[34,33],[34,32],[33,35],[32,35],[35,4],[35,34],[30,36],[36,2],[2,37],[37,36],[37,31],[36,38],[31,38],[38,30],[38,37],[31,39],[39,5],[5,40],[40,39],[40,32],[39,41],[32,41],[41,31],[41,40]],"vp":[0.0,0.0,822.0,814.0]}} Organic layout exposing symmetries of the graph structureConcept - *

- *

- * This algorithm uses a force-directed approach to place the nodes of the input graph. The graph is modeled as a physical - * system with forces acting on it. Nodes are considered as electrically charged particles with mutually repulsive forces. - * Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an equilibrium state of the - * system, i.e., the nodes are rearranged based on the physical forces until the system reaches a (local) minimum of the - * sum of the forces. - *

- *

- * Features - *

- *

- * The {@link yfiles.organic.ClassicOrganicLayout#activateTreeBeautifier tree beautifier} feature activates a special layout style for subgraphs with a tree structure. These subgraphs will - * be arranged using an algorithm dedicated to tree graphs and incorporated into the main organic diagram. - *

- *

- * Several parameters for the internal force-directed drawing algorithm can be modified. For example, the {@link yfiles.organic.ClassicOrganicLayout#repulsion repulsion}, {@link yfiles.organic.ClassicOrganicLayout#attraction attraction} - * and {@link yfiles.organic.ClassicOrganicLayout#initialTemperature initial temperature} can be controlled. This allows experts to configure and fine-tune the algorithm with respect to - * their needs. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface ClassicOrganicLayout extends yfiles.layout.MultiStageLayout{} - export class ClassicOrganicLayout { - /** - * Creates a new {@link yfiles.organic.ClassicOrganicLayout} with default settings. - */ - constructor(); - /** - * Frees internal resources which were in use during a previous algorithm run. - */ - dispose():void; - /** - * Data provider key for marking the nodes that are part of the current scope - * @see yfiles.organic.ClassicOrganicLayout#scope - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking group nodes as fixed - *

- * The content of a fixed group node will not be changed by this algorithm but be treated as fixed. - *

- *

- * The groups marked as fixed will be considered for the {@link yfiles.organic.ClassicOrganicLayout#groupNodePolicy group node policy} settings {@link yfiles.organic.GroupsPolicy#FIXED} and - * {@link yfiles.organic.GroupsPolicy#LAYOUT}. When {@link yfiles.organic.GroupsPolicy#IGNORE} is chosen, the data provider registered with - * this key will be ignored. - *

- * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy - * @see yfiles.organic.GroupsPolicy#FIXED - * @see yfiles.organic.GroupsPolicy#LAYOUT - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_GROUP_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining an individual preferred length for each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static PREFERRED_EDGE_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the node repulsion value. - *

- * The repulsion influences the forces between nodes. A higher repulsion value can lead to more compact drawings, whereas a - * lower repulsion value potentially enlarges drawings. - *

- *

- * The repulsion is defined to range from 0 to 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the repulsion value is negative or greater than 2 - * @type {number} - */ - repulsion:number; - /** - * Gets or sets the edge attraction value. - *

- * The attraction influences the attractive force associated with edges. A higher attraction value can lead to more compact - * drawings, whereas a lower value potentially enlarges drawings. - *

- *

- * The attraction is defined to range from 0 to 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the attraction value is negative or greater than 2 - * @type {number} - */ - attraction:number; - /** - * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance used for calculating the size of group nodes. - * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - /** - * Gets or sets the compactness of group nodes. - *

- * The compactness ranges from 0 to 1 where 0 results in group nodes not affecting the overall layout too much while 1 - * forces nodes in the same group to be clustered tightly. - *

- *

- * The compactness values needs to lie within [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if compactness value does not lie within the interval [0,1] - * @type {number} - */ - groupNodeCompactness:number; - /** - * Gets or sets the policy for the handling of group nodes. - *

- * The group policy defines whether this algorithm {@link yfiles.organic.GroupsPolicy#IGNORE ignores} groups, leaves them {@link yfiles.organic.GroupsPolicy#FIXED fixed} or actively {@link yfiles.organic.GroupsPolicy#LAYOUT arranges} them. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given policy is unknown - * @type {yfiles.organic.GroupsPolicy} - */ - groupNodePolicy:yfiles.organic.GroupsPolicy; - /** - * Gets or sets the initial temperature for the force-directed layout process. - *

- * The algorithm starts with an initial temperature. During the iterations of the layout process, this temperature - * decreases and if it reaches a certain limit, the process terminates. This limit can be controlled using {@link yfiles.organic.ClassicOrganicLayout#finalTemperature}. - *

- *

- * The initial temperature will be multiplied by the {@link yfiles.organic.ClassicOrganicLayout#preferredEdgeLength preferred edge length} and then assigned as the actual initial heat of - * nodes. - *

- * @see yfiles.organic.ClassicOrganicLayout#finalTemperature - * @type {number} - */ - initialTemperature:number; - /** - * Gets or sets the absolute, final temperature value, which will cause the algorithm to stop if the average temperature - * falls under this value. - *

- * The algorithm starts with an initial temperature. During the iterations of the layout process, this temperature - * decreases. - *

- * @see yfiles.organic.ClassicOrganicLayout#initialTemperature - * @type {number} - */ - finalTemperature:number; - /** - * Gets or sets whether or not the deterministic mode of the layout algorithm is enabled. - *

- * In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are - * given as input. - *

- * @type {boolean} - */ - deterministic:boolean; - /** - * Gets or sets whether or not to arrange subtrees of the input graph in a special, optimized tree style. - *

- * Subtrees will be arranged in a {@link yfiles.tree.BalloonLayout balloon-like fashion}. - *

- *

- * If this feature is disabled, subgraphs with a tree structure are arranged using the same style as for the rest of the - * graph. - *

- *

- * In case that the input graph is a {@link yfiles.algorithms.Trees#isRootedTree tree} and this feature is enabled, the whole graph will be drawn in a tree-like style. - *

- * @type {boolean} - */ - activateTreeBeautifier:boolean; - /** - * Gets or sets the gravity factor whose magnitude determines the strength of the force towards the barycenter of the - * graph. - *
    - *
  • A high gravity factor value leads to layouts with nodes clustered around the barycenter of the graph.
  • - *
  • A low gravity factor value stretches the outskirts of the graph far away from the barycenter.
  • - *
- * @type {number} - */ - gravityFactor:number; - /** - * Gets or sets the scope that determines which nodes are placed by this algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown - * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY - * @type {yfiles.organic.Scope} - */ - scope:yfiles.organic.Scope; - /** - * Gets or sets the strategy for the initial placement of nodes. - *

- * The initial placement has an influence on the final result, because this force-directed algorithm starts with some - * positions and then uses forces between nodes to finally aim for a stable result drawing. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given initial placement mode is unknown - * @type {yfiles.organic.InitialPlacement} - */ - initialPlacement:yfiles.organic.InitialPlacement; - /** - * Gets or sets the maximum duration in milliseconds that this layout algorithm is allowed to run. - *

- * The duration needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the iteration factor which influences the maximum number of optimization iterations the algorithm may - * perform. - * @type {number} - */ - iterationFactor:number; - /** - * Gets or sets the default preferred edge length. - *

- * The default preferred edge length will be used for edges that don't have an individual length preference defined via a {@link yfiles.algorithms.IDataProvider} - * registered with key {@link yfiles.organic.ClassicOrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY}. - *

- *

- * The preferred edge length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative - * @type {number} - */ - preferredEdgeLength:number; - /** - * Gets or sets whether or not to consider node sizes during layout calculation. - *

- * If this feature is disabled, overlaps between nodes (e.g. due to large node sizes) may occur. - *

- * @type {boolean} - */ - considerNodeSizes:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.ClassicOrganicLayout; - } - /** - * A {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext} provides control over the layout calculation in the case of - * single-threaded algorithm execution. - * @see yfiles.organic.InteractiveOrganicLayout#startLayout - * @interface - */ - export interface InteractiveOrganicLayoutExecutionContext extends yfiles.lang.Object{ - /** - * Starts the layout calculation, continuing where it has stopped before and allowing a certain maximum duration in - * milliseconds. - * @param duration the duration in milliseconds the layout calculation is allowed to run - * @abstract - */ - continueLayout(duration:number):void; - /** - * Stops the layout calculation. - * @abstract - */ - stopLayout():void; - } - var InteractiveOrganicLayoutExecutionContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.organic.InteractiveOrganicLayoutExecutionContext; - }; - /** - * This algorithm arranges graphs in an organic fashion and offers special functionality to interact with the graph while - * the algorithm is running. - *

- * Besides the organic graph arrangement, this algorithm enables to immediately visualize changes made to a graph. Changes - * can be committed and the layout will be locally updated. That way, live interactions with an adapting graph layout are - * possible. Another advantage is that it is not necessary to compute a completely new layout if only small changes were - * made. - *

- *

- * Layout Style - *

- *

- * This algorithm supports the organic layout style which is characterized by a natural distribution of nodes. It is well - * suited to exhibit clusters and symmetric properties of a graph. Nodes are placed in a space-saving manner and distances - * between neighbors are highly uniform. Edges maintain uniform lengths too and are routed with straight-line segments - * without bends. - *

- *

- * Organic diagrams are well suited for visualizing relations in large networks, for example, in bioinformatics, enterprise - * networking, social networks visualization, mesh visualization or system management. - *

- *

- * {@graph {"ann":{"s":[48,48],"d":0,"c":1},"n":[[-2901.1,82.94],[-2776.3,150.06],[-3044.96,-84.47],[-3100.49,54.95],[-3341.59,-232.28],[-3150.07,-159.49],[-2593.59,-25.02],[-2797.37,369.15],[-2792.54,582.9],[-2408.44,-110.43],[-3646.34,-1285.02],[-2406.36,-423.92],[-2508.48,535.38],[-3061.33,-181.39],[-3576.11,-153.25],[-3291.19,-446.62],[-3232.03,168.75],[-2991.88,23.83],[-2875.69,-19.77],[-3311.02,255.49],[-3211.58,273.66],[-3238.43,-589.82],[-3371.25,-336.26],[-3780.22,-96.13],[-2438.22,451.91],[-2348.8,552.52],[-2524.48,-582.24],[-2397.54,-234.83],[-3717.44,-1204.02],[-3539.82,-1255.44],[-2280.66,-209.75],[-2305.78,-69.98],[-2710.41,513.62],[-2747.74,704.16],[-2823.23,749.08],[-2354.53,12.96],[-2918.36,-219.22],[-2746.37,809.37],[-2657.24,754.28],[-3054.29,380.79],[-2235.49,-319.69],[-3521.75,-1120.87],[-3498.17,-1358.62],[-3729.27,-1087.89],[-2661.13,-725.91],[-2220.36,485.66],[-2577.32,481.65],[-2278.76,391.75],[-3911.01,-117.89],[-3889.39,-12.86],[-3449.65,-560.78],[-3236.89,-238.15],[-3271.16,-341.32],[-3062.01,-674.62],[-3372.21,-829.48],[-3343.54,161.81],[-3403.91,-648.81],[-2650.26,75.72],[-2655.19,191.31],[-2482.07,33.2],[-2545.18,138.92],[-3389.07,735.04],[-3233.93,-696.37],[-3571.23,-672.16],[-3451.64,-420.88],[-3550.73,-949.47],[-3331.67,-944.96],[-3058.81,-774.77],[-2903.06,-735.09],[-3508.46,-749.04],[-3962.39,59.51],[-4014.76,-33.26],[-4162.59,-51.88],[-2213.5,331.67],[-2143.12,434.04],[-2082.3,582.85],[-2563.73,-859.16],[-3872.43,-1134.67],[-2276.55,-427.33],[-3065.02,511.6],[-3216.65,13.18],[-3228.93,507],[-2666.53,647.27],[-2828.44,878.41],[-2888.55,-350.13],[-2803.46,-224.75],[-2274.13,227.36],[-2702.86,-255.45],[-2938.6,-442.63],[-2801.51,-416.97],[-2850.68,986.11],[-3315.58,637.75],[-3335,498.26],[-3322.98,-0.08],[-2999.45,592.68],[-3121.13,611.43],[-2191.35,-498.52],[-3933.14,-1230.72],[-3975.46,-1097.6],[-2618.48,-953.77],[-2458.11,-831.59],[-2490.11,-956.72],[-2049.18,482.82],[-1967.47,616.36],[-2076.61,696.43],[-4236.41,-130.92],[-4253.91,12.07],[-4056.39,65.42],[-2834.31,-815.64],[-2994.48,-872.19],[-3118.99,-869],[-3291.19,-1046.13],[-3606.59,-1027.04],[-3652.5,-907.63],[-3531.64,-338.57],[-3562.98,-455.05],[-3659.45,-608.85],[-3667.52,-730.4],[-3453.32,820.54],[-2454.91,197.69],[-2634.6,286.15]],"e":[[0,1],[0,2],[2,3],[2,4],[2,5],[1,6],[1,7],[7,8],[6,9],[5,13],[13,2],[4,14],[4,15],[3,16],[3,17],[17,18],[18,2],[16,19],[16,20],[20,19],[15,21],[22,4],[14,23],[12,24],[12,25],[11,26],[11,27],[10,28],[10,29],[9,30],[9,31],[8,32],[32,12],[8,33],[8,34],[34,33],[31,35],[27,35],[36,2],[34,37],[37,33],[33,38],[38,37],[32,39],[30,40],[29,41],[29,42],[28,43],[26,44],[25,45],[24,46],[46,12],[46,32],[24,47],[47,45],[23,48],[23,49],[22,50],[22,51],[51,5],[21,52],[21,53],[21,54],[19,55],[55,16],[50,56],[18,57],[57,58],[57,59],[59,35],[57,60],[56,62],[62,21],[56,63],[52,64],[50,64],[54,65],[43,65],[41,65],[54,66],[53,67],[62,67],[53,68],[44,68],[68,67],[50,69],[69,63],[69,65],[49,70],[49,71],[48,71],[70,71],[72,71],[47,73],[73,45],[47,74],[45,74],[45,75],[44,76],[43,77],[40,78],[78,11],[39,79],[39,80],[80,52],[39,81],[38,82],[82,33],[82,32],[37,83],[83,34],[36,84],[36,85],[35,86],[86,47],[86,73],[85,87],[84,88],[84,89],[83,90],[81,91],[61,91],[81,92],[80,93],[79,94],[79,95],[78,96],[77,97],[77,98],[76,99],[76,100],[76,101],[75,102],[74,102],[75,103],[75,104],[72,105],[72,106],[71,107],[70,107],[68,108],[67,109],[67,110],[66,111],[65,112],[65,113],[64,114],[64,115],[63,116],[63,117],[61,118],[60,119],[58,120]],"vp":[-4254.0,-1359.0,2335.0,2394.0]}} Organic layout obtained using this algorithmConcept - *

- *

- * The internal basis for computing actual layouts is a force-directed approach placing the nodes of the input graph. The - * graph is modeled as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged - * particles with mutually repulsive forces. Edges are modeled as forces that attract adjacent nodes. A good diagram is - * obtained from an equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the - * system reaches a (local) minimum of the sum of the forces. - *

- *

- * Features - *

- *

- * Several update methods allow to indicate lightweight changes on the graph, for example, {@link yfiles.organic.InteractiveOrganicLayout#setCenter} - * for node location updates. These updates will be scheduled and executed at a specific point within the life-cycle of the - * layout algorithm. They are ideally suited for usage in interactive scenarios, where users, for example, change node - * positions via mouse-dragging. - *

- *

- * Method {@link yfiles.organic.InteractiveOrganicLayout#addStructureUpdate} allows to schedule a custom event handler instance - * that is executed in a synchronized context and can safely update the structure of the graph. - *

- *

- * Usage Hints - *

- *

- * It is easiest to start the algorithm using {@link yfiles.organic.InteractiveOrganicLayout#startLayout}. Furthermore, it is - * strongly recommended to start it by passing a copy of the original graph (i.e. a {@link yfiles.layout.CopiedLayoutGraph} - * instance) as parameter to the mentioned method. - *

- *

- * Importantly, changes will not be automatically applied to the input graph. Updates can be scheduled via various methods (e.g. - * {@link yfiles.organic.InteractiveOrganicLayout#setCenter}). The whole layout will then internally be adjusted accordingly and - * changes are stored as intermediate results. Such intermediate results can be {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} in order to apply them to the - * actual graph. - *

- * @class - * @implements {yfiles.layout.ILayoutAlgorithm} - */ - export interface InteractiveOrganicLayout extends yfiles.lang.Object,yfiles.layout.ILayoutAlgorithm{} - export class InteractiveOrganicLayout { - /** - * Creates a new instance of the {@link yfiles.organic.InteractiveOrganicLayout} with default settings. - */ - constructor(); - /** - * Schedules an update for the structure of the graph, which will automatically be executed at a later point in the - * life-cycle of this algorithm. - *

- * The given event handler will be queued and executed at a specific time. The event handler can make structural changes - * (e.g. removal/creation of edges or nodes). They will be synchronized with the rest of the layout algorithm. - *

- * @param handler The handler delegate that will be invoked using null as the sender and evt as the event arguments - * @param evt The event argument that will be piped to the handler invocation. - */ - addStructureUpdate(handler:(sender:any,evt:yfiles.lang.EventArgs)=>void,evt:yfiles.lang.EventArgs):void; - /** - * Calculates an organic layout for the given input graph, however, the layout is not automatically applied to the graph. - *

- * Changes have to be {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} to update the graph with the actual calculated positions. - *

- * @param graph the input graph - * @see yfiles.organic.InteractiveOrganicLayout#startLayout - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Writes calculated intermediate locations of nodes and edges to the actual graph. - *

- * Update methods like {@link yfiles.organic.InteractiveOrganicLayout#setCenter} schedule changes which cause that the whole layout - * will internally be adjusted. All adjustments are stored as intermediate results. This method immediately transfers all - * these intermediate results to the actual input graph. - *

- * @see yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly - */ - commitPositions():void; - /** - * Writes calculated intermediate locations of nodes and edges to the actual graph and returns the largest movement value. - *

- * Update methods like {@link yfiles.organic.InteractiveOrganicLayout#setCenter} schedule changes which cause that the whole layout - * will internally be adjusted. All adjustments are stored as intermediate results. This method smoothly transfers all - * these intermediate results to the actual input graph. - *

- *

- * Positions are, however, not transferred directly (use {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} if that is intended). Instead, the - * nodes are moved towards the calculated position. The movement is restricted to the given maximum distance. - *

- *

- * The movement will be calculated as (movement) = (factor) * (distance between calculated and actual location) - *

- *

- * The returned largest movement can be used for estimating the difference between calculated layout and actual positions. - * If the return value is 0, the calculated layout was completely transferred. - *

- * @param maxMovement the maximum distance a node will be moved - * @param factor a factor that determines the node movement - * @returns the largest movement value or 0, if the calculated layout has been transferred completely - * @see yfiles.organic.InteractiveOrganicLayout#commitPositions - */ - commitPositionsSmoothly(maxMovement:number,factor:number):number; - /** - * Disables all predefined {@link yfiles.layout.ILayoutStage}s so that upon {@link yfiles.organic.InteractiveOrganicLayout#applyLayout} - * only the internal organic layout algorithm will be executed. - *

- * This method is called upon construction of this class so that by default additional - * {@link yfiles.layout.ILayoutStage}s are deactivated. This method may be overridden if the additional stages should stay active - * (e.g. override the method and return silently). - *

- * @see yfiles.layout.MultiStageLayout#disableAllStages - */ - disableAllStages():void; - /** - * Polls the current coordinates of the center of the given node. - *

- * The returned coordinates do not necessarily correspond to the actual location of the node in the input graph. They may - * only be intermediate results stored in the algorithm. This will be the case if scheduled updates were not yet completely - * {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} to the actual graph. - *

- * @param node the node for which the center should be polled - * @returns the {@link } representing the center location of the given node, or null if nothing about the node is - * known - * @see yfiles.organic.InteractiveOrganicLayout#setCenter - */ - getCenter(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; - /** - * Polls the current x-coordinate of the center location of the given node. - *

- * The returned coordinate is not necessarily the actual x-coordinate of the node in the input graph but only an - * intermediate result stored in the algorithm. This will be the case if scheduled updates were not yet completely {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} - * to the actual graph. - *

- * @param node the node for which the x-coordinate should be polled - * @returns the x-coordinate of the center location of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setCenterX - */ - getCenterX(node:yfiles.algorithms.Node):number; - /** - * Polls the current y-coordinate of the center location of the given node. - *

- * The returned coordinate is not necessarily the actual y-coordinate of the node in the input graph but only an - * intermediate result stored in the algorithm. This will be the case if scheduled updates were not yet completely {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} - * to the actual graph. - *

- * @param node the node for which the y-coordinate should be polled - * @returns the y-coordinate of the center location of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setCenterY - */ - getCenterY(node:yfiles.algorithms.Node):number; - /** - * Polls the current stress value of a given node. - *

- * The stress value indicates how far a node will possibly move. The higher the stress of a node is, the farther it may - * move. - *

- *

- * The stress value is defined to be a value from the interval [0,1]. - *

- * @param node the node for which the stress value should be polled - * @returns the stress value of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setStress - */ - getStress(node:yfiles.algorithms.Node):number; - /** - * Schedules an update for the center location of the given node. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node that should be updated - * @param x the desired x-coordinate of the given node - * @param y the desired y-coordinate of the given node - */ - setCenter(node:yfiles.algorithms.Node,x:number,y:number):void; - /** - * Schedules an update for the center location's x-coordinate of the given node. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node that should be updated - * @param x the desired x-coordinate of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setCenterY - * @see yfiles.organic.InteractiveOrganicLayout#setCenter - */ - setCenterX(node:yfiles.algorithms.Node,x:number):void; - /** - * Schedules an update for the center location's y-coordinate of the given node. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node that should be updated - * @param y the desired y-coordinate of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setCenterX - * @see yfiles.organic.InteractiveOrganicLayout#setCenter - */ - setCenterY(node:yfiles.algorithms.Node,y:number):void; - /** - * Schedules an update for the inertia of the given node. - *

- * The inertia is defined to be a value from the interval [0,1]. - *

- *
    - *
  • 1.0: The node will not move.
  • - *
  • 0.5: The node will only move half as far as it would with an inertia of 0.0.
  • - *
  • 0.0: The node will move as fast as possible.
  • - *
- *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node whose inertia to set - * @param inertia an inertia value between 0 and 1 - * @throws {Stubs.Exceptions.ArgumentError} if the given inertia value is negative or greater than 1 - */ - setInertia(node:yfiles.algorithms.Node,inertia:number):void; - /** - * Schedules an update for the preferred length of the given edge. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param edge the edge whose preferred length should be updated - * @param newEdgeLength the new preferred edge length - */ - setPreferredEdgeLength(edge:yfiles.algorithms.Edge,newEdgeLength:number):void; - /** - * Schedules an update for the radius of the given node. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node whose radius should be updated - * @param radius the desired radius for the given node - */ - setRadius(node:yfiles.algorithms.Node,radius:number):void; - /** - * Schedules an update for the stress value of the given node. - *

- * The stress value indicates how far a node will possibly move. The higher the stress of a node is, the farther it may - * move. - *

- *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- *

- * The stress value is defined to be a value from the interval [0,1]. - *

- * @param node the node whose stress value should be updated - * @param stress a stress value from the interval [0,1] - * @throws {Stubs.Exceptions.ArgumentError} if the given stress value is negative or greater than 1 - */ - setStress(node:yfiles.algorithms.Node,stress:number):void; - /** - * Creates a {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext context object} that provides methods to continue and {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext#stopLayout stop} the layout calculation for running this layout - * algorithm in a single-threaded environment. - *

- * Usage: Call doLayout(long) on the created instance to run the actual layout calculation for some specified period of time, - * whenever the layout should be recalculated. To actually transfer the changes, {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * should be called subsequently. - *

- * @param graph the input graph - * @returns a {@link context instance} to control layout calculation - * @see yfiles.organic.InteractiveOrganicLayoutExecutionContext - * @see yfiles.organic.InteractiveOrganicLayout#applyLayout - */ - startLayout(graph:yfiles.layout.LayoutGraph):yfiles.organic.InteractiveOrganicLayoutExecutionContext; - /** - * Stops the layout algorithm. - *

- * In contrast to - * {@link yfiles.organic.InteractiveOrganicLayout#stopAndWait}, the algorithm terminates immediately and will not wait until the - * ongoing layout calculation is finished. - *

- * @see yfiles.organic.InteractiveOrganicLayout#stopped - * @see yfiles.organic.InteractiveOrganicLayout#stopAndWait - */ - stop():void; - /** - * Stops a previously {@link yfiles.organic.InteractiveOrganicLayout#startLayout started} algorithm and then blocks until the current layout calculation is completed. - * @see yfiles.organic.InteractiveOrganicLayout#stopped - * @see yfiles.organic.InteractiveOrganicLayout#stop - */ - stopAndWait():void; - /** - * Synchronizes the structure of the graph copy with the original graph. - * @throws {Stubs.Exceptions.InvalidOperationError} if the currently handled graph is not of type {@link yfiles.layout.CopiedLayoutGraph} - */ - syncStructure():void; - /** - * Wakes up the algorithm with the effect that it will restart/continue the layout calculation. - *

- * This method is useful if the layouter is {@link yfiles.organic.InteractiveOrganicLayout#sleeping sleeping} but should be notified of changes (e.g. due to user interaction). - *

- * @see yfiles.organic.InteractiveOrganicLayout#sleeping - */ - wakeUp():void; - /** - * Gets the time when the last wake-up, that is, call to {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}, occurred. - *

- * The time is defined in terms of the difference between the current time and midnight, January 1, 1970 UTC, measured in - * milliseconds. - *

- * @type {number} - */ - lastWakeupTime:number; - /** - * Gets whether or not this layout algorithm has stopped. - *

- * If the algorithm has stopped, it terminated all its layout calculations. It is not {@link yfiles.organic.InteractiveOrganicLayout#running running} anymore and can not be - * restarted/continued by calling {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}. - *

- * @type {boolean} - */ - stopped:boolean; - /** - * Gets whether or not this layout algorithm is currently sleeping. - *

- * Sleeping indicates that the algorithm has not {@link yfiles.organic.InteractiveOrganicLayout#stopped stopped} yet but is waiting (i.e. doing nothing). It can be notified to - * continue its work using {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}. - *

- * @see yfiles.organic.InteractiveOrganicLayout#wakeUp - * @type {boolean} - */ - sleeping:boolean; - /** - * Gets whether or not this layout algorithm is currently running. - *

- * The algorithm is running if the layout process is still active, the algorithm has not {@link yfiles.organic.InteractiveOrganicLayout#stopped stopped} yet and is not {@link yfiles.organic.InteractiveOrganicLayout#sleeping sleeping}. - *

- * @type {boolean} - */ - running:boolean; - /** - * Gets or sets the working ratio which defines the amount of processor time this algorithm tries to get. - *

- * A working ratio value of 1 means that the algorithm will try to run as fast as possible. Lower values will lead to small - * breaks after each internal round. - *

- *

- * The ratio needs to be a value in (0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is not in (0,1]. - * @type {number} - */ - workingRatio:number; - /** - * Gets or sets the default preferred edge length. - *

- * This length does not define the actual absolute length of edges, but the layout algorithm considers the specified - * preference where possible. - *

- *

- * The preferred edge length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative - * @see yfiles.organic.InteractiveOrganicLayout#setPreferredEdgeLength - * @type {number} - */ - preferredEdgeLength:number; - /** - * Gets or sets the preferred distance between nodes. - *

- * The minimum node distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified minimum node distance is negative - * @type {number} - */ - preferredNodeDistance:number; - /** - * Gets or sets the maximum duration in milliseconds that this algorithm is allowed to run. - *

- * The duration needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified maximum duration has a negative value - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the ratio of layout quality versus running time. - *

- * The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout - * calculation. - *

- *

- * The value needs to lie within [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0,1] - * @type {number} - */ - qualityTimeRatio:number; - /** - * Gets or sets an {@link yfiles.organic.OutputRestriction} which restricts the area for the layout result of this algorithm. - * @see yfiles.organic.OutputRestriction - * @type {yfiles.organic.OutputRestriction} - */ - outputRestriction:yfiles.organic.OutputRestriction; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.InteractiveOrganicLayout; - } - /** - * This layout algorithm arranges graphs in an organic fashion. - *

- * Layout Style The organic layout style is characterized by a natural distribution of nodes that exhibits clusters and symmetric - * properties of the graph. Nodes are placed space-saving, close to their adjacent nodes. Edges maintain uniform lengths - * and are routed with straight-line segments without bends. - *

- *

- * Organic diagrams are commonly used for visualizing relations in large networks for example in bioinformatics, enterprise - * networking, visualizing social networks, mesh visualization or system management. - *

- *

- * {@graph {"ann": {"s": [30,30], "d": 1},"n": [[623,552], [719,500], [460,606], [461,312], [650,830], [467,417], [399,245], [710,595], [712,756], [423,492], [336,473], [387,373], [545,645], [883,702], [688,675], [507,226], [796,722], [667,62], [572,158], [470,158], [594,354], [520,352], [615,651], [687,222], [731,111], [950,654], [361,553], [309,325], [365,631], [722,895], [282,570], [496,729], [554,76], [211,540], [308,103], [256,489], [703,312], [850,621], [720,405], [333,181], [658,141], [281,421], [159,261], [791,555], [541,0], [574,864], [777,646], [513,518], [590,745], [611,221], [630,289], [557,278], [663,366], [237,274], [809,470], [874,520], [923,583], [889,446], [958,478], [999,550], [1020,624], [722,835], [626,922], [678,895], [251,867], [406,695], [235,779], [63,939], [130,979], [238,810], [355,820], [166,734], [147,828], [317,756], [94,705], [194,852], [127,898], [195,927], [68,863], [761,971], [693,970], [518,920], [637,1005], [714,1036], [255,203], [330,260], [976,402], [1039,447], [1078,551], [1105,411], [893,782], [958,741], [826,393], [0,980], [734,1109]], "e": [[0,1], [5,3], [6,3], [0,7], [8,4], [5,9,3.45,2.02,3.45,2.02], [5,9,-4.64,0,-4.64,0], [9,10], [5,11], [7,14], [14,8], [3,15], [8,16], [13,16], [15,18], [15,19], [5,21], [3,21], [21,20], [14,22], [0,22], [22,12], [25,13], [9,26], [11,27], [26,28], [4,29], [26,30], [18,32], [30,33], [10,35], [35,33], [23,36], [37,13], [36,38], [38,1], [6,39], [39,34], [18,40], [40,17], [40,24], [40,23], [10,41], [37,43], [43,1], [43,7], [32,44], [4,45], [7,46], [37,46], [46,16], [0,47], [0,47,0,-7.33,0,-7.33], [0,47,0,7.33,0,7.33], [47,2], [47,9,-1.25,4.32,-1.25,4.32], [47,5,-4.1,1.87,-4.1,1.87], [47,9,0,-4.68,0,-4.68], [47,5,4.94,0,4.94,0], [4,48], [22,48], [48,31], [18,49], [23,49], [36,50], [49,50], [50,20], [15,51], [49,51], [51,50], [51,21], [36,52], [52,20], [42,53], [53,27], [54,1], [55,43], [55,54], [56,37], [56,55], [56,25], [57,54], [57,58], [58,55], [58,59], [59,56], [59,60], [60,25], [61,4], [62,4], [4,63], [63,61], [2,65], [31,65], [28,65], [64,66], [68,67], [66,71], [69,72], [66,73], [73,65], [73,70], [73,69], [71,74], [66,75], [69,75], [72,76], [75,76], [76,67], [64,77], [75,77], [77,76], [77,68], [72,78], [78,67], [29,79], [63,80], [45,81], [62,82], [79,83], [80,83], [83,82], [39,84], [84,53], [85,6], [85,27], [58,86], [58,87], [59,88], [87,89], [13,90], [13,91], [54,92], [67,93], [83,94]], "vp": [0.0,0.0,1135.0,1139.0]}} Organic Layout obtained with default settings {@graph {"ann": {"s": [30,30], "d": 1},"n": [[563.5,1043.5], [1196.5,36.5], [-0.5,15.5], [871.5,537.5], [598.5,41.5], [315.5,513.5], [717.5,813.5], [590.5,599.5], [439.5,797.5], [635.5,935.5], [576.5,835.5], [502.5,928.5], [597.5,992.5], [568.5,943.5], [532.5,989.5], [682.5,878.5], [649.5,826.5], [622.5,877.5], [507.5,821.5], [464.5,867.5], [525.5,873.5], [809.5,683.5], [737.5,582.5], [688.5,691.5], [773.5,756.5], [750.5,704.5], [714.5,751.5], [846.5,612.5], [807.5,565.5], [788.5,622.5], [663.5,586.5], [641.5,642.5], [699.5,631.5], [446.5,567.5], [364.5,660.5], [482.5,680.5], [520.5,577.5], [478.5,619.5], [535.5,637.5], [378.5,544.5], [334.5,587.5], [391.5,602.5], [391.5,735.5], [451.5,736.5], [419.5,685.5], [1050.5,277.5], [915.5,36.5], [799.5,257.5], [974.5,416.5], [926.5,304.5], [851.5,397.5], [926.5,481.5], [910.5,424.5], [867.5,467.5], [1022.5,351.5], [991.5,300.5], [965.5,354.5], [861.5,283.5], [820.5,328.5], [877.5,341.5], [1127.5,150.5], [1065.5,34.5], [1011.5,140.5], [1095.5,217.5], [1070.5,162.5], [1035.5,209.5], [1165.5,90.5], [1134.5,34.5], [1107.5,87.5], [990.5,29.5], [966.5,84.5], [1024.5,79.5], [756.5,25.5], [706.5,139.5], [823.5,125.5], [837.5,19.5], [804.5,65.5], [863.5,73.5], [676.5,29.5], [655.5,86.5], [713.5,74.5], [748.5,202.5], [807.5,191.5], [766.5,147.5], [282.5,15.5], [142.5,256.5], [392.5,237.5], [442.5,8.5], [368.5,105.5], [486.5,125.5], [522.5,18.5], [481.5,59.5], [538.5,77.5], [360.5,-0.5], [332.5,51.5], [392.5,46.5], [383.5,171.5], [442.5,185.5], [425.5,128.5], [132.5,15.5], [64.5,127.5], [184.5,121.5], [207.5,9.5], [173.5,58.5], [231.5,64.5], [63.5,14.5], [28.5,68.5], [86.5,65.5], [97.5,194.5], [158.5,188.5], [122.5,141.5], [215.5,393.5], [339.5,373.5], [265.5,282.5], [168.5,329.5], [225.5,332.5], [200.5,278.5], [261.5,457.5], [321.5,442.5], [279.5,401.5], [371.5,307.5], [330.5,261.5], [313.5,318.5]], "e": [[0,12], [12,9], [9,13], [13,12], [13,11], [12,14], [11,14], [14,0], [14,13], [9,15], [15,6], [6,16], [16,15], [16,10], [15,17], [10,17], [17,9], [17,16], [10,18], [18,8], [8,19], [19,18], [19,11], [18,20], [11,20], [20,10], [20,19], [6,24], [24,21], [21,25], [25,24], [25,23], [24,26], [23,26], [26,6], [26,25], [21,27], [27,3], [3,28], [28,27], [28,22], [27,29], [22,29], [29,21], [29,28], [22,30], [30,7], [7,31], [31,30], [31,23], [30,32], [23,32], [32,22], [32,31], [7,36], [36,33], [33,37], [37,36], [37,35], [36,38], [35,38], [38,7], [38,37], [33,39], [39,5], [5,40], [40,39], [40,34], [39,41], [34,41], [41,33], [41,40], [34,42], [42,8], [8,43], [43,42], [43,35], [42,44], [35,44], [44,34], [44,43], [3,51], [51,48], [48,52], [52,51], [52,50], [51,53], [50,53], [53,3], [53,52], [48,54], [54,45], [45,55], [55,54], [55,49], [54,56], [49,56], [56,48], [56,55], [49,57], [57,47], [47,58], [58,57], [58,50], [57,59], [50,59], [59,49], [59,58], [45,63], [63,60], [60,64], [64,63], [64,62], [63,65], [62,65], [65,45], [65,64], [60,66], [66,1], [1,67], [67,66], [67,61], [66,68], [61,68], [68,60], [68,67], [61,69], [69,46], [46,70], [70,69], [70,62], [69,71], [62,71], [71,61], [71,70], [46,75], [75,72], [72,76], [76,75], [76,74], [75,77], [74,77], [77,46], [77,76], [72,78], [78,4], [4,79], [79,78], [79,73], [78,80], [73,80], [80,72], [80,79], [73,81], [81,47], [47,82], [82,81], [82,74], [81,83], [74,83], [83,73], [83,82], [4,90], [90,87], [87,91], [91,90], [91,89], [90,92], [89,92], [92,4], [92,91], [87,93], [93,84], [84,94], [94,93], [94,88], [93,95], [88,95], [95,87], [95,94], [88,96], [96,86], [86,97], [97,96], [97,89], [96,98], [89,98], [98,88], [98,97], [84,102], [102,99], [99,103], [103,102], [103,101], [102,104], [101,104], [104,84], [104,103], [99,105], [105,2], [2,106], [106,105], [106,100], [105,107], [100,107], [107,99], [107,106], [100,108], [108,85], [85,109], [109,108], [109,101], [108,110], [101,110], [110,100], [110,109], [85,114], [114,111], [111,115], [115,114], [115,113], [114,116], [113,116], [116,85], [116,115], [111,117], [117,5], [5,118], [118,117], [118,112], [117,119], [112,119], [119,111], [119,118], [112,120], [120,86], [86,121], [121,120], [121,113], [120,122], [113,122], [122,112], [122,121]], "vp": [-1.0,-1.0,1228.0,1075.0]}} Organic Layout exhibiting symmetric propertiesConcept{@link yfiles.organic.OrganicLayout} - * uses a force-directed approach to place the nodes of the input graph. According to this approach, the graph is modeled - * as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged particles with - * mutually repulsive forces. Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an - * equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the system reaches a - * (local) minimum of the sum of the forces. Features - *

- *

- * The ratio between the layout quality and the running time is conveniently adjustable. - *

- *

- * This layout algorithm is able to consider a {@link yfiles.layout.PartitionGrid} structure. However, for common nodes (i.e. - * non-group nodes) it only considers single partition cells. Furthermore, the layout algorithm will throw a {@link yfiles.lang.Exception} - * if there is a partition grid and the descendants of a group node are assigned to different partition grid cells or if - * there are group nodes that are associated with a group node mode other than {@link yfiles.organic.GroupNodeMode#NORMAL}. - *

- *

- * Although overlaps between edges and nodes are avoided, this layout algorithm doesn't guarantee that they won't appear in - * the resulting layout. To avoid overlaps, it is possible to route the edges afterwards using an edge routing algorithm, - * e.g., {@link yfiles.router.OrganicEdgeRouter}. - *

- *

- * The algorithm is also able to detect certain types of substructures in a graph (i.e., {@link yfiles.organic.OrganicLayout#chainSubstructureStyle chains}, {@link yfiles.organic.OrganicLayout#starSubstructureStyle stars}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle cycles} and - * {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle parallel structures}) and arrange these structures with special-purpose layout styles. Using substructure styles ensures - * that the corrsponding structures are easily recognized in the graph. - *

- *

- * {@graph {"ann":{"s":[50,50],"d":0, "c":1},"n":[[651.02,746.2],[499.25,376.34],[757.43,840.9],[574.93,802.49],[772.23,780.83],[712.08,729.69],[591.5,342.9],[630.22,404.23],[511.3,574.88],[356.15,353.31],[488.74,447.78],[566.25,739.99],[832.31,791.39],[152.43,610.4],[689.57,879.35],[248.1,596.17],[120.25,697.57],[639.18,467.72],[427.77,458.88],[408.48,519.6],[691.9,669.45],[818.01,882.83],[539.8,660.71],[585.22,875.17],[636.28,814.7],[714.64,608.38],[656.9,343.12],[511.04,217.28],[470.75,277.59],[422.59,338.16],[565.7,413.55],[531.15,295.7],[348.61,180.63],[402.12,271.28],[284.34,91.79],[321.78,0],[381.55,66.78],[214.95,158.82],[187.52,306.65],[287.7,278.04],[92.76,309.88],[631.56,613.97],[513.18,814.11],[775.66,700.72],[601.82,679.52],[504.9,731.91],[697.17,813.09],[606.93,266.97],[450.55,583.13],[728.3,327.65],[717.42,253.29],[543.5,154.51],[614.76,150.96],[500.57,513.16],[360.14,445.09],[293.67,694],[348.53,611.5],[206.29,734.57],[571.37,553.51],[0,313.72],[233.88,6.24],[182.4,76.67],[420.47,398.21],[561.25,487.65],[680.21,183.49]],"e":[[0,2],[0,5],[0,3],[0,4],[1,7],[1,6],[1,8],[1,10],[1,9],[0,12],[0,14],[0,11],[15,13],[16,13],[1,17],[1,19],[1,18],[0,24],[0,22],[0,20],[0,23],[0,21],[1,58],[0,25],[0,58],[1,29],[1,31],[1,26],[1,27],[1,28],[1,30],[32,34],[1,33],[32,33],[36,34],[35,34],[37,34],[38,40],[38,39],[0,44],[0,41],[0,46],[0,43],[0,45],[0,42],[1,47],[48,8],[48,58],[48,10],[48,18],[48,19],[50,47],[51,47],[52,47],[49,47],[48,53],[48,54],[1,54],[1,53],[55,56],[56,15],[16,57],[57,55],[56,48],[39,33],[59,40],[60,34],[61,34],[1,62],[48,62],[1,63],[48,63],[64,47]],"vp":[0.0,0.0,883.0,933.0]}} Organic Layout without applying specific layout styles to substructures {@graph {"ann":{"s":[50,50],"d":0,"c":1},"n":[[222.41,751.98],[933.19,715.06],[333.12,751.98],[167.05,656.1],[111.7,751.98],[277.76,656.1],[1075.74,818.63],[987.64,882.64],[826.53,1248.81],[1109.39,715.06],[923.05,1325.6],[250.02,979.37],[167.05,847.86],[283.81,1327.29],[277.76,847.86],[357.8,1251.78],[312.21,1429.13],[1075.74,611.5],[946.75,1221.23],[879.92,1137.62],[451.47,751.98],[352.53,563.47],[425.23,858.43],[425.23,645.53],[352.53,940.5],[250.02,524.59],[790.64,611.5],[756.99,715.06],[790.64,818.63],[987.64,547.49],[878.74,882.64],[878.74,547.49],[1282.21,484.89],[1243.62,401.08],[1488.63,603.97],[1399.06,538.9],[1522.84,498.68],[1399.06,669.05],[1287.59,215.47],[1262.1,323.21],[1313.08,107.74],[50.95,600.08],[141.18,966.16],[0,806.8],[141.18,537.8],[50.95,903.88],[0,697.16],[765.65,208.84],[592.77,1142.94],[799.86,314.13],[799.86,103.55],[676.08,143.76],[676.08,273.91],[772.89,1137.75],[706.25,1221.5],[488.59,1379.94],[460.19,1278.11],[414.6,1455.45],[619.49,1010.84],[1338.57,0],[1522.84,709.26],[1599.34,603.97],[730.18,1325.82],[826.67,1372.15],[876.36,208.84]],"e":[[0,2],[0,5],[0,3],[0,4],[1,7],[1,6],[1,8],[1,10],[1,9],[0,12],[0,14],[0,11],[15,13],[16,13],[1,17],[1,19],[1,18],[0,24],[0,22],[0,20],[0,23],[0,21],[1,58],[0,25],[0,58],[1,29],[1,31],[1,26],[1,27],[1,28],[1,30],[32,34],[1,33],[32,33],[36,34],[35,34],[37,34],[38,40],[38,39],[0,44],[0,41],[0,46],[0,43],[0,45],[0,42],[1,47],[48,8],[48,58],[48,10],[48,18],[48,19],[50,47],[51,47],[52,47],[49,47],[48,53],[48,54],[1,54],[1,53],[55,56],[56,15],[16,57],[57,55],[56,48],[39,33],[59,40],[60,34],[61,34],[1,62],[48,62],[1,63],[48,63],[64,47]],"vp":[0.0,0.0,1650.0,1506.0]}} Organic Layout of the same graph applying - * specific layout styles to the detected substructures - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface OrganicLayout extends yfiles.layout.MultiStageLayout{} - export class OrganicLayout { - /** - * Creates a new {@link yfiles.organic.OrganicLayout} instance with default settings. - */ - constructor(); - /** - * Configures the given {@link yfiles.layout.ComponentLayout} to take fixed nodes in components into account. - *

- * Components that contain fixed nodes will not be rearranged. - *

- *

- * This method is called by {@link yfiles.organic.OrganicLayout#applyLayout} before the actual layout is calculated. It may be - * overridden in order to manually configure the {@link yfiles.layout.ComponentLayout}. - *

- * @param graph the input graph - * @param layouter the {@link } instance to reconfigure - * @see yfiles.organic.OrganicLayout#smartComponentLayout - * @protected - */ - configureComponentLayout(graph:yfiles.layout.LayoutGraph,layouter:yfiles.layout.ComponentLayout):void; - /** - * Disposes of the {@link yfiles.layout.ComponentLayout} instance. - *

- * This method is called by {@link yfiles.organic.OrganicLayout#applyLayout} after the actual layout is calculated. It may be - * overridden in order to revert a custom configuration made in {@link yfiles.organic.OrganicLayout#configureComponentLayout}. - *

- * @param graph the input graph - * @param layouter the {@link } to reset - * @see yfiles.organic.OrganicLayout#smartComponentLayout - * @protected - */ - disposeComponentLayout(graph:yfiles.layout.LayoutGraph,layouter:yfiles.layout.ComponentLayout):void; - /** - * Data provider key for specifying the directedness of edges - *

- * Generally, the organic layout algorithm doesn't consider the edge direction. Nevertheless, this {@link yfiles.algorithms.IDataProvider} - * allows the user to specify hints on the directedness of edges. More precisely, a value of 1 indicates that the edge - * should be considered to be directed from source to target, a value of -1 that it is directed from target to source, and - * a value of 0 means that it is undirected. - *

- *

- * Currently, the specified values are only considered during the detection of special substructures, see {@link yfiles.organic.OrganicLayout#chainSubstructureStyle}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle}, {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle} and {@link yfiles.organic.OrganicLayout#starSubstructureStyle}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_DIRECTEDNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for marking the nodes that are part of the relevant subset - * @see yfiles.organic.OrganicLayout#scope - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning individual modes for all group nodes - *

- * The modes specify how a group's content is handled and if it is resized during layout calculation. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static GROUP_NODE_MODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining an individual preferred length for each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static PREFERRED_EDGE_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * The group node compactness factor. - *

- * Values should be in the range [0..1], where 0 results in group nodes not affecting the overall layout too much, whereas - * a value of 1 forces nodes in the same group to be clustered tightly. - *
- * Note: the specified value is only considered if option AutomaticGroupNodeCompactionEnabled is disabled and if there is - * no partition grid structure. - *

- *

- * By default this value is 0.4. - *

- * @throws {Stubs.Exceptions.ArgumentError} if compactness value does not lie in [0..1] - * @type {number} - */ - groupNodeCompactness:number; - /** - * Gets or sets whether or not group nodes are compacted automatically. - *

- * When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness - * specified by option {@link yfiles.organic.OrganicLayout#compactnessFactor}. - *

- * @see yfiles.organic.OrganicLayout#groupNodeCompactness - * @see yfiles.organic.OrganicLayout#compactnessFactor - * @type {boolean} - */ - automaticGroupNodeCompaction:boolean; - /** - * Gets or sets whether or not a clustering algorithm should be applied to the input graph. - *

- * When this option is enabled, the following steps are performed during the layout: - *

- *
    - *
  1. A clustering algorithm is applied to the input graph.
  2. - *
  3. All nodes of the same cluster are put into a newly created group node.
  4. - *
  5. The layout is applied to the modified graph.
  6. - *
  7. Group nodes denoting clusters (inserted during step 2) are removed.
  8. - *
- *

- * The user can also specify customized clusters by defining appropriate groups. - *

- * @see yfiles.organic.OrganicLayout#maximumDuration - * @type {boolean} - */ - clusterNodes:boolean; - /** - * Gets or sets the quality measure of the clustering algorithm. - *

- * The higher the value, the higher the clustering quality. - *

- *

- * The value needs to lie in [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified quality measure is outside the interval [0,1] - * @see yfiles.organic.OrganicLayout#clusterNodes - * @see yfiles.organic.OrganicLayout#maximumDuration - * @type {number} - */ - clusteringQuality:number; - /** - * Gets or sets whether or not to reserve space for node labels during layout calculation. - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance used for calculating the size of group nodes. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.layout.IGroupBoundsCalculator} is null - * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - /** - * Gets or sets whether or not this instance should configure the {@link yfiles.layout.ComponentLayout} to respect subsets of - * nodes. - *

- * When only a subset of nodes is placed by the layout algorithm, the fixed nodes will keep their locations even if they - * reside in different components. - *

- * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.organic.OrganicLayout#scope - * @type {boolean} - */ - smartComponentLayout:boolean; - /** - * Gets or sets whether or not the layout algorithm tries to avoid node/edge overlaps. - * @see yfiles.organic.OrganicLayout#nodeOverlapsAllowed - * @type {boolean} - */ - nodeEdgeOverlapAvoided:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Gets or sets the ratio of layout quality versus running time. - *

- * The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout - * calculation. - *

- *

- * The value needs to lie within [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0,1] - * @type {number} - */ - qualityTimeRatio:number; - /** - * Gets or sets the maximum duration in milliseconds that this layout algorithm is allowed to run. - *

- * The duration needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the scope that determines which nodes are placed by this algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown - * @see yfiles.organic.OrganicLayout#AFFECTED_NODES_DP_KEY - * @type {yfiles.organic.Scope} - */ - scope:yfiles.organic.Scope; - /** - * Gets or sets the style specifier for chain substructures. - *

- * A chain is a simple edge path where the degree of the nodes is less than or equal to 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown - * @see yfiles.organic.OrganicLayout#scope - * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.organic.ChainSubstructureStyle} - */ - chainSubstructureStyle:yfiles.organic.ChainSubstructureStyle; - /** - * Gets or sets the style specifier for cycle substructures. - *

- * A cycle is a simple edge path where the first and last node are identical. The algorithm only considers cycles where the - * number of edges connecting nodes of the cycle with the remaining nodes is less than or equal to 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown - * @see yfiles.organic.OrganicLayout#scope - * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.organic.CycleSubstructureStyle} - */ - cycleSubstructureStyle:yfiles.organic.CycleSubstructureStyle; - /** - * Gets or sets the style specifier for parallel substructures. - *

- * A parallel structure consists of a set of nodes (called the inner nodes) such that all nodes have degree two and are - * connected to the same pair of neighbors (called the outer nodes). - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown - * @see yfiles.organic.OrganicLayout#scope - * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.organic.ParallelSubstructureStyle} - */ - parallelSubstructureStyle:yfiles.organic.ParallelSubstructureStyle; - /** - * Gets or sets the style specifier for star substructures. - *

- * A star consists of a set of degree one nodes that are all connected to the same node (called the root of the star). - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown - * @see yfiles.organic.OrganicLayout#scope - * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.organic.StarSubstructureStyle} - */ - starSubstructureStyle:yfiles.organic.StarSubstructureStyle; - /** - * Gets or sets the compactness factor for the layout algorithm. - *

- * Smaller values result in less compact drawings, greater values result in more compact drawings. - *

- *

- * The compactness value needs to lie in [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is outside the interval [0,1] - * @type {number} - */ - compactnessFactor:number; - /** - * Gets or sets the default preferred edge length. - *

- * If there is no specific preferred edge length assigned to an edge, this default preferred edge length is used. - *

- *

- * The preferred edge length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative - * @see yfiles.organic.OrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY - * @type {number} - */ - preferredEdgeLength:number; - /** - * Gets or sets the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed. - *

- * The minimum preferred distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - preferredMinimumNodeToEdgeDistance:number; - /** - * Gets or sets whether or not to consider node sizes during layout calculation. - *

- * If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead. - *

- * @type {boolean} - */ - considerNodeSizes:boolean; - /** - * Gets or sets whether or not the deterministic mode of this algorithm is enabled. - *

- * In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are - * given as input. - *

- * @type {boolean} - */ - deterministic:boolean; - /** - * Gets or sets the minimum node distance that this algorithm should enforce between all pairs of nodes. - *

- * The minimum node distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified minimum node distance is negative - * @see yfiles.organic.OrganicLayout#nodeOverlapsAllowed - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets whether or not overlaps between nodes are allowed. - * @see yfiles.organic.OrganicLayout#minimumNodeDistance - * @see yfiles.organic.OrganicLayout#scope - * @type {boolean} - */ - nodeOverlapsAllowed:boolean; - /** - * Gets or sets the area restriction for the result of the layout algorithm. - * @type {yfiles.organic.OutputRestriction} - */ - outputRestriction:yfiles.organic.OutputRestriction; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OrganicLayout; - } - /** - * This layout stage enables support for handling a graph with a {@link yfiles.layout.PartitionGrid} structure. - *

- * Concept - *

- *

- * Before executing the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}, this stage prepares the grid structure of the graph accordingly, e.g., by hiding top-level grid - * nodes. Then, the core layout algorithm is applied to the graph. Finally, the grid is restored, configured and positioned - * such that it is consistent with the layout computed by the core algorithm. - *

- *

- * Information about the {@link yfiles.layout.PartitionGrid} structure is retrieved from a {@link yfiles.algorithms.IDataProvider} - * registered with the graph using key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. - *

- *

- * Usage - *

- *

- * When using {@link yfiles.organic.OrganicLayout}, this stage will automatically be used, if required. It is not necessary to - * append this stage manually to {@link yfiles.organic.OrganicLayout}. - *

- *

- * Appending this stage can be useful to add support for {@link yfiles.layout.PartitionGrid partition grid} structures to other - * {@link yfiles.layout.ILayoutAlgorithm}s. - *

- *

- * The stage can be appended to all algorithms of type {@link yfiles.layout.MultiStageLayout} by using method - * {@link yfiles.layout.MultiStageLayout#appendStage}. - *

- * @see yfiles.layout.PartitionGrid - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrganicPartitionGridLayoutStage extends yfiles.layout.LayoutStageBase{} - export class OrganicPartitionGridLayoutStage { - /** - * Creates a new instance of {@link yfiles.organic.OrganicPartitionGridLayoutStage} with the given layout algorithm as - * {@link yfiles.layout.LayoutStageBase#coreLayout core algorithm}. - * @param core the core layout algorithm - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OrganicPartitionGridLayoutStage; - } - /** - * This layout stage removes node overlaps while changes to the original layout structure are avoided and a specified - * minimum node distance is guaranteed. - *

- * Layout Style - *

- *

- * Unlike the overlap removal approach implemented by - * {@link yfiles.organic.RemoveOverlapsStage}, this stage tries to keep the original layout structure, i.e., it tries to keep the - * geometric distances between the nodes. - *

- *

- * The strategy for removing overlaps is similar to the layout strategy used by organic (force-directed) layout algorithms - * (e.g. - * {@link yfiles.organic.OrganicLayout}). Therefore, this stage is especially well suited to remove node overlaps in undirected - * graph drawings with straight-line edges, as produced by organic layout approaches. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[-264.13,89.64],[-109.95,153.19],[-68.91,-95.12],[-178.12,-35.61,60,60],[-88.42,-54.43],[-134.12,41.2],[-214.95,40.96,60,60],[-96.74,81.55,60,60],[-145.17,111.32],[-255.82,6.45],[-272.91,49.11],[-47.42,-39.94,60,60],[-645,65.04],[-507.21,54.41],[-586.74,40.54,60,60],[-488.66,89.42,60,60],[-539.17,115.13],[-488.66,132.42],[-636.26,24.59],[-645,46.48],[-468.9,-54.43],[-546.97,19.76,60,60],[-456.97,-40.24],[-447.21,-40.24,60,60],[-320.5,-180,1,1,4],[-320.5,251.5,1,1,4]],"e":[[2,3],[8,7],[5,7],[9,6],[6,5],[8,6],[0,6],[10,6],[3,6],[8,5],[7,6],[3,4],[4,2],[7,1],[8,1],[7,11],[20,21],[16,15],[13,15],[18,14],[14,13],[16,14],[12,14],[19,14],[21,14],[16,13],[15,14],[21,22],[22,20],[15,17],[16,17],[15,23],[24,25]],"vp":[-645.0,-182.0,658.0,436.0]}} A graph containing overlaps (left) and the result after applying this layout stageFeatures - *

- *

- * It is possible to define a {@link yfiles.organic.OrganicRemoveOverlapsStage#minimumNodeDistance minimum distance} between nodes. This feature allows to not only remove overlaps but forces - * nodes to keep the specified distance to other nodes. - *

- *

- * Nodes can be marked as fixed. Such nodes will not be moved during the overlap removal process. A {@link yfiles.algorithms.IDataProvider} - * with key {@link yfiles.organic.OrganicRemoveOverlapsStage#FIXED_NODE_DP_KEY} can be registered to mark the fixed nodes. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrganicRemoveOverlapsStage extends yfiles.layout.LayoutStageBase{} - export class OrganicRemoveOverlapsStage { - /** - * Creates a new instance of {@link yfiles.organic.OrganicRemoveOverlapsStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Data provider key for marking nodes as fixed - *

- * A node marked as fixed will not be moved by this algorithm but stay at its current position. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the maximum duration in milliseconds that this layout stage is allowed to run. - *

- * This maximum time does not include the time required for the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- *

- * The duration needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the minimum distance to be kept between any two nodes of the graph. - *

- * Due to this distance not only nodes that overlap will be moved to resolve the overlap, but also nodes which are too - * close to each other with respect to this distance will be displaced. - *

- *

- * The distance needs to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @type {number} - */ - minimumNodeDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OrganicRemoveOverlapsStage; - } - /** - * {@link yfiles.organic.OutputRestriction}s restrict the output area and the shape of a layout in conjunction with organic layout - * algorithms such as {@link yfiles.organic.OrganicLayout} or {@link yfiles.organic.InteractiveOrganicLayout}. - *

- * In consequence, all nodes need to be placed inside a specific restricted area. - *

- * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @class - */ - export interface OutputRestriction extends yfiles.lang.Object{} - export class OutputRestriction { - /** - * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to a rectangular area which roughly complies - * with the given aspect ratio. - *

- * The aspect ratio is defined as the ratio between the width and the height of a layout. - *

- *
    - *
  • aspect ratio 1: width and height of the layout should be equal
  • - *
  • aspect ratio between 0 and 1: the height of a layout should be greater than its width
  • - *
  • aspect ratio larger than 1: the width of a layout should be greater than its height
  • - *
- *

- * The aspect ratio needs to be strictly positive. - *

- * @param ratio the preferred aspect ratio of the output - * @returns an {@link } imposing the given aspect ratio on the layout - * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is 0 or negative - * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @static - */ - static createAspectRatioRestriction(ratio:number):yfiles.organic.OutputRestriction; - /** - * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to a circle. - *

- * The actual restriction circle is defined by the given coordinates and radius. - *

- *

- * The radius of the restriction circle needs to be greater than zero. - *

- * @param x the x-coordinate of the restriction circle's center - * @param y the y-coordinate of the restriction circle's center - * @param radius the radius of the restriction circle - * @returns the {@link } confining the layout to a circular area - * @throws {Stubs.Exceptions.ArgumentError} if the given radius is less than or equal to zero - * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @static - */ - static createCircularCageRestriction(x:number,y:number,radius:number):yfiles.organic.OutputRestriction; - /** - * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to an elliptical area. - *

- * The restriction ellipse is defined by its bounding box specified by the given coordinates and size values. - *

- *

- * The main axes of the ellipse are parallel to the coordinate axes. - *

- *

- * The values for height and width of the ellipse's bounding box need to be greater than zero. - *

- * @param x the x-coordinate of the bounding box's upper left corner - * @param y the y-coordinate of the bounding box's upper left corner - * @param w the width of the bounding box - * @param h the height of the bounding box - * @returns the {@link } confining the layout to an elliptical area - * @throws {Stubs.Exceptions.ArgumentError} if the given width or height is 0 or negative - * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @static - */ - static createEllipticalCageRestriction(x:number,y:number,w:number,h:number):yfiles.organic.OutputRestriction; - /** - * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout to a rectangular area. - *

- * This restriction rectangle is defined by the given coordinates and size values. - *

- *

- * The values for height and width of the rectangle need to be greater than zero. - *

- * @param x the x-coordinate of the restriction rectangle's upper-left corner - * @param y the y-coordinate of the restriction rectangle's upper-left corner - * @param w width of the restriction rectangle - * @param h height of the restriction rectangle - * @returns the {@link } confining the layout to a rectangular area - * @throws {Stubs.Exceptions.ArgumentError} if the given width or height is less than or equal to zero - * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @static - */ - static createRectangularCageRestriction(x:number,y:number,w:number,h:number):yfiles.organic.OutputRestriction; - /** - * This {@link yfiles.organic.OutputRestriction} does not restrict the output by any means. - *

- * It is a no-op that can be used when the output area and shape of a layout should be unrestricted. - *

- * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @const - * @static - * @type {yfiles.organic.OutputRestriction} - */ - static NONE:yfiles.organic.OutputRestriction; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OutputRestriction; - } - /** - * This algorithm recursively removes node overlaps from a graph with a hierarchic group structure. - *

- * Basically, this algorithm combines a {@link yfiles.layout.RecursiveGroupLayout} with a specific customizable {@link yfiles.organic.RecursiveShuffleLayout#shuffleLayout shuffle algorithm} - * as its - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. The shuffle algorithm will be recursively applied to all groups of the input graph to remove node - * overlaps. - *

- *

- * {@graph {"ann":{"s":[50,50],"d":1},"n":[[158,104.94,384.5,224.75,2,[[158,127.31,384.5,22.38,"Group 1"]]],[173,142.31,175,172.38,2,[[173,164.69,175,22.38,"Group 2"]]],[205,187.69,60,30],[235,179.69,60,30],[225,249.69,60,30],[188,239.69,60,30],[407.5,177.69],[445,187.69,60,30],[432.5,203.38],[382.5,218.75],[295,242.31,155,177.88,2,[[295,264.69,155,22.38,"Group 3"]]],[310,279.69],[335,305.19],[360,329.69],[385,355.19],[469,265.25,50,154.94],[737.5,104.94,386,204.75,2,[[737.5,127.31,386,22.38,"Group 1"]]],[752.5,142.31,170,152.38,2,[[752.5,164.69,170,22.38,"Group 2"]]],[781.5,187.69,60,30],[847.5,179.69,60,30],[833.5,249.69,60,30],[767.5,239.69,60,30],[987,169.5],[1048.5,176.5,60,30],[1042,212.5],[974,225.5],[889.5,315.62,155,270.38,2,[[889.5,338,155,22.38,"Group 3"]]],[904.5,353],[929.5,409],[954.5,465],[979.5,521],[1063.5,324.84,50,154.94],[569.5,329.5,1,1,4],[706.5,329.5,1,1,4]],"e":[[32,33]],"vp":[158.0,104.0,966.0,482.0]}} Input graph (left) and result (right) after executing this algorithm with default settings - *

- *

- * Since this algorithm is a {@link yfiles.layout.ILayoutStage}, a {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can be specified. In consequence, this - * algorithm will perform its work after the core algorithm was executed. - *

- * @see yfiles.organic.ShuffleLayout - * @see yfiles.layout.RecursiveGroupLayout - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface RecursiveShuffleLayout extends yfiles.layout.LayoutStageBase{} - export class RecursiveShuffleLayout { - /** - * Creates a new {@link yfiles.organic.RecursiveShuffleLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance that computes the sizes of all group nodes. - * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - /** - * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm} instance that is used for removing node overlaps. - *

- * This instance will be applied recursively to all group nodes of the graph. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - shuffleLayout:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.RecursiveShuffleLayout; - } - /** - * This {@link yfiles.layout.ILayoutStage} removes node overlaps and guarantees a certain minimum distance between nodes. - *

- * Layout Style This stage only removes overlaps between nodes of the input graph. To do so, overlapping nodes will be moved apart. - * Results often look like a stretched version of the original graph. {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[206,563.54],[343.79,552.91],[264.26,539.04,60,60],[362.34,587.92,60,60],[311.83,613.63],[362.34,630.92],[214.74,523.09],[206,544.98],[382.1,444.07],[304.03,518.26,60,60],[394.03,458.26],[403.79,458.26,60,60],[530.5,318.5,1,1,4],[530.5,750,1,1,4],[587.5,574.26],[819.5,549.26],[677.5,536.26,60,60],[847.5,609.26,60,60],[757.5,647.26],[838.5,680.26],[601.5,492.26],[587.5,533.26],[870.5,365.26],[748.5,503.26,60,60],[881.5,406.26],[922.5,406.26,60,60]],"e":[[8,9],[4,3],[1,3],[6,2],[2,1],[4,2],[0,2],[7,2],[9,2],[4,1],[3,2],[9,10],[10,8],[3,5],[4,5],[3,11],[12,13],[22,23],[18,17],[15,17],[20,16],[16,15],[18,16],[14,16],[21,16],[23,16],[18,15],[17,16],[23,24],[24,22],[17,19],[18,19],[17,25]],"vp":[206.0,317.0,777.0,436.0]}} A graph containing overlaps (left) and the result after the - * overlap removal Features - *

- *

- * It is possible to define a {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum distance} between nodes. This feature allows to not only remove overlaps but forces - * nodes to keep a specified distance to other nodes. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface RemoveOverlapsStage extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class RemoveOverlapsStage { - /** - * Creates a new {@link yfiles.organic.RemoveOverlapsStage} instance with a given {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum node distance}. - *

- * The minimum node distance needs to be non-negative. - *

- * @param minimumNodeDistance a non-negative minimum distance value - * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - */ - constructor(minimumNodeDistance:number); - /** - * Removes node overlaps and displaces nodes of the given graph such that they keep the specified {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum distance} to each - * other. - *

- * If a {@link yfiles.organic.RemoveOverlapsStage#coreLayout core layout algorithm} is specified, it will be executed first. - *

- * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets the minimum distance to be kept between any two nodes of the graph. - *

- * Due to this distance not only nodes that overlap will be moved to resolve the overlap, but also nodes which are too - * close to each other with respect to this distance will be displaced. - *

- *

- * The minimum node distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.RemoveOverlapsStage; - } - /** - * This layout stage replaces edges by a path of split-edges with a specified length before it calls a {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm}. - *

- * Concept - *

- *

- * Each edge segment (or only segments that belong to a particular subset of edges) in the input graph will be split up - * into several segments such that all segments have a maximum length defined by the specified - * {@link yfiles.organic.SplitEdgeStage#splitSegmentLength split segment length}. If an edge segment is already shorter than the split segment length, then it will not be split - * up. - *

- *

- * At each split location, a dummy node (the so-called split-node) will be inserted. Split-nodes inserted for the same original edge - * and the actual source and target node of the original edge will be connected by so called - * split-edges. In consequence, the original source and target node are not connected by a single edge but by a path consisting of - * split-edges. Furthermore, all edges are simple straight lines. - *

- *

- * After this replacement step, the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} will be invoked. - *

- *

- * When the core layout algorithm has finished, the split-nodes will be removed from the graph and the original edge will - * be restored. The coordinates of the bends will be the center-coordinates of the corresponding split-node. - *

- *

- * Features - *

- *

- * The {@link yfiles.algorithms.IDataProvider} registered with key {@link yfiles.organic.SplitEdgeStage#splitNodesDpKey} can be used by the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} to determine whether - * or not a certain node is a split-node that was created by this stage. This information may be useful when providing a - * custom core layout algorithm which should handle split-nodes in a different way than normal nodes. If no {@link yfiles.algorithms.IDataProvider} - * is registered with this key, this information is dropped. - *

- *

- * By registering a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.organic.SplitEdgeStage#affectedEdgesDpKey}, the subset of edges that should be split by this layout - * stage can be specified. If no {@link yfiles.algorithms.IDataProvider} with this key is registered, all edges of the input graph - * will be split by the layout stage. - *

- *

- * The amount of split-nodes replacing a single original edge can be controlled via the - * {@link yfiles.organic.SplitEdgeStage#splitSegmentLength split segment length}. The smaller the value, the more split-nodes this stage will insert. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface SplitEdgeStage extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class SplitEdgeStage { - /** - * Creates a new {@link yfiles.organic.SplitEdgeStage} with default settings. - */ - constructor(); - /** - * Replaces the edges of the given graph by a path of split-edges, executes the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} and restores the - * original edges, introducing bends at the locations of the split-nodes. - * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to determine which edges are to be split by this layout stage. - *

- * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all edges will be split. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key for marking the nodes that were created by splitting edges, i.e., - * the split-nodes. - *

- * The information provided by the {@link yfiles.algorithms.IDataProvider} registered with this key is useful for the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} - * to know whether or not some node is a (dummy) split-node. After {@link yfiles.organic.SplitEdgeStage#applyLayout} finishes, the - * split-nodes will have been removed and this information will not be available anymore. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - splitNodesDpKey:any; - /** - * Gets or sets the maximum length for a split-edge. - *

- * The length of the original edge path divided by the given split segment length yields the number of nodes on the new - * path. - *

- *

- * The split segment length must be a strictly positive value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given split segment length is smaller than or equal to zero - * @type {number} - */ - splitSegmentLength:number; - /** - * Gets or sets the size of the split-nodes that are inserted when splitting edges. - *

- * The given size will be used for defining the height and the width of the split-nodes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given size is negative - * @type {number} - */ - splitNodeSize:number; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.SplitEdgeStage; - } - /** - * Specifies custom data for the {@link yfiles.organic.OrganicLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface OrganicLayoutData extends yfiles.layout.LayoutData{} - export class OrganicLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes that is laid out by the layout. - * @see yfiles.organic.OrganicLayout#AFFECTED_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from edges to their preferred edge length. - * @see yfiles.organic.OrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - preferredEdgeLengths:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their minimum distance to other nodes. - *

- * Note that the distances are only considered by the internally used {@link yfiles.organic.ShuffleLayout} when {@link yfiles.organic.OrganicLayout#nodeOverlapsAllowed} is true and {@link yfiles.organic.OrganicLayout#scope} is - * not {@link yfiles.organic.Scope#ALL}. - *

- * @see yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumNodeDistances:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from group nodes to a mode constant describing how to handle the group node. - *

- * The algorithm expects for each group node to find one of the following constants or null: - *

    - *
  • - * {@link yfiles.organic.GroupNodeMode#NORMAL} - *
  • - *
  • - * {@link yfiles.organic.GroupNodeMode#FIX_BOUNDS} - *
  • - *
  • - * {@link yfiles.organic.GroupNodeMode#FIX_CONTENTS} - *
  • - *
- *

- * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - groupNodeModes:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the partition grid layout data. - * @type {yfiles.layout.PartitionGridData} - */ - partitionGridData:yfiles.layout.PartitionGridData; - /** - * Gets or sets the mapping from edges to their directedness. - *

- * Generally, the organic layout algorithm doesn't consider the edge direction. Nevertheless, this property allows the user - * to specify hints on the directedness of edges. More precisely, a value of 1 indicates that the edge should be considered - * to be directed from source to target, a value of -1 that it is directed from target to source, and a value of 0 means - * that it is undirected. - *

- *

- * Currently, the specified values are only considered during the detection of special substructures, see {@link yfiles.organic.OrganicLayout#chainSubstructureStyle}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle}, {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle} and {@link yfiles.organic.OrganicLayout#starSubstructureStyle}. - *

- * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeDirectedness:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OrganicLayoutData; - } - }export namespace router{ - /** - * {@link yfiles.router.ParallelEdgeRouter} is a {@link yfiles.layout.ILayoutStage} that routes parallel edges which connect the same pair - * of nodes in a graph. - *

- * Layout Style The edge paths of parallel edges consist of parallel segments. At the end points, the edges can either still be - * parallel or {@link yfiles.router.ParallelEdgeRouter#joinEnds joined in one point}. {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[198,216],[54,226],[0,93],[110,0],[232,76],[119,122]],"e":[[1,0],[2,1],[3,2],[0,4],[4,3],[2,5,[43.96,125.35,100.3,139.08]],[2,5,[48.7,105.92,105.04,119.65]],[2,5,[51.07,96.2,107.4,109.93]],[3,5,[147.32,45.67,151.57,103.38]],[1,5,[77.62,208.34,108.42,159.06]],[1,5,[69.14,203.04,99.94,153.76]],[0,5,[184.58,212.72,147.11,168.14]],[0,5,[176.92,219.16,139.46,174.58]],[5,3,[141.6,104.12,137.34,46.41]],[5,3,[121.66,105.59,117.4,47.88]],[5,3,[111.68,106.33,107.43,48.62]],[5,4,[171.36,143.38,224.72,121.66]],[5,4,[167.59,134.12,220.95,112.4]],[5,4,[160.05,115.6,213.41,93.88]],[5,2,[97.93,148.8,41.6,135.07]],[5,4,[156.28,106.34,209.64,84.62]],[5,0,[162.42,155.28,199.89,199.86]],[5,0,[170.08,148.84,207.54,193.42]],[5,1,[125.38,169.66,94.58,218.94]],[5,1,[133.86,174.96,103.06,224.24]],[1,5,1],[2,5,1],[0,5,1],[5,3,1],[5,4,1]],"vp":[0.0,0.0,262.0,256.0]}} - *

- *

- * The master edge determining the routing is highlighted - *

- *

- * Concept {@link yfiles.router.ParallelEdgeRouter} performs four basic steps: - *

- *
    - *
  1. Remove all parallel edges from the input graph, leaving one master edge in the graph
  2. - *
  3. Invoke the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} on the graph without parallel edges
  4. - *
  5. Reinsert all previously removed edges
  6. - *
  7. Route the parallel edges
  8. - *
- *

- * Features - *

- *

- * {@link yfiles.router.ParallelEdgeRouter} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} which - * cannot handle parallel edges. Then it will hide the parallel edges from this {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} and take over the - * routing of them. - *
- * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.router.ParallelEdgeRouter} can work alone. It will route only the - * parallel edges and keep the remaining graph unchanged. - *

- *

- * Parallel edges can either be all edges between the same two nodes, ignoring the direction, or edges are only considered - * parallel if they share the same source node and target node. Hence, they share the same {@link yfiles.router.ParallelEdgeRouter#directedMode direction}. - *

- *

- * To make sure that the ports of all parallel edges are on the end nodes, the first and last segments can be - * {@link yfiles.router.ParallelEdgeRouter#joinEnds joined}. However, these segments won't be parallel. - *

- *

- * There are two ways to define the distance between two parallel edges. First, an absolute distance can be {@link yfiles.router.ParallelEdgeRouter#lineDistance defined}. - * Parallel segments will keep this distance. Second, the distance can be - * {@link yfiles.router.ParallelEdgeRouter#adaptiveLineDistances determined relative to the node bounds}. Depending on the size of the nodes and the number of parallel edges between - * them, the distance between parallel edges is adjusted. This will keep the edges straight in most cases. - *

- *

- * It is possible to select - * {@link yfiles.router.ParallelEdgeRouter#LEADING_EDGE_DP_KEY custom master edges}. All edges that are parallel to the selected edges will be temporarily removed. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface ParallelEdgeRouter extends yfiles.layout.LayoutStageBase{} - export class ParallelEdgeRouter { - /** - * Creates a new {@link yfiles.router.ParallelEdgeRouter} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - * @see yfiles.layout.LayoutStageBase#coreLayout - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Hides all parallel edges leaving a master edge in the graph. - *

- * {@link yfiles.router.ParallelEdgeRouter} detects parallel edges of the given graph. From each set of parallel edges it hides all - * but one edge from the given graph. - *

- *

- * This method is called before invoking the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to change the selection of leading - * edges. Hidden edges should be stored in {@link yfiles.router.ParallelEdgeRouter#hiddenEdges} to enable un-hiding later on. - *

- * @param graph the input graph - * @see yfiles.router.ParallelEdgeRouter#directedMode - * @see yfiles.router.ParallelEdgeRouter#AFFECTED_EDGES_DP_KEY - * @protected - */ - findAndHideParallelEdges(graph:yfiles.algorithms.Graph):void; - /** - * Assigns a layout to all parallel edges. - *

- * The layout for each parallel edge follows the layout of the master edge which was not removed from the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- *

- * This method is called when the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is finished. It may be overridden to introduce a custom routing for - * parallel edges. - *

- * @param graph the graph after the core layout - * @param parallelEdges the map that provides all parallel edges for each master edge - * @see yfiles.router.ParallelEdgeRouter#joinEnds - * @see yfiles.router.ParallelEdgeRouter#adaptiveLineDistances - * @see yfiles.router.ParallelEdgeRouter#adjustLeadingEdge - * @protected - */ - layoutParallelEdges(graph:yfiles.layout.LayoutGraph,parallelEdges:yfiles.algorithms.IEdgeMap):void; - /** - * Data provider key for marking edges that will be routed - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the master edges - *

- * Marked edges won't be removed for the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. All edges parallel to the master edges will get parallel paths. - *

- *

- * If no leading edge is specified for a bundle of parallel edges, it will be determined automatically. If there is more - * than one leading edge, the first one is chosen. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static LEADING_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Holds the list of parallel edges that are hidden from the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @protected - * @type {yfiles.algorithms.EdgeList} - */ - hiddenEdges:yfiles.algorithms.EdgeList; - /** - * {@link yfiles.algorithms.IEdgeMap} that associates a hidden edge with the unique parallel edge not hidden from the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @type {yfiles.algorithms.IEdgeMap} - */ - parallelEdges:yfiles.algorithms.IEdgeMap; - /** - * Gets or sets whether or not the direction of edges should be considered. - *

- * In directed mode, only edges that share the same source and target node will be routed in parallel. Edges that connect - * to the same nodes but in different directions won't be considered parallel. - *

- *

- * In undirected mode, all edges connecting the same pair of nodes will be routed in parallel. - *

- * @type {boolean} - */ - directedMode:boolean; - /** - * Gets or sets whether or not the distances between parallel edges should be determined automatically according to the - * sizes of their source and target nodes. - *

- * If enabled, the distances between edges are chosen such that all parallel edges can be drawn as straight lines and still - * connect to the nodes' bounds. - *

- * @see yfiles.router.ParallelEdgeRouter#lineDistance - * @type {boolean} - */ - adaptiveLineDistances:boolean; - /** - * Gets or sets the distance between two adjacent edge paths that run in parallel. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is less than 0 - * @see yfiles.router.ParallelEdgeRouter#adaptiveLineDistances - * @type {number} - */ - lineDistance:number; - /** - * Gets or sets whether or not to join end points of parallel edges. - *

- * If enabled, all edges end with non-parallel segments that connect at the same point to the node. Otherwise, all segments - * of the edges are parallel. In this case, some edges may not connect to the nodes' bounds. - *

- * @see yfiles.router.ParallelEdgeRouter#absJoinEndDistance - * @see yfiles.router.ParallelEdgeRouter#relJoinEndDistance - * @type {boolean} - */ - joinEnds:boolean; - /** - * Gets or sets the absolute distance from the end point of the joined lines to the first parallel segments. - *

- * The absolute distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @see yfiles.router.ParallelEdgeRouter#joinEnds - * @see yfiles.router.ParallelEdgeRouter#relJoinEndDistance - * @type {number} - */ - absJoinEndDistance:number; - /** - * Gets or sets the relative distance from the end point of the joined lines to the first parallel segments. - *

- * The length is relative to the corresponding original segment's length. It needs to have a value in the interval [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified relative distance is less than 0 or greater than 1 - * @see yfiles.router.ParallelEdgeRouter#joinEnds - * @see yfiles.router.ParallelEdgeRouter#absJoinEndDistance - * @type {number} - */ - relJoinEndDistance:number; - /** - * Gets or sets whether or not to adjust the leading edge to obtain more symmetric results. - * @type {boolean} - */ - adjustLeadingEdge:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ParallelEdgeRouter; - } - export enum Scope{ - /** - * A scope specifier which defines that all edges of the input graph will be routed. - * @see yfiles.router.BusRouter#scope - */ - ROUTE_ALL_EDGES, - /** - * A scope specifier which defines that only the selected edges of the input graph will be routed. - *

- * The selection state of an edge is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.router.BusRouter#affectedEdgesDpKey}. - *

- *

- * All other non-selected edges will be considered to have fixed routes. - *

- * @see yfiles.router.BusRouter#scope - * @see yfiles.router.BusRouter#affectedEdgesDpKey - * @see yfiles.router.BusRouter#DEFAULT_AFFECTED_EDGES_DP_KEY - */ - ROUTE_AFFECTED_EDGES, - /** - * A scope specifier which defines that only edges incident to selected nodes will be routed. - *

- * The selection state of a node is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.router.EdgeRouter#affectedNodesDpKey}. - *

- *

- * All other edges that are incident to non-selected nodes will be considered to have fixed routes. - *

- * @see yfiles.router.EdgeRouter#scope - * @see yfiles.router.EdgeRouter#affectedNodesDpKey - */ - ROUTE_EDGES_AT_AFFECTED_NODES - } - export enum MonotonicPathRestriction{ - /** - * A constant specifying that there are no monotonic edge path restrictions. - * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - */ - NONE, - /** - * A constant specifying monotonic edge path restrictions for the vertical direction. - *

- * This implies that each vertical edge segment is directed from the source to the target. - *

- * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - */ - VERTICAL, - /** - * A constant specifying monotonic edge path restrictions for the horizontal direction. - *

- * This implies that each horizontal edge segment is directed from the source to the target. - *

- * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - */ - HORIZONTAL, - /** - * A constant specifying monotonic edge path restrictions for the horizontal and vertical direction. - *

- * This implies that each horizontal as well as each vertical edge segment is directed from the source to the target. - *

- * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - */ - BOTH - } - /** - * This edge routing algorithm routes edges as straight-lines considering the specified {@link yfiles.layout.PortConstraint}s. - *

- * Layout Style The edges connect to their ports with straight-lines. This may lead to edges crossing nodes. {@graph {"ann":{"s":[30,30],"d":1},"n":[[591,590],[157,454],[558,361],[665,476],[466,502],[335,663],[230,267],[350,325],[17,519],[187,590],[248,387],[145,310],[464,337],[310,506],[670,151],[220,106],[697,285],[522,187],[457,2],[111,0],[305,5],[375,139],[0,260]],"e":[[0,3],[3,2],[4,0],[1,6],[6,7],[7,2],[1,8],[1,9],[10,7],[10,11],[11,7],[12,4],[12,7],[5,13],[9,13],[1,13],[7,13],[4,13],[15,6],[14,16],[16,2],[12,17],[17,14],[15,19],[15,20],[18,21],[20,21],[15,21],[17,21],[7,21],[11,22]],"vp":[0.0,0.0,727.0,693.0]}}Concept{@link yfiles.router.StraightLineEdgeRouter} - * will first invoke the {@link yfiles.layout.LayoutStageBase#coreLayout} if one exists. Then, it will remove all bends from the edges and will place the ports either on - * the center of the nodes or at a location specified by a {@link yfiles.layout.PortConstraint}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface StraightLineEdgeRouter extends yfiles.layout.LayoutStageBase{} - export class StraightLineEdgeRouter { - /** - * Creates a new instance of {@link yfiles.router.StraightLineEdgeRouter} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets the (sub-)set of edges to be routed. - *

- * {@link yfiles.router.StraightLineEdgeRouter} will only route those edges and leave the remaining edges unchanged. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given argument is an unknown specifier - * @see yfiles.router.StraightLineEdgeRouter#affectedEdgesDpKey - * @see yfiles.router.StraightLineEdgeRouter#affectedNodesDpKey - * @type {yfiles.router.Scope} - */ - scope:yfiles.router.Scope; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that provides the selected state of the nodes of the - * graph. - *

- * If the scope only includes {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES edges at selected nodes}, only edges of the nodes marked in this {@link yfiles.algorithms.IDataProvider} - * are routed while all other edges are considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.router.StraightLineEdgeRouter#scope - * @type {any} - */ - affectedNodesDpKey:any; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that provides the selected state of the edges of the - * graph. - *

- * If the scope only includes {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES selected edges}, only edges of the nodes marked in this {@link yfiles.algorithms.IDataProvider} are - * routed while all other edges are considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.router.StraightLineEdgeRouter#scope - * @type {any} - */ - affectedEdgesDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.StraightLineEdgeRouter; - } - /** - * This class describes the location and the direction from which a given {@link yfiles.router.PartitionCell partition cell} has been entered during a path - * search. - *

- * The path that was followed in order to reach a given {@link yfiles.router.PartitionCell partition cell} can be reconstructed by traversing all - * {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. The {@link yfiles.router.CellEntrance#enterInterval enter interval} and {@link yfiles.router.CellEntrance#enterDirection enter direction} determine how the {@link yfiles.router.PartitionCell partition cell} was entered. - *

- * @class - */ - export interface CellEntrance extends yfiles.lang.Object{} - export class CellEntrance { - /** - * Creates a new {@link yfiles.router.CellEntrance} instance that is a copy of a given other {@link yfiles.router.CellEntrance}. - * @param other the {@link } to be copied - */ - constructor(other:yfiles.router.CellEntrance); - /** - * Creates a new {@link yfiles.router.CellEntrance} instance for a given {@link yfiles.router.PartitionCell}. - * @param cell the {@link } that is entered - */ - constructor(cell:yfiles.router.PartitionCell); - /** - * Gets the {@link yfiles.router.PartitionCell partition cell} of this {@link yfiles.router.CellEntrance} instance. - * @type {yfiles.router.PartitionCell} - */ - cell:yfiles.router.PartitionCell; - /** - * Gets or sets the previous {@link yfiles.router.CellEntrance} along the path that was traversed in order to reach the {@link yfiles.router.CellEntrance#cell cell}. - * @type {yfiles.router.CellEntrance} - */ - previousEntrance:yfiles.router.CellEntrance; - /** - * Gets or sets the {@link yfiles.router.OrthogonalInterval} that was used for entering this {@link yfiles.router.CellEntrance#cell cell}. - * @type {yfiles.router.OrthogonalInterval} - */ - enterInterval:yfiles.router.OrthogonalInterval; - /** - * Gets or sets the direction from which this {@link yfiles.router.CellEntrance#cell cell} was entered. - * @type {yfiles.layout.Direction} - */ - enterDirection:yfiles.layout.Direction; - /** - * Gets or sets the costs for the implicit path given by the {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. - *

- * The costs must be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the costs are negative - * @type {number} - */ - costs:number; - /** - * Gets or sets the heuristic costs for the implicit path given by the {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. - *

- * Heuristic costs must be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the heuristic costs are negative - * @type {number} - */ - heuristicCosts:number; - /** - * Gets or sets the {@link yfiles.router.EdgeCellInfo} describing how the previous {@link yfiles.router.PartitionCell partition cell} was traversed. - * @type {yfiles.router.EdgeCellInfo} - */ - previousEdgeCellInfo:yfiles.router.EdgeCellInfo; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.CellEntrance; - } - /** - * This class stores information about the part of an edge segment that lies inside a specified {@link yfiles.router.PartitionCell partition cell}. - * @class - * @extends {yfiles.router.SegmentInfoBase} - */ - export interface CellSegmentInfo extends yfiles.router.SegmentInfoBase{} - export class CellSegmentInfo { - /** - * Creates a new {@link yfiles.router.CellSegmentInfo} instance. - * @param edge the edge to which the segment of this info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param direction the direction to which the segment of this info points - * @param locationRange the range within which the common location of this segment has to lie - * @param minExtension the minimum interval in extension direction this segment part is known to intersect - * @param maxExtension the maximum interval in extension direction this segment part will span - * @param cell the partition cell within which this part of the edge segment lies - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval,cell:yfiles.router.PartitionCell); - /** - * Gets the direction to which the segment of this info points. - * @type {yfiles.layout.Direction} - */ - direction:yfiles.layout.Direction; - /** - * Gets the {@link yfiles.router.PartitionCell partition cell} within which this part of the edge segment lies. - * @type {yfiles.router.PartitionCell} - */ - cell:yfiles.router.PartitionCell; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.CellSegmentInfo; - } - /** - * This class describes a channel, i.e., a set of vertical or horizontal edge segments whose locations depend on each - * other. - *

- * Channels are used by the {@link yfiles.router.ChannelBasedPathRouting} to route edges using - * {@link yfiles.router.SegmentInfo}s describing their path. - *

- * @class - */ - export interface Channel extends yfiles.lang.Object{} - export class Channel { - /** - * Creates a new {@link yfiles.router.Channel} that contains the given {@link yfiles.router.SegmentInfo segment info}. - * @param segment the given segment info for which the {@link } is created - * @throws {Stubs.Exceptions.ArgumentError} if the given segment has a different orientation than the other segments already contained in the channel - */ - constructor(segment:yfiles.router.SegmentInfo); - /** - * Adds a new {@link yfiles.router.SegmentInfo segment info} to the {@link yfiles.router.Channel channel}. - * @param segment the segment info to be added to this channel - * @throws {Stubs.Exceptions.ArgumentError} if the given segment has a different orientation than the other segments already contained in the channel - */ - addSegment(segment:yfiles.router.SegmentInfo):void; - /** - * Adds a {@link yfiles.router.SegmentGroup segment group} to this {@link yfiles.router.Channel channel}. - * @param group the segment group to be added - */ - addSegmentGroup(group:yfiles.router.SegmentGroup):void; - /** - * Returns the current location that the given {@link yfiles.router.SegmentInfo segment info} has been assigned within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. - * @param segmentInfo the segment info for which the current location will be returned - * @returns the current location of the segment info or {@link #NaN} if no location has been assigned before - * @see yfiles.router.Channel#setCurrentLocation - */ - getCurrentLocation(segmentInfo:yfiles.router.SegmentInfo):number; - /** - * Returns the {@link yfiles.router.SegmentInfo segment info} with the given index in the list of segments of this {@link yfiles.router.Channel channel}. - * @param index the index of the segment in the list of segments - * @returns the {@link segment info} with the given index in the list of segments - */ - getSegment(index:number):yfiles.router.SegmentInfo; - /** - * Returns the {@link yfiles.router.SegmentGroup segment group} with the given index in this {@link yfiles.router.Channel channel}. - * @param index the index of the segment group - * @returns the {@link segment group} with the given index in this channel - */ - getSegmentGroup(index:number):yfiles.router.SegmentGroup; - /** - * Returns the number of {@link yfiles.router.SegmentInfo segment infos} in this channel. - * @returns the number of segment infos in this channel - */ - segmentCount():number; - /** - * Returns the number of {@link yfiles.router.SegmentGroup segment groups} in this {@link yfiles.router.Channel channel}. - * @returns the number of segment groups in this channel - */ - segmentGroupCount():number; - /** - * Specifies the current location that the given {@link yfiles.router.SegmentInfo segment info} has been assigned within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. - *

- * During the distribution of the segments in the channel, different locations can be assigned but only the last one is - * finally assigned to the {@link yfiles.router.SegmentInfo segment info}. - *

- * @param segmentInfo the segment info for which the current location will be set - * @param location the location of the segment info within its location range - * @see yfiles.router.SegmentInfoBase#location - */ - setCurrentLocation(segmentInfo:yfiles.router.SegmentInfo,location:number):void; - /** - * Gets an {@link yfiles.router.Interval interval} spanning the union of the location ranges of the {@link yfiles.router.SegmentInfo segment infos}. - * @see yfiles.router.SegmentInfoBase#locationRange - * @type {yfiles.router.Interval} - */ - widthInterval:yfiles.router.Interval; - /** - * Gets an {@link yfiles.router.Interval interval} spanning the union of the maximum extension of the {@link yfiles.router.SegmentInfo segment infos}. - * @see yfiles.router.SegmentInfoBase#maxExtension - * @type {yfiles.router.Interval} - */ - lengthInterval:yfiles.router.Interval; - /** - * Gets whether or not the segments in this {@link yfiles.router.Channel channel} are vertical. - * @type {boolean} - */ - vertical:boolean; - /** - * Gets the bounds of this {@link yfiles.router.Channel channel}. - *

- * These bounds are determined by the channel's {@link yfiles.router.Channel#widthInterval width} and {@link yfiles.router.Channel#lengthInterval length}. - *

- * @see yfiles.router.Channel#widthInterval - * @see yfiles.router.Channel#lengthInterval - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Channel; - } - /** - * This class routes edges using their pre-calculated {@link yfiles.router.Path} information. - *

- * The concept of this algorithm is to bundle edge {@link yfiles.router.SegmentInfo segment}s into so-called {@link yfiles.router.Channel}s and route each {@link yfiles.router.Channel} - * individually. - *

- *

- * This class is initialized using {@link yfiles.router.ChannelBasedPathRouting#initialize} which must have been called before the - * edges are {@link yfiles.router.ChannelBasedPathRouting#route routed}. - *

- *

- * After a {@link yfiles.router.ChannelBasedPathRouting} instance is no longer in use, the {@link yfiles.router.Channel} information and - * the reference to the {@link yfiles.router.PathSearchConfiguration configuration} must be reset using method {@link yfiles.router.ChannelBasedPathRouting#cleanup}. - *

- * @see yfiles.router.EdgeInfo#getSegmentInfo - * @see yfiles.layout.LayoutGraph#setPath - * @class - */ - export interface ChannelBasedPathRouting extends yfiles.lang.Object{} - export class ChannelBasedPathRouting { - /** - * Creates a new instance of {@link yfiles.router.ChannelBasedPathRouting}. - */ - constructor(); - /** - * Adjusts the location assigned to a {@link yfiles.router.SegmentInfo segment info} in the {@link yfiles.router.Channel channel} considering the preferred alignment of the segment. - *

- * This method is called after the segments have been distributed in the channel but before the final locations of the - * segments are assigned to the {@link yfiles.router.SegmentInfo segment info}s. - *

- * @param channel the channel that contains the segment infos for which the alignment should be considered - * @see yfiles.router.Channel#getCurrentLocation - * @see yfiles.router.SegmentInfoBase#preferredAlignment - * @protected - */ - adjustSegmentLocations(channel:yfiles.router.Channel):void; - /** - * Calculates the locations of the {@link yfiles.router.SegmentInfo segment infos} in the given {@link yfiles.router.Channel channel}. - *

- * This method is called after the order of the {@link yfiles.router.SegmentInfo segment infos} within a channel has been {@link yfiles.router.ChannelBasedPathRouting#optimizeSegmentOrder optimized}. - *

- * @param channel the channel that contains the segment infos for which the locations will be calculated - * @see yfiles.router.Channel#setCurrentLocation - * @protected - */ - calculateSegmentLocations(channel:yfiles.router.Channel):void; - /** - * Resets all {@link yfiles.router.Channel channel} information and the reference to the {@link yfiles.router.PathSearchConfiguration configuration}. - *

- * Afterwards, {@link yfiles.router.ChannelBasedPathRouting} is ready to calculate paths for a new layout. - *

- */ - cleanup():void; - /** - * Creates a {@link yfiles.collections.IComparer. comparator} for sorting the {@link yfiles.router.SegmentInfo}s in a {@link yfiles.router.Channel} from left to right (for - * vertical segments) or top to bottom (for horizontal segments), respectively. - *

- * This method is called in {@link yfiles.router.ChannelBasedPathRouting#route} before edge segments are distributed within the - * channels. - *

- * @param channels the channels whose segments will be sorted by the {@link comparator} - * @param pathSearchResult the {@link path search result} containing the {@link }s with the - * {@link }s for which the comparator will be used - * @param configuration the {@link configuration} used during this path search - * @returns a {@link comparator} used for sorting the {@link }s in a {@link channel} - * @protected - */ - createSegmentInfoComparer(channels:yfiles.algorithms.YList,pathSearchResult:yfiles.router.PathSearchResult,configuration:yfiles.router.PathSearchConfiguration):yfiles.collections.IComparer; - /** - * Initializes this {@link yfiles.router.ChannelBasedPathRouting} instance for routing paths that have been found with the given - * {@link yfiles.router.PathSearchConfiguration configuration}. - *

- * This method must be called before the edges are {@link yfiles.router.ChannelBasedPathRouting#route routed}. - *

- * @param configuration the {@link configuration} used for the following path routing - * @see yfiles.router.ChannelBasedPathRouting#route - */ - initialize(configuration:yfiles.router.PathSearchConfiguration):void; - /** - * Optimizes the order of the {@link yfiles.router.SegmentInfo segments} in the given {@link yfiles.router.Channel channel}. - *

- * After the segments in the channel have been sorted using the comparator created by method - * {@link yfiles.router.ChannelBasedPathRouting#createSegmentInfoComparer}, segments having a common {@link yfiles.router.SegmentGroup} are - * replaced by their common {@link yfiles.router.SegmentGroup#commonSegmentInfo representative segment info}. - *

- *

- * This method further improves the order of the resulting segment info list to make sure that the subsequent {@link yfiles.router.ChannelBasedPathRouting#calculateSegmentLocations location calculation} - * is able to respect the {@link yfiles.router.SegmentInfoBase#locationRange location ranges} of the - * {@link yfiles.router.SegmentInfo}s and, if possible, the minimum edge to edge distances and possible grid constraints for the - * segments. - *

- * @param channel the channel for which the order of the {@link }s is optimized - * @protected - */ - optimizeSegmentOrder(channel:yfiles.router.Channel):void; - /** - * Routes the given edges. - *

- * Before calling this method, method {@link yfiles.router.ChannelBasedPathRouting#initialize} must have been called. - *

- *

- * As a first step, the {@link yfiles.router.SegmentInfo}s of all edge paths are distributed to {@link yfiles.router.Channel}s. After that, - * the segments in each of these - * {@link yfiles.router.Channel}s are sorted and locations are assigned respecting the segments' location ranges by calling the - * subsequent methods: - *

- *
    - *
  1. {@link yfiles.router.ChannelBasedPathRouting#optimizeSegmentOrder}
  2. - *
  3. {@link yfiles.router.ChannelBasedPathRouting#calculateSegmentLocations}
  4. - *
  5. {@link yfiles.router.ChannelBasedPathRouting#adjustSegmentLocations}
  6. - *
- *

- * Finally, the control points for the paths are calculated. - *

- * @param edges the {@link list of edges} to be routed - * @param pathSearchResult the {@link path search result} containing the {@link } objects for the edges - * @throws {Stubs.Exceptions.InvalidOperationError} if the locations are not within the segment's location range - * @see yfiles.router.PathSearchResult#getPath - * @see yfiles.router.SegmentInfoBase#locationRange - * @see yfiles.router.SegmentInfoBase#location - */ - route(edges:yfiles.algorithms.EdgeList,pathSearchResult:yfiles.router.PathSearchResult):void; - /** - * Sorts the given list of {@link yfiles.router.SegmentInfo}s using the given {@link yfiles.collections.IComparer. comparator}. - *

- * This method is called in {@link yfiles.router.ChannelBasedPathRouting#route} when the edge segments are distributed within the - * channels. - *

- * @param segmentInfos the list of {@link }s to be sorted - * @param segmentInfoComparer the comparator used for sorting the list of {@link }s - * @protected - */ - sortSegmentInfos(segmentInfos:yfiles.collections.IList,segmentInfoComparer:yfiles.collections.IComparer):void; - /** - * Gets the {@link yfiles.router.PathSearchConfiguration path search configuration} with which the {@link yfiles.router.ChannelBasedPathRouting} has been {@link yfiles.router.ChannelBasedPathRouting#initialize initialized}. - * @see yfiles.router.ChannelBasedPathRouting#initialize - * @protected - * @type {yfiles.router.PathSearchConfiguration} - */ - configuration:yfiles.router.PathSearchConfiguration; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ChannelBasedPathRouting; - } - /** - * This class describes an {@link yfiles.router.IObstaclePartition} that decomposes its area dynamically. - *

- * The partitioning strategy is based on binary space partitioning. It divides the partition space recursively in two {@link yfiles.router.PartitionCell cells} - * until each cell is completely covered by one or more {@link yfiles.router.Obstacle}s or completely empty. - *

- * @class - * @implements {yfiles.router.IObstaclePartition} - * @implements {yfiles.router.IDynamicDecomposition} - */ - export interface DynamicObstacleDecomposition extends yfiles.lang.Object,yfiles.router.IObstaclePartition,yfiles.router.IDynamicDecomposition{} - export class DynamicObstacleDecomposition { - /** - * Constructs a new instance of {@link yfiles.router.DynamicObstacleDecomposition}. - */ - constructor(); - /** - * Adds the given {@link yfiles.router.IDecompositionListener dynamic decomposition listener} to receive {@link yfiles.router.PartitionCell} subdivision and creation events - * from this decomposition. - *

- * These events occur when the decomposition changes the partition by subdividing cells into sub-cells or when new cells - * are created. - *

- * @param listener the dynamic decomposition listener to add - * @see yfiles.router.IDecompositionListener - */ - addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Clears the partition data such that the {@link yfiles.router.DynamicObstacleDecomposition} can be reused and {@link yfiles.router.DynamicObstacleDecomposition#init initialized} with - * new {@link yfiles.router.Obstacle}s. - * @see yfiles.router.DynamicObstacleDecomposition#init - */ - clear():void; - /** - * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} that the given {@link yfiles.router.PartitionCell partition cell} has been created. - *

- * This method is also called in {@link yfiles.router.DynamicObstacleDecomposition#init}. - *

- * @param createdCell the newly created cell - * @see yfiles.router.IDecompositionListener - * @protected - */ - fireCreateCellEvent(createdCell:yfiles.router.PartitionCell):void; - /** - * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} that the given {@link yfiles.router.PartitionCell partition cell} has been finalized. - * @param finalizedCell the cell that has been finalized - * @see yfiles.router.IDecompositionListener - * @protected - */ - fireFinalizeCellEvent(finalizedCell:yfiles.router.PartitionCell):void; - /** - * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} of a subdivision of a given {@link yfiles.router.PartitionCell partition cell}. - * @param cell the cell that has been subdivided - * @param subCells the new sub-cells resulting from the subdivision of the given cell - * @see yfiles.router.IDecompositionListener - * @protected - */ - fireSubdividedEvent(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; - /** - * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle. - * @param rect the rectangular area whose (partially) covered cells will be returned - * @returns a list of {@link }s that (partially) cover the given rectangular area - */ - getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; - /** - * Returns all {@link yfiles.router.PartitionCell partition cells} that are completely covered by the given {@link yfiles.router.Obstacle}. - * @param obstacle the obstacle for which the covered cells will be returned - * @returns an unmodifiable list of {@link } instances that are completely covered by the given obstacle - */ - getCellsForObstacle(obstacle:yfiles.router.Obstacle):yfiles.collections.IList; - /** - * Calculates the cost of a cut with respect to the geometry of the sub-cells. - *

- * The cost can take values between 0 and 1. - *

- *

- * This method is called while a {@link yfiles.router.PartitionCell} is divided into upper and lower or left and right child cells - * depending on the cut costs (during {@link yfiles.router.DynamicObstacleDecomposition#getCellsForObstacle}, {@link yfiles.router.DynamicObstacleDecomposition#getCells} - * and {@link yfiles.router.DynamicObstacleDecomposition#getNeighbors} methods). - *

- * @param cut the coordinate of the cut - * @param min the left side of the subdivided cell - * @param max the right side of the subdivided cell - * @param orthogonalMin the upper side of the subdivided cell - * @param orthogonalMax the lower side of the subdivided cell - * @returns the cost of a cut with respect to the geometry of the sub-cells - * @protected - */ - getGeometricCutCosts(cut:number,min:number,max:number,orthogonalMin:number,orthogonalMax:number):number; - /** - * Returns the neighbor {@link yfiles.router.PartitionCell partition cells} of the given cell. - * @param cell the cell whose neighbors will be returned - * @returns the neighbor cells of the given cell - */ - getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Calculates the cost of a cut with respect to the subdivided obstacles. - *

- * The cost can take values between 0 and 1. - *

- *

- * This method is called while a {@link yfiles.router.PartitionCell} is divided into upper and lower or left and right child cells - * depending on the cut costs (during {@link yfiles.router.DynamicObstacleDecomposition#getCellsForObstacle}, {@link yfiles.router.DynamicObstacleDecomposition#getCells} - * and {@link yfiles.router.DynamicObstacleDecomposition#getNeighbors} methods). - *

- * @param numObstaclesInFirstHalf the number of obstacles that lie completely in the first half - * @param numObstaclesInSecondHalf the number of obstacles that lie completely in the second half - * @param numObstaclesOnCut the number of obstacles that lie on the cut - * @returns the cost of a cut with respect to the subdivided obstacles - * @protected - */ - getObstacleCutCosts(numObstaclesInFirstHalf:number,numObstaclesInSecondHalf:number,numObstaclesOnCut:number):number; - /** - * Returns all {@link yfiles.router.Obstacle}s that cover the given {@link yfiles.router.PartitionCell partition cell}. - * @param cell the partition cell for which the obstacles will be returned - * @returns an unmodifiable list of {@link } instances that cover the given cell - */ - getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Initializes this {@link yfiles.router.DynamicObstacleDecomposition} instance with the given obstacles and partition bounds. - *

- * This method must be called before any other method is invoked. - *

- * @param obstacles a list of {@link } objects - * @param partitionBounds the bounds of the partition - */ - init(obstacles:yfiles.collections.IList,partitionBounds:yfiles.algorithms.YRectangle):void; - /** - * Removes the given {@link yfiles.router.IDecompositionListener dynamic decomposition listener} such that it no longer receives {@link yfiles.router.PartitionCell} subdivision - * and creation events from this decomposition. - * @param listener the dynamic decomposition listener to remove - * @see yfiles.router.IDecompositionListener - */ - removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Gets or sets the costs incurred for every {@link yfiles.router.Obstacle} that must be cut in a subdivision. - *

- * Values need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative - * @type {number} - */ - cutObstacleCost:number; - /** - * Gets or sets the costs incurred if the distribution after a subdivision of obstacles is unbalanced in sub-cells. - *

- * Values need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative - * @type {number} - */ - unbalancedObstaclesCost:number; - /** - * Gets or sets the costs incurred if the subdivision produces unbalanced rectangles. - *

- * Values need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative - * @type {number} - */ - unbalancedRatioCost:number; - /** - * Gets the bounds of the original rectangular area that is being partitioned. - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.DynamicObstacleDecomposition; - } - /** - * This class encapsulates the information that determines the route of a specific edge within a specific {@link yfiles.router.PartitionCell partition cell}. - * @class - */ - export interface EdgeCellInfo extends yfiles.lang.Object{} - export class EdgeCellInfo { - /** - * Creates a new {@link yfiles.router.EdgeCellInfo} instance. - * @param edge the edge whose routing in the cell is described - * @param cell the cell in which the edge is routed - * @param enterInterval the interval that the edge uses to enter the cell - * @param exitInterval the interval that the edge uses to exit the cell - * @param enterDirection the direction in which the edge enters the cell - * @param exitDirection the direction in which the edge exits the cell - * @param enterSegmentNo the index of the edge segment that enters the cell - */ - constructor(edge:yfiles.algorithms.Edge,cell:yfiles.router.PartitionCell,enterInterval:yfiles.router.OrthogonalInterval,exitInterval:yfiles.router.OrthogonalInterval,enterDirection:yfiles.layout.Direction,exitDirection:yfiles.layout.Direction,enterSegmentNo:number); - /** - * Gets the number of bends of the edge within this cell. - * @type {number} - */ - bendCount:number; - /** - * Gets the routing type of the edge within this cell. - * @type {yfiles.router.RoutingType} - */ - type:yfiles.router.RoutingType; - /** - * Gets or sets the index of the edge segment that enters this cell. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given index is negative - * @type {number} - */ - enterSegmentIndex:number; - /** - * Gets or sets the index of the edge segment that exits this cell. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given index is negative - * @type {number} - */ - exitSegmentIndex:number; - /** - * Gets or sets the {@link yfiles.router.SegmentGroup segment group} containing the entering segment. - *

- * When specifying the segment group, the {@link yfiles.router.EdgeCellInfo#enterInterval enter interval} is updated to use the segment group's common enter interval. - *

- * @see yfiles.router.SegmentGroup#commonLocationRange - * @type {yfiles.router.SegmentGroup} - */ - enterSegmentGroup:yfiles.router.SegmentGroup; - /** - * Gets or sets the {@link yfiles.router.SegmentGroup segment group} containing the exiting segment. - *

- * When specifying the segment group, the {@link yfiles.router.EdgeCellInfo#exitInterval exit interval} is updated to use the segment group's common exit interval. - *

- * @see yfiles.router.SegmentGroup#commonLocationRange - * @type {yfiles.router.SegmentGroup} - */ - exitSegmentGroup:yfiles.router.SegmentGroup; - /** - * Gets the edge that is routed within the {@link yfiles.router.EdgeCellInfo#cell partition cell}. - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - /** - * Gets the {@link yfiles.router.PartitionCell partition cell} within which the edge is routed. - * @type {yfiles.router.PartitionCell} - */ - cell:yfiles.router.PartitionCell; - /** - * Gets the {@link yfiles.router.OrthogonalInterval interval} that the edge uses to enter this cell. - * @type {yfiles.router.OrthogonalInterval} - */ - enterInterval:yfiles.router.OrthogonalInterval; - /** - * Gets the {@link yfiles.router.OrthogonalInterval interval} that the edge uses to exit this cell. - * @type {yfiles.router.OrthogonalInterval} - */ - exitInterval:yfiles.router.OrthogonalInterval; - /** - * Gets the {@link yfiles.layout.Direction direction} in which the edge enters this cell. - * @type {yfiles.layout.Direction} - */ - enterDirection:yfiles.layout.Direction; - /** - * Gets the {@link yfiles.layout.Direction direction} in which the edge exits this cell. - * @type {yfiles.layout.Direction} - */ - exitDirection:yfiles.layout.Direction; - /** - * Calculates the list of {@link yfiles.router.CellSegmentInfo}s for the segment parts of this edge that lie within the associated - * {@link yfiles.router.EdgeCellInfo#cell partition cell}. - * @type {yfiles.algorithms.YList} - */ - cellSegmentInfos:yfiles.algorithms.YList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.EdgeCellInfo; - } - /** - * This class encapsulates the information required to route an edge with a path routing algorithm. - * @see yfiles.router.ChannelBasedPathRouting - * @class - */ - export interface EdgeInfo extends yfiles.lang.Object{} - export class EdgeInfo { - /** - * Creates a new {@link yfiles.router.EdgeInfo} instance. - * @param path the path that will be used for routing the edge - * @param configuration the {@link configuration} of the path search algorithm - */ - constructor(path:yfiles.router.Path,configuration:yfiles.router.PathSearchConfiguration); - /** - * Calculates an array of {@link yfiles.algorithms.LineSegment}s created by the {@link yfiles.router.EdgeInfo#calculatePathPoints calculated path points}. - * @returns an array of {@link }s created by the calculated path points - */ - calculateLineSegments():yfiles.algorithms.LineSegment[]; - /** - * Calculates a list of {@link yfiles.algorithms.YPoint}s containing the source port, bend and target port locations. - * @returns a list of {@link }s containing the source port, bend and target port locations - */ - calculatePathPoints():yfiles.algorithms.YList; - /** - * Returns the {@link yfiles.router.EdgeCellInfo} of the given {@link yfiles.router.CellEntrance} in the path. - * @param entrance the entrance for which the {@link } will be returned - * @returns the {@link } of the given {@link } in the path - */ - getEdgeCellInfo(entrance:yfiles.router.CellEntrance):yfiles.router.EdgeCellInfo; - /** - * Returns the {@link yfiles.router.SegmentInfo} of the segment following the segment of the given {@link yfiles.router.SegmentInfo}. - * @param segment the segment info for which the next segment info will be returned - * @returns the segment info of the segment following the segment of the given segment info - */ - getNextSegment(segment:yfiles.router.SegmentInfo):yfiles.router.SegmentInfo; - /** - * Returns the {@link yfiles.router.SegmentInfo} of the segment preceding the segment of the given {@link yfiles.router.SegmentInfo}. - * @param segment the segment info for which the previous segment info will be returned - * @returns the segment info of the segment preceding the segment of the given segment info - */ - getPreviousSegment(segment:yfiles.router.SegmentInfo):yfiles.router.SegmentInfo; - /** - * Returns the {@link yfiles.router.SegmentInfo} of the edge segment with the given index. - * @param segmentIndex the index of the edge segment for which the segment info will be returned - * @returns the {@link } of the edge segment with the given index - */ - getSegmentInfo(segmentIndex:number):yfiles.router.SegmentInfo; - /** - * Returns the number of segments of the edge. - * @returns the number of segments of the edge - */ - segmentCount():number; - /** - * Gets whether the path of this {@link yfiles.router.EdgeInfo#edge edge} is fixed or should be routed by the path search algorithm. - * @type {boolean} - */ - fixed:boolean; - /** - * Gets the edge whose route is described by this {@link yfiles.router.EdgeInfo} instance. - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - /** - * Gets a list of {@link yfiles.router.EdgeCellInfo}s describing how the edge traverses each {@link yfiles.router.PartitionCell} on its - * path. - * @type {yfiles.collections.IList.} - */ - edgeCellInfos:yfiles.collections.IList; - /** - * Gets or sets the location of the strong source port that the edge uses. - *

- * Defining a new strong source port also updates the first {@link yfiles.router.SegmentInfo} to use this fixed port location. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the first segment is already fixed and the given port location contradicts the segment's fixed location - * @see yfiles.router.SegmentInfoBase#location - * @see yfiles.router.SegmentInfo#atStrongPortConstraint - * @type {yfiles.algorithms.YPoint} - */ - strongSourcePort:yfiles.algorithms.YPoint; - /** - * Gets or sets the location of the strong target port that the edge uses. - *

- * Defining a new strong target port also updates the last {@link yfiles.router.SegmentInfo} to use this fixed port location. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the last segment is already fixed and the given port location contradicts the segment's fixed location - * @see yfiles.router.SegmentInfoBase#location - * @see yfiles.router.SegmentInfo#atStrongPortConstraint - * @type {yfiles.algorithms.YPoint} - */ - strongTargetPort:yfiles.algorithms.YPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.EdgeInfo; - } - /** - * This class is used by {@link yfiles.router.EdgeRouter} to provide routing details for the edges of the graph. - *

- * An {@link yfiles.router.EdgeLayoutDescriptor} instance can be specified individually for single edges using a {@link yfiles.algorithms.IDataProvider} - * that returns an {@link yfiles.router.EdgeLayoutDescriptor} instance for each edge of the graph, or null if no {@link yfiles.router.EdgeLayoutDescriptor} - * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph using key - * {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- *

- * This class is designed such that it allows future additions of new getter methods. - *

- * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @class - */ - export interface EdgeLayoutDescriptor extends yfiles.lang.Object{} - export class EdgeLayoutDescriptor { - /** - * Creates a new instance of an {@link yfiles.router.EdgeLayoutDescriptor} with the default settings. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.router.EdgeLayoutDescriptor} instance. - * @returns a copy of this {@link } instance - */ - createCopy():yfiles.router.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum length of the first segment of the edge path (at the source node). - *

- * The minimum length should be greater than or equal to 0. If a negative value is given as input, the default value, i.e., - * 5.0, will be used instead. - *

- * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length of the last segment of the edge path (at the target node). - *

- * The minimum length should be greater than or equal to 0. If a negative value is given as input, the default value, i.e., - * 10.0, will be used instead. - *

- * @type {number} - */ - minimumLastSegmentLength:number; - /** - * Gets or sets the minimum distance between a pair of edges. - *

- * The minimum distance should be greater than or equal to 0. If a negative value is given as input, the default value, - * i.e., 3.0, will be used instead. - *

- * @type {number} - */ - minimumEdgeToEdgeDistance:number; - /** - * Gets or sets the minimum distance that the edge should maintain from node corners when entering or leaving the node. - *

- * The minimum distance should be greater than or equal to 0. If a negative value is given as input, the default value, - * i.e., 3.0, will be used instead. - *

- * @type {number} - */ - minimumNodeCornerDistance:number; - /** - * Gets or sets the monotonic path restrictions that should be applied. - *

- * Monotonic path restrictions imply that (ideally) the vertical and/or horizontal segments of an edge path are directed - * from the source node towards the target node without ever changing their direction back towards the source node. - *

- *

- * If an unknown restriction is specified, {@link yfiles.router.MonotonicPathRestriction#NONE} will be used instead. - *

- * @type {yfiles.router.MonotonicPathRestriction} - */ - monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; - /** - * Gets or sets the {@link yfiles.router.PenaltySettings} used for this edge. - *

- * Besides specifying a completely customized setting, the user can choose between four predefined optimization strategies: - * {@link yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS} - * and {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given penalty settings are null - * @see yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED - * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS - * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS - * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS - * @type {yfiles.router.PenaltySettings} - */ - penaltySettings:yfiles.router.PenaltySettings; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.EdgeLayoutDescriptor; - } - /** - * This edge routing algorithm applies polyline routes to the edges of the graph. - *

- * Layout Style Edges are normally routed in an orthogonal fashion, i.e., they only consist of horizontal and vertical segments. There - * is also a {@link yfiles.router.EdgeRouter#polylineRouting routing style} in which, between horizontal and vertical segments, additional segments with other slopes are - * inserted. - *

- *

- * During the routing process, the positions of the nodes are considered to be fixed and the routing algorithm will not - * modify their locations or their sizes in any way. - *

- *

- * The edge routing algorithm can be applied wherever it is needed to route the edges as polyline or orthogonal segments - * without crossing any nodes, while keeping the positions of the nodes in the diagram fixed. Some potential applications - * include electric circuit design, floor planning and navigation maps. - *

- *

- * {@graph {"ann":{"s":[80,100],"d":1},"n":[[217.75,668.75],[447.12,732.5,135,30],[582,230.25],[582,530.75],[738,668.75],[497.5,372],[770.38,245.25,30,70],[674,419.5],[447.12,525.12,30,30],[357.12,253.38,30,82.5],[369.62,441.38,30,60]],"e":[[0,1,40,28.75,-67.5,0],[0,2,-9.25,-50,-40,-41.94,[248.5,238.31]],[1,3,67.5,-6,3.56,50,[625.56,741.5]],[0,4,40,-8.94,-40,-8.94],[1,4,67.5,6,-40,34.75],[0,5,27.75,-50,-40,-4.72,[285.5,417.28]],[0,6,-27.75,-50,0,-35,[230,220.25,785.38,220.25]],[4,6,7.38,-50,0,35],[2,6,40,0,-15,0],[5,7,40,44.95,-40,-2.55],[4,7,-32,-50,32,50],[7,2,-40,-17.6,19.12,50,[641.12,451.9]],[0,8,40,-34.31,0,15,[462.12,684.44]],[0,9,9.25,-50,-15,0,[267,294.62]],[5,9,-40,-32.91,0,41.25,[372.12,389.09]],[9,2,15,-2.81,-40,11.56],[10,8,15,21.54,0,-15,[462.12,492.92]],[10,3,15,10.62,-16.62,-50,[605.38,482]],[10,5,15,-19.48,-40,29.9]],"vp":[217.0,220.0,601.0,549.0]}} Sample output of the edge routing algorithm with default settings {@graph {"ann":{"s":[80,100],"d":1},"n":[[-80.25,263.5,30,30],[-309.62,407.12],[-170.25,-8.25,30,82.5],[-80.25,470.88,135,30],[54.62,-31.38],[54.62,269.12],[-157.75,179.75,30,60],[210.62,407.12],[-29.88,110.38],[243,-16.38,30,70],[146.62,157.88]],"e":[[1,0,40,28.75,-15,0,[-207.88,485.88,-199.94,477.94,-199.94,300.94,-177.5,278.5]],[1,2,40,28.75,-6,41.25,[-207.88,485.88,-199.94,477.94,-199.94,152.94,-188.56,141.56,-172.56,141.56,-161.25,130.25]],[1,3,40,28.75,-67.5,0],[1,4,40,28.75,0,-50,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,94.62,-41.38]],[2,4,15,-2.81,-40,11.56],[3,5,67.5,0,3.56,50,[86.12,485.88,98.19,473.81]],[6,0,15,-14.69,0,-15,[-80.94,195.06,-65.25,210.75]],[6,5,15,-14.69,-18.5,-50,[-80.94,195.06,-65.25,210.75,-65.25,233.75,-49.25,249.75,70.75,249.75,76.12,255.12]],[1,7,40,28.75,34.69,-50,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,268.62,-41.38,285.31,-24.69]],[3,7,67.5,0,-40,28.75],[6,8,15,-14.69,-40,34.69],[1,8,40,28.75,-40,-18.81,[-207.88,485.88,-199.94,477.94,-199.94,152.94,-188.56,141.56]],[8,2,40,47,6,41.25,[60.12,207.38,60.12,100.12,52.31,92.31,-144.69,92.31,-149.25,87.75]],[1,9,40,28.75,0,-35,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,250.62,-41.38,258,-34]],[7,9,-32,-50,0,35,[218.62,334.38,229.5,323.5,246.5,323.5,258,312]],[4,9,40,0,-15,0],[8,10,40,47,-40,-0.5],[7,10,-32,-50,32,50],[10,4,-40,-29.22,18.5,50,[122.65,178.65,113.12,169.12]]],"vp":[-310.0,-42.0,601.0,550.0]}} Sample output of the edge routing algorithm with - * polyline routing and grouped edges {@graph {"ann":{"s":[80,100],"d":1},"n":[[556.12,477.62],[648.12,366.38],[471.62,318.88],[316.25,181.25,150,335.75,2],[421.25,472,30,30],[331.25,200.25,30,82.5],[343.75,388.25,30,60],[191.88,615.62],[421.25,679.38,135,30],[712.12,615.62],[541.12,158.12,248.38,134,2],[556.12,177.12],[744.5,192.12,30,70]],"e":[[2,1,40,36.2,-40,-11.3],[2,5,-7.94,-50,15,19.12,[503.69,277.69,486.62,260.62]],[6,4,15,21.54,0,-15,[426.79,439.79,436.25,449.25]],[6,0,15,10.62,-16.62,-50,[564.88,428.88,579.5,443.5]],[6,2,15,-14.69,-40,34.69],[7,4,40,-38.54,0,15,[413.92,627.08,436.25,604.75]],[7,2,40,-21.62,-0.44,50,[489,644,511.19,621.81]],[7,5,24.67,-50,-15,0,[256.54,263.46,278.5,241.5]],[7,8,40,28.75,-67.5,0],[8,0,67.5,-6,3.56,50,[587.62,688.38,599.69,676.31]],[7,9,40,-4.71,-40,-4.71],[8,9,67.5,6,-40,34.75],[9,1,-32,-50,32,50],[7,11,0,-50,0,-50,[231.88,189.12,253.88,167.12,596.12,167.12]],[5,11,15,-19.12,-40,-4.75],[1,11,-40,-35.1,19.12,50,[624.27,381.27,615.25,372.25]],[7,12,-24.67,-50,0,-35,[207.21,186.79,229.87,164.12,751.12,164.12,759.5,172.5]],[9,12,7.38,-50,0,35],[11,12,40,0,-15,0]],"vp":[191.0,158.0,602.0,558.0]}} Sample output of the edge routing algorithm with polyline routing and group - * nodesConceptThe edge routing algorithm basically performs three (four) steps to achieve an orthogonal (polyline) edge routing. - *

- *
    - *
  1. Creating a {@link yfiles.router.IPartition} which divides the area of the graph area into several {@link yfiles.router.PartitionCell}s.
  2. - *
  3. Finding the shortest/cheapest paths for all edges through the {@link yfiles.router.IPartition} using {@link yfiles.router.PathSearch}.
  4. - *
  5. - * Assigning coordinates to the segments of the edges based on the paths that were calculated before with - * {@link yfiles.router.ChannelBasedPathRouting}. - *
  6. - *
  7. Inserting non-orthogonal segments where horizontal and vertical segments meet (only if {@link yfiles.router.EdgeRouter#polylineRouting polyline routing} is enabled).
  8. - *
- *

- * The first two steps are customizable. {@link yfiles.router.IGraphPartitionExtension}s are able to influence how the {@link yfiles.router.IPartition} - * is created. They add {@link yfiles.router.PartitionCell}s and/or mark them for adding costs later in the process. The currently - * used {@link yfiles.router.EdgeRouter#registeredPartitionExtensions partition extensions} can be dropped or extended by custom implementations. - *

- *

- * For example, the extension 'Node Partition' adds a {@link yfiles.router.PartitionCell} to the {@link yfiles.router.IPartition} for each - * node and marks it as belonging to a node. During {@link yfiles.router.PathSearch}, the extension 'Node Crossing' recognizes - * these - * {@link yfiles.router.PartitionCell}s and adds costs that penalizes crossing a node. The edge will be routed around the nodes. - *

- *

- * {@link yfiles.router.PathSearchExtension}s influence the {@link yfiles.router.PathSearch} by adding costs for traversing - * {@link yfiles.router.PartitionCell}s or narrowing their intervals to allow a less expensive traversal of a - * {@link yfiles.router.PartitionCell}. The currently used {@link yfiles.router.EdgeRouter#registeredPathSearchExtensions partition extensions} can be dropped or extended by custom - * implementations. - *

- *

- * Using {@link yfiles.router.EdgeLayoutDescriptor}s, it is possible to add individual layout settings like routing styles to - * edges. They are registered with the graph with key {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If no - * descriptor is provided for an edge, a {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default edge layout descriptor} is used as fallback value. - *

- *

- * Features - *

- *

- * The routing algorithm supports two approaches to connect edges on a specific side or even on an exact location to a - * node. {@link yfiles.layout.PortConstraint}s define a single constraint for the ports of an edge. To realize more complex port - * restrictions, several {@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortCandidateSet}s can be assigned to edges or nodes. - * If an edge with registered {@link yfiles.layout.PortCandidate}s connects to nodes with {@link yfiles.layout.PortCandidateSet}s, the edge - * router will try to match both collections in order to find an appropriate port. In case there is no matching port - * candidate, a {@link yfiles.layout.PortCandidate} specified for the edge is preferred. Since their simultaneous existence at the - * same node may be ambiguous, it is not recommended to use a combination of {@link yfiles.layout.PortConstraint}s and - * {@link yfiles.layout.PortCandidate}s in the same diagram. - *

- *

- * Edges can be grouped so that they share common segments at the beginning or end of their routes. Although a graph may - * contain source and target grouped edges, an edge can only either be part of a source or a target group. Edge groups are - * specified using {@link yfiles.algorithms.IDataProvider}s that provide the same ID object for all edges in the same group. Those - * {@link yfiles.algorithms.IDataProvider}s are registered with the graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * for source groups or key {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} for target groups. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface EdgeRouter extends yfiles.layout.LayoutStageBase{} - export class EdgeRouter { - /** - * Creates a new {@link yfiles.router.EdgeRouter} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Removes all registered {@link yfiles.router.IGraphPartitionExtension}s from a given {@link yfiles.router.GraphPartition} instance. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} after the edge routes are calculated. It may be overridden - * in order to provide a custom implementation for cleaning up a {@link yfiles.router.GraphPartition} instance. - *

- * @param partition the given {@link } instance - * @see yfiles.router.EdgeRouter#configureGraphPartition - * @see yfiles.router.EdgeRouter#registeredPartitionExtensions - * @protected - */ - cleanUpGraphPartition(partition:yfiles.router.GraphPartition):void; - /** - * Adds all registered {@link yfiles.router.IGraphPartitionExtension}s instances to a given {@link yfiles.router.GraphPartition} instance. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to adjust the configuration of the {@link yfiles.router.GraphPartition} instance. - *

- * @param partition the given {@link } instance - * @see yfiles.router.EdgeRouter#registeredPartitionExtensions - * @see yfiles.router.EdgeRouter#cleanUpGraphPartition - * @protected - */ - configureGraphPartition(partition:yfiles.router.GraphPartition):void; - /** - * Adds all registered {@link yfiles.router.PathSearchExtension}s to a given {@link yfiles.router.PathSearch} instance. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to adjust the configuration of a {@link yfiles.router.PathSearch} instance. - *

- * @param pathSearch a {@link } instance - * @see yfiles.router.EdgeRouter#createPathSearch - * @see yfiles.router.EdgeRouter#registeredPathSearchExtensions - * @protected - */ - configurePathSearch(pathSearch:yfiles.router.PathSearch):void; - /** - * Creates a {@link yfiles.router.PathSearchConfiguration} that is used during the path searching process. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.PathSearchConfiguration} object with custom configuration. - *

- * @param graph the input graph - * @param grouping the grouping structure of the graph - * @returns a {@link } instance - * @protected - */ - createConfiguration(graph:yfiles.layout.LayoutGraph,grouping:yfiles.layout.GroupingSupport):yfiles.router.PathSearchConfiguration; - /** - * Creates a default {@link yfiles.collections.IComparer.} instance to determine the order of the edges according to which they will be routed. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.collections.IComparer.} object with a custom configuration. - *

- *

- * By default, this method returns an instance of the default implementation. - *

- * @param graph the input graph - * @param configuration the given configuration for the path searching process - * @returns a {@link } instance - * @protected - */ - createDefaultEdgeOrderComparer(graph:yfiles.layout.LayoutGraph,configuration:yfiles.router.PathSearchConfiguration):yfiles.collections.IComparer; - /** - * Creates a {@link yfiles.router.GraphPartition} instance that divides the area of the graph into several rectangles. - *

- * This implementation creates a {@link yfiles.router.GraphPartition} using the current {@link yfiles.router.IObstaclePartition} instance. - *

- *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.GraphPartition} object with a custom configuration. - *

- * @param decomposition the current {@link } - * @returns a {@link } instance - * @see yfiles.router.EdgeRouter#configureGraphPartition - * @see yfiles.router.EdgeRouter#registeredPartitionExtensions - */ - createGraphPartition(decomposition:yfiles.router.IObstaclePartition):yfiles.router.GraphPartition; - /** - * Creates a {@link yfiles.router.DynamicObstacleDecomposition} that is used by the {@link yfiles.router.GraphPartition} to divide the - * graph area in rectangles. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.DynamicObstacleDecomposition} object with custom configuration. - *

- * @returns a {@link } instance - * @see yfiles.router.EdgeRouter#createGraphPartition - * @protected - */ - createObstacleDecomposition():yfiles.router.DynamicObstacleDecomposition; - /** - * Creates a {@link yfiles.router.ChannelBasedPathRouting} instance that routes the edges using pre-calculated {@link yfiles.router.Path} - * objects. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.ChannelBasedPathRouting} object with custom configuration. - *

- * @returns a {@link } instance - * @protected - */ - createPathRouting():yfiles.router.ChannelBasedPathRouting; - /** - * Creates a {@link yfiles.router.PathSearch} instance that finds the paths of the edges through the {@link yfiles.router.GraphPartition}. - *

- * This method may be overridden in order to create a new {@link yfiles.router.PathSearch} object with custom configuration. - *

- * @returns a {@link } instance - * @see yfiles.router.EdgeRouter#configurePathSearch - * @see yfiles.router.EdgeRouter#registeredPathSearchExtensions - * @protected - */ - createPathSearch():yfiles.router.PathSearch; - /** - * Creates a {@link yfiles.router.PathSearchContext} that provides context information for the path searching algorithm. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.PathSearchContext} object with custom configuration. - *

- * @param pathSearch a given {@link } instance - * @param configuration a given configuration for the path searching process - * @returns a {@link } instance - * @protected - */ - createPathSearchContext(pathSearch:yfiles.router.PathSearch,configuration:yfiles.router.PathSearchConfiguration):yfiles.router.PathSearchContext; - /** - * Returns the {@link yfiles.router.EdgeLayoutDescriptor} instance for a given edge that is provided by a {@link yfiles.algorithms.IDataProvider} - * which is registered with the graph with key {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- * For all those edges that do not have a specific layout descriptor assigned, the default layout descriptor returned by {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor} - * will be assigned. - *

- *

- * This method may be overridden in order to create an {@link yfiles.router.EdgeLayoutDescriptor} with custom configuration. - *

- * @param edge the given edge - * @returns the current {@link } instance for a given edge - * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor - * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - */ - getEdgeLayoutDescriptor(edge:yfiles.algorithms.Edge):yfiles.router.EdgeLayoutDescriptor; - /** - * Returns whether or not a given edge is selected. - *

- * If all the edges of the graph will be routed by {@link yfiles.router.EdgeRouter}, i.e., the {@link yfiles.router.EdgeRouter#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_ALL_EDGES}, this utility method returns true for all edges. - *

- *

- * This method may be overridden in order to determine differently whether or not a given edge is considered to be - * selected. - *

- * @param edge the given edge - * @param graph the input graph - * @returns true if the given edge is selected, false otherwise - */ - isAffected(edge:yfiles.algorithms.Edge,graph:yfiles.algorithms.Graph):boolean; - /** - * Data provider key for specifying individual edge layout information - *

- * If this {@link yfiles.algorithms.IDataProvider} does not contain an {@link yfiles.router.EdgeLayoutDescriptor} for an edge, then the - * layout algorithm will use the {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default descriptor}. - *

- * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for weighting the costs for crossing each label individually - *

- * If the factor for a label is 0 then it is allowed to cross it. Very important labels should get a high factor. - *

- *

- * This factor is multiplied by the basic penalty arising when an edge must cross a {@link yfiles.router.PenaltySettings#nodeLabelCrossingPenalty node label} or an {@link yfiles.router.PenaltySettings#edgeLabelCrossingPenalty edge label} in order to - * determine the final costs arising when this label is crossed. - *

- * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor - * @see yfiles.router.EdgeLayoutDescriptor#penaltySettings - * @const - * @static - * @type {yfiles.algorithms.ILabelLayoutDpKey.} - */ - static LABEL_CROSSING_PENALTY_FACTOR_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; - /** - * Gets or sets the time limit (in milliseconds) set for the edge routing algorithm. - *

- * The maximum duration has to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets the {@link yfiles.router.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific edge layout - * descriptor assigned. - * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.router.EdgeLayoutDescriptor} - */ - defaultEdgeLayoutDescriptor:yfiles.router.EdgeLayoutDescriptor; - /** - * Gets or sets whether or not the routing algorithm will route the edges of the graph with (non-orthogonal) polyline - * segments. - * @see yfiles.router.EdgeRouter#preferredPolylineSegmentLength - * @see yfiles.router.EdgeRouter#maximumPolylineSegmentRatio - * @type {boolean} - */ - polylineRouting:boolean; - /** - * Gets or sets the preferred length of (non-orthogonal) polyline segments. - *

- * If there is not enough space to use this preferred length, polyline segments may also be shorter. - *

- *

- * The preferred length of (non-orthogonal) polyline segments has to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the preferred polyline segment length is negative - * @see yfiles.router.EdgeRouter#maximumPolylineSegmentRatio - * @type {number} - */ - preferredPolylineSegmentLength:number; - /** - * Gets or sets the maximum ratio between the horizontal/vertical part of a segment and the (non-orthogonal) polyline - * part. - *

- * When polyline segments are added to an edge path, corners between horizontal and vertical segments are cut and replaced - * by the new segment. This ratio describes the cutting points on a segment. If it is zero, the route stays orthogonal. The - * value cannot be larger than 0.5 because there may be another polyline segment at the other side of the segment. For long - * orthogonal segments the length of the polyline segment is determined by the value returned by {@link yfiles.router.EdgeRouter#preferredPolylineSegmentLength}. - *

- *

- * The maximum polyline segment ratio must be between 0 and 0.5. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum segment length is negative or greater than 0.5 - * @type {number} - */ - maximumPolylineSegmentRatio:number; - /** - * Gets or sets whether or not the routing algorithm uses an additional step to reroute the edges that are considered to - * have the worst paths. - * @type {boolean} - */ - rerouting:boolean; - /** - * Gets or sets a (sub-)set of edges that shall be routed. - * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown - * @see yfiles.router.EdgeRouter#affectedEdgesDpKey - * @type {yfiles.router.Scope} - */ - scope:yfiles.router.Scope; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the nodes. - *

- * If the {@link yfiles.router.EdgeRouter#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}, only the edges that are incident to selected nodes will be routed, - * while all other edges will be considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @see yfiles.router.EdgeRouter#scope - * @type {any} - */ - affectedNodesDpKey:any; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the edges. - *

- * If the {@link yfiles.router.EdgeRouter#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the selected edges will be routed, while all other edges will be - * considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @see yfiles.router.EdgeRouter#scope - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets a custom {@link yfiles.collections.IComparer.} to define the processing order of the edges. - * @see yfiles.router.EdgeRouter#createDefaultEdgeOrderComparer - * @type {yfiles.collections.IComparer.} - */ - edgeComparer:yfiles.collections.IComparer; - /** - * Gets or sets whether or not the routing algorithm considers the labels of the nodes as obstacles when calculating the - * edge routes to avoid overlaps. - * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not this routing algorithm ignores node labels that are inside the bounds of their owner as - * obstacles for edge routes. - * @see yfiles.router.EdgeRouter#considerNodeLabels - * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty - * @see yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY - * @type {boolean} - */ - ignoreInnerNodeLabels:boolean; - /** - * Gets or sets whether or not the routing algorithm considers as obstacles the edge labels that do not belong to the - * (sub-)set of edges to be routed when calculating the edge routes. - * @see yfiles.router.EdgeRouter#scope - * @see yfiles.router.EdgeRouter#affectedEdgesDpKey - * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty - * @type {boolean} - */ - considerEdgeLabels:boolean; - /** - * Gets or sets the {@link yfiles.router.Grid} instance on which the routing algorithm places the orthogonal segments. - * @type {yfiles.router.Grid} - */ - grid:yfiles.router.Grid; - /** - * Gets or sets the minimum distance between edges and node bounds. - *

- * The minimum distance should have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum node-to-edge distance is negative - * @see yfiles.router.PenaltySettings#minimumNodeToEdgeDistancePenalty - * @type {number} - */ - minimumNodeToEdgeDistance:number; - /** - * Gets a list of all registered {@link yfiles.router.IGraphPartitionExtension}s. - *

- * {@link yfiles.router.IGraphPartitionExtension}s can be added to a {@link yfiles.router.GraphPartition} in order to create new - * {@link yfiles.router.Obstacle}s or can be removed from a {@link yfiles.router.GraphPartition} instance. - *

- *

- * By default, the following {@link yfiles.router.IGraphPartitionExtension}s are registered with a given {@link yfiles.router.GraphPartition} - * instance: - *

- *
    - *
  • Minimum Node To Edge Distance Partition
  • - *
  • Node Partition
  • - *
  • Partition Grid Partition
  • - *
  • Node Label Partition
  • - *
  • Edge Label Partition
  • - *
  • Fixed Edges Partition
  • - *
  • External Strong Port Restriction Partition
  • - *
- * @see yfiles.router.EdgeRouter#createGraphPartition - * @see yfiles.router.EdgeRouter#configureGraphPartition - * @type {yfiles.collections.IList.} - */ - registeredPartitionExtensions:yfiles.collections.IList; - /** - * Gets a list of all registered {@link yfiles.router.PathSearchExtension}s. - *

- * {@link yfiles.router.PathSearchExtension}s can be added to a {@link yfiles.router.PathSearch} instance in order to influence the path - * searching process or can be removed from a {@link yfiles.router.PathSearch} instance. - *

- *

- * By default, the following {@link yfiles.router.PathSearchExtension}s are registered with a {@link yfiles.router.PathSearch} instance: - *

- *
    - *
  • Fixed Grouped Edges
  • - *
  • Node Crossing
  • - *
  • Minimum Node To Edge Distance
  • - *
  • Group Node Crossing
  • - *
  • Minimum Group Node To Edge Distance
  • - *
  • Node Label Crossing
  • - *
  • Edge Label Crossing
  • - *
  • Bends In Node To Edge Distance
  • - *
  • Bend
  • - *
  • Monotonic Route
  • - *
  • Edge Length
  • - *
  • Partition Grid
  • - *
  • Port Restriction
  • - *
  • Edge Grouping
  • - *
  • Minimum Node Corner Distance
  • - *
  • Interval Based Crossing
  • - *
  • Minimum Edge To Edge Distance And Grid
  • - *
  • Minimum First Last Segment Length
  • - *
  • Intersecting Source And Target
  • - *
- * @see yfiles.router.EdgeRouter#createPathSearch - * @see yfiles.router.EdgeRouter#configurePathSearch - * @type {yfiles.collections.IList.} - */ - registeredPathSearchExtensions:yfiles.collections.IList; - /** - * Gets the {@link yfiles.router.GraphPartition} instance used during the routing process. - * @type {yfiles.router.GraphPartition} - */ - partition:yfiles.router.GraphPartition; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.EdgeRouter; - } - export enum Alignment{ - /** - * A constant specifying that the segment prefers to be placed close to the lower bound of its location range. - * @see yfiles.router.SegmentInfoBase#preferredAlignment - * @see yfiles.router.SegmentInfoBase#preferredAlignment - */ - MIN, - /** - * A constant specifying that the segment prefers to be placed close to the upper bound of its location range. - * @see yfiles.router.SegmentInfoBase#preferredAlignment - * @see yfiles.router.SegmentInfoBase#preferredAlignment - */ - MAX, - /** - * A constant specifying that the segment can be placed anywhere within its location range. - * @see yfiles.router.SegmentInfoBase#preferredAlignment - * @see yfiles.router.SegmentInfoBase#preferredAlignment - */ - ANY - } - export enum RoutingType{ - /** - * A routing type representing a straight crossing of the - * {@link yfiles.router.PartitionCell partition cell}, i.e., a single orthogonal edge segment enters and exits the cell. - * @see yfiles.router.EdgeCellInfo#type - */ - STRAIGHT, - /** - * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition cell} with three segments, i.e., the edge enters and exits the - * cell using the same direction but has an orthogonal middle segment between the entering and exiting segment. - * @see yfiles.router.EdgeCellInfo#type - */ - STRAIGHT_BENDING, - /** - * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition cell} with a single bend, i.e., the edge enters the cell in one - * direction, makes a bend and exits the cell in an orthogonal direction. - * @see yfiles.router.EdgeCellInfo#type - */ - BENDING, - /** - * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition cell} by making a U-turn, i.e., the edge enters and exits the - * cell on the same side using two turns and an orthogonal middle segment. - * @see yfiles.router.EdgeCellInfo#type - */ - U_TURN, - /** - * A routing type representing the source or target end of an edge being in the cell, i.e., the enter and/or exit interval - * is null. - * @see yfiles.router.EdgeCellInfo#type - */ - END - } - /** - * A {@link yfiles.router.GraphPartition} partitions the bounding box of a graph into rectangles using the graph elements as - * {@link yfiles.router.Obstacle}s. - *

- * All {@link yfiles.router.Obstacle}s used during the partitioning are {@link yfiles.router.GraphPartition#createObstacle created} by {@link yfiles.router.IGraphPartitionExtension}s. - * {@link yfiles.router.IGraphPartitionExtension}s have been {@link yfiles.router.GraphPartition#addDynamicDecompositionListener registered} before using method {@link yfiles.router.IGraphPartitionExtension#preparePartition} - * which is called during the {@link yfiles.router.GraphPartition#init initialization} of a {@link yfiles.router.GraphPartition}. - *

- *

- * The core partitioning is delegated to an {@link yfiles.router.IObstaclePartition} that is {@link yfiles.router.IObstaclePartition#init initialized} with these - * {@link yfiles.router.Obstacle}s. - *

- *

- * If the {@link yfiles.router.IObstaclePartition} is of type {@link yfiles.router.IDynamicDecomposition}, {@link yfiles.router.GraphPartition} - * re-dispatches the decomposition notifications to its extensions. - *

- * @see yfiles.router.IGraphPartitionExtension - * @class - * @implements {yfiles.router.IPartition} - * @implements {yfiles.router.IDynamicDecomposition} - * @implements {yfiles.router.IDecompositionListener} - */ - export interface GraphPartition extends yfiles.lang.Object,yfiles.router.IPartition,yfiles.router.IDynamicDecomposition,yfiles.router.IDecompositionListener{} - export class GraphPartition { - /** - * Creates a new {@link yfiles.router.GraphPartition} instance using the given {@link yfiles.router.GraphPartition#partition delegate inner obstacle partition}. - * @param partition the delegate inner obstacle partition - */ - constructor(partition:yfiles.router.IObstaclePartition); - /** - * Adds the given listener to the {@link yfiles.router.GraphPartition}. - *

- * The listener will be notified upon dynamic decomposition events. If it is a {@link yfiles.router.IGraphPartitionExtension}, - * method {@link yfiles.router.IGraphPartitionExtension#preparePartition} is called during {@link yfiles.router.GraphPartition#init initialization}. - *

- * @param listener the listener to be added - */ - addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Clears the {@link yfiles.router.GraphPartition partition} data such that the {@link yfiles.router.GraphPartition} can be reused and {@link yfiles.router.GraphPartition#init initialized} with a new - * configuration. - *

- * All {@link yfiles.router.IGraphPartitionExtension}s are {@link yfiles.router.IGraphPartitionExtension#cleanup cleaned up}; partition listeners and obstacles are {@link yfiles.router.GraphPartition#removeDynamicDecompositionListener removed}. - *

- * @see yfiles.router.GraphPartition#init - */ - clear():void; - /** - * Creates and returns a new {@link yfiles.router.Obstacle} using the given bounds and data. - *

- * All obstacles created via this method are delegated to the {@link yfiles.router.GraphPartition#partition inner partition} upon {@link yfiles.router.GraphPartition#init initialization}. - *

- * @param bounds the bounds of the obstacle - * @param data the additional data that should be associated with the obstacle - * @returns a new {@link } using the given bounds and data - */ - createObstacle(bounds:yfiles.algorithms.YRectangle,data:any):yfiles.router.Obstacle; - /** - * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle by delegating to the - * corresponding method of the {@link yfiles.router.GraphPartition#partition inner partition}. - * @param rect the rectangular area whose (partially) covered cells will be returned - * @returns a list containing (partially) covered {@link }s - * @see yfiles.router.IPartition#getCells - */ - getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; - /** - * Returns all {@link yfiles.router.PartitionCell}s that are completely covered by the bounds of the given node. - * @param node the node for which the covered cells will be returned - * @returns an unmodifiable list of {@link } instances that are completely covered by the bounds of the given - * node - * @throws {Stubs.Exceptions.ArgumentError} if the node is unknown - */ - getCellsForNode(node:yfiles.algorithms.Node):yfiles.collections.IList; - /** - * Returns a list of all - * {@link yfiles.router.PartitionCell}s that are neighbors of the given cell, i.e., those cells that have a common border segment - * with the given cell. - * @param cell the cell whose neighbors will be returned - * @returns a list of {@link }s that are neighbors of the given cell - */ - getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Returns a list of all {@link yfiles.algorithms.Node}s whose bounds intersect or cover the bounds of the given cell. - * @param cell the cell - * @returns a list of {@link }s that are intersected by the given cell - */ - getNodes(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Returns the {@link yfiles.router.Obstacle} that has been created earlier for the given data object. - * @param data the given data for which the obstacle will be returned - * @returns the {@link } that has been created earlier for the given data object - */ - getObstacle(data:any):yfiles.router.Obstacle; - /** - * Returns all {@link yfiles.router.Obstacle}s covering the given {@link yfiles.router.PartitionCell} by delegating to the corresponding - * method of the {@link yfiles.router.GraphPartition#partition inner partition}. - * @param cell the cell whose obstacles will be returned - * @returns a list of {@link }s that cover the given cell - * @see yfiles.router.IObstaclePartition#getObstacles - */ - getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Initializes the {@link yfiles.router.GraphPartition} with the given graph instance based on the given {@link yfiles.router.PathSearchConfiguration configuration} used by path - * search algorithms. - *

- * Before calling this method, any old partitioning information must be {@link yfiles.router.GraphPartition#clear cleared}. - *

- *

- * This initialization method calls {@link yfiles.router.IGraphPartitionExtension#preparePartition} of all registered extensions. - * Then, the {@link yfiles.router.GraphPartition#partition inner delegate partition} is initialized passing all {@link yfiles.router.GraphPartition#createObstacle added} obstacles as well as the given graph's bounds - * extended by a small padding. - *

- *

- * In the case where the {@link yfiles.router.GraphPartition#partition delegate partition} is of type {@link yfiles.router.IDynamicDecomposition}, this {@link yfiles.router.GraphPartition} - * will also be added as {@link yfiles.router.IDecompositionListener} to it. - *

- * @param configuration the configuration used by path search algorithms - * @see yfiles.router.GraphPartition#clear - * @see yfiles.router.IGraphPartitionExtension#preparePartition - * @see yfiles.router.GraphPartition#addDynamicDecompositionListener - */ - init(configuration:yfiles.router.PathSearchConfiguration):void; - /** - * Re-dispatches the event of the creation of a new {@link yfiles.router.PartitionCell} to all registered - * {@link yfiles.router.IDecompositionListener}s. - *

- * This method is a callback after a {@link yfiles.router.PartitionCell} has been created. - *

- * @param createdCell the newly created {@link } - */ - onCellCreated(createdCell:yfiles.router.PartitionCell):void; - /** - * Re-dispatches the event of having completed the process of subdivisions of a given {@link yfiles.router.PartitionCell} to all - * registered {@link yfiles.router.IDecompositionListener}s. - *

- * This method is a callback after a {@link yfiles.router.PartitionCell} has been finalized and won't be further subdivided. - *

- * @param finalizedCell the cell that has been finalized - */ - onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; - /** - * Re-dispatches the event of the subdivision of a given {@link yfiles.router.PartitionCell} into several sub-cells to all - * registered {@link yfiles.router.IDecompositionListener}s. - *

- * This method is a callback after a {@link yfiles.router.PartitionCell} has been subdivided into several sub-cells. - *

- * @param cell the cell that has been subdivided - * @param subCells the sub-cells resulting from the subdivision of the given {@link } - */ - onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; - /** - * Removes the given listener from the {@link yfiles.router.GraphPartition}. - *

- * The listener will not be notified of dynamic decomposition events anymore. - *

- * @param listener the listener to be removed - */ - removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Gets the delegate inner obstacle partition. - * @protected - * @type {yfiles.router.IObstaclePartition} - */ - partition:yfiles.router.IObstaclePartition; - /** - * Gets the bounds of the original rectangular area that is being partitioned. - *

- * This method delegates to the corresponding method of the {@link yfiles.router.GraphPartition#partition inner partition}. - *

- * @see yfiles.router.IPartition#bounds - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.GraphPartition; - } - /** - * {@link yfiles.router.GraphPartitionExtensionAdapter} provides an empty implementation of - * {@link yfiles.router.IGraphPartitionExtension}. - *

- * The only real functionality is contained in method {@link yfiles.router.IGraphPartitionExtension#preparePartition} which stores - * the given {@link yfiles.router.PathSearchConfiguration} and {@link yfiles.router.GraphPartition} in properties. - *

- * @see yfiles.router.GraphPartitionExtensionAdapter#configuration - * @see yfiles.router.GraphPartitionExtensionAdapter#graphPartition - * @class - * @implements {yfiles.router.IGraphPartitionExtension} - */ - export interface GraphPartitionExtensionAdapter extends yfiles.lang.Object,yfiles.router.IGraphPartitionExtension{} - export class GraphPartitionExtensionAdapter { - /** - * Creates a new instance of {@link yfiles.router.GraphPartitionExtensionAdapter}. - */ - constructor(); - /** - * - */ - cleanup():void; - /** - * - * @param createdCell - */ - onCellCreated(createdCell:yfiles.router.PartitionCell):void; - /** - * - * @param finalizedCell - */ - onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; - /** - * - * @param cell - * @param subCells - */ - onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; - /** - * Stores the given {@link yfiles.router.PathSearchConfiguration} and {@link yfiles.router.GraphPartition} such that they are accessible - * through {@link yfiles.router.GraphPartitionExtensionAdapter#configuration} and {@link yfiles.router.GraphPartitionExtensionAdapter#graphPartition}, respectively. - * @param configuration the configuration used for the path search - * @param graphPartition the graph partition that uses this extension - */ - preparePartition(configuration:yfiles.router.PathSearchConfiguration,graphPartition:yfiles.router.GraphPartition):void; - /** - * Gets the {@link yfiles.router.GraphPartition} passed to {@link yfiles.router.IGraphPartitionExtension#preparePartition}. - * @protected - * @type {yfiles.router.GraphPartition} - */ - graphPartition:yfiles.router.GraphPartition; - /** - * Gets the configuration of the {@link yfiles.router.PathSearch} passed to - * {@link yfiles.router.IGraphPartitionExtension#preparePartition}. - * @protected - * @type {yfiles.router.PathSearchConfiguration} - */ - configuration:yfiles.router.PathSearchConfiguration; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.GraphPartitionExtensionAdapter; - } - /** - * This class provides support for routing edges on equidistant grid lines. - *

- * The grid is defined by its origin and the spacing between the equidistant grid lines. - *

- * @class - * @final - */ - export interface Grid extends yfiles.lang.Object{} - export class Grid { - /** - * Creates a new {@link yfiles.router.Grid} instance. - *

- * The spacing between the grid lines must be at least 1. If the given spacing is smaller, value 1 is assumed. - *

- * @param originX the x-coordinate of the origin of the grid - * @param originY the y-coordinate of the origin of the grid - * @param spacing the spacing between the grid lines - */ - constructor(originX:number,originY:number,spacing:number); - /** - * Gets the x-coordinate of the origin. - * @type {number} - */ - originX:number; - /** - * Gets the y-coordinate of the origin. - * @type {number} - */ - originY:number; - /** - * Gets the spacing between the horizontal and vertical grid lines. - * @type {number} - */ - spacing:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Grid; - } - /** - * This interface should be implemented by classes that dispatch notifications about changes in {@link yfiles.router.IPartition}s. - *

- * Such classes can be notified when {@link yfiles.router.PartitionCell}s are created, divided, and/or finalized. - *

- * @see yfiles.router.IDecompositionListener - * @interface - */ - export interface IDynamicDecomposition extends yfiles.lang.Object{ - /** - * Adds the given {@link yfiles.router.IDecompositionListener} that will be notified of dynamic decomposition events to the - * {@link yfiles.router.IPartition}. - * @param listener the listener to be added - * @abstract - */ - addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Removes the given {@link yfiles.router.IDecompositionListener} from the {@link yfiles.router.IPartition}. - *

- * The {@link yfiles.router.IDecompositionListener} will be no more notified of dynamic decomposition events. - *

- * @param listener the listener to be removed - * @abstract - */ - removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - } - var IDynamicDecomposition:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IDynamicDecomposition; - }; - /** - * This interface is implemented by classes that require to be notified of changes in {@link yfiles.router.IPartition}s. - *

- * Implementations are notified when {@link yfiles.router.PartitionCell}s are created, divided, and/or finalized. - *

- * @interface - */ - export interface IDecompositionListener extends yfiles.lang.Object{ - /** - * Callback after the new given {@link yfiles.router.PartitionCell} has been created. - * @param createdCell the newly created {@link } - * @abstract - */ - onCellCreated(createdCell:yfiles.router.PartitionCell):void; - /** - * Callback after the given {@link yfiles.router.PartitionCell} has been finalized and won't be further subdivided. - * @param finalizedCell the cell that has been finalized - * @abstract - */ - onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; - /** - * Callback after the given {@link yfiles.router.PartitionCell} has been subdivided into several sub-cells. - *

- * {@link yfiles.router.IDecompositionListener} may not modify the list of sub-cells. - *

- * @param cell the cell that has been subdivided - * @param subCells the sub-cells resulting from the subdivision of the given {@link } - * @abstract - */ - onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; - } - var IDecompositionListener:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IDecompositionListener; - }; - /** - * This interface provides additional intervals in order to move from one {@link yfiles.router.PartitionCell partition cell} into an adjacent one. - *

- * To find a {@link yfiles.router.Path} for an edge, the {@link yfiles.router.PathSearch} algorithm moves from the current partition cell - * to an adjacent partition cell. By default, the orthogonal interval shared by these two cells is used. Implementations of - * this interface may be added to the {@link yfiles.router.PathSearch} to calculate additional enter intervals that might - * accumulate lower costs for entering the adjacent cell. - *

- * @see yfiles.router.PartitionCell - * @see yfiles.router.PathSearch#addAdditionalEnterIntervalCalculator - * @interface - */ - export interface IEnterIntervalCalculator extends yfiles.lang.Object{ - /** - * Appends additional enter intervals to the given list of enter intervals for moving from the {@link yfiles.router.PartitionCell partition cell} of the - * current {@link yfiles.router.CellEntrance} to the neighboring cell. - * @param currentEntrance the current {@link } that is exited - * @param enteredCell the neighboring cell that will be entered - * @param commonInterval the common interval of the left and entered partition cells - * @param allEnterIntervals the list to which additional enter intervals have to be appended - * @param context the context of the path search - * @abstract - */ - appendEnterIntervals(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,commonInterval:yfiles.router.OrthogonalInterval,allEnterIntervals:yfiles.collections.IList,context:yfiles.router.PathSearchContext):void; - } - var IEnterIntervalCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IEnterIntervalCalculator; - }; - /** - * This interface provides methods for extending the functionality of a {@link yfiles.router.GraphPartition}. - *

- * A {@link yfiles.router.IGraphPartitionExtension} can be used for {@link yfiles.router.GraphPartition#createObstacle creating} new {@link yfiles.router.Obstacle}s that will be given to the - * initializer of the {@link yfiles.router.IObstaclePartition} where they can react to the {@link yfiles.router.IObstaclePartition}'s - * decomposition events if it implements the {@link yfiles.router.IDynamicDecomposition} interface. - *

- *

- * A {@link yfiles.router.IGraphPartitionExtension} has to be {@link yfiles.router.GraphPartition#addDynamicDecompositionListener added} to the {@link yfiles.router.GraphPartition} which will call method {@link yfiles.router.IGraphPartitionExtension#preparePartition} - * before the {@link yfiles.router.IObstaclePartition} is initialized. - *

- * @interface - * @implements {yfiles.router.IDecompositionListener} - */ - export interface IGraphPartitionExtension extends yfiles.lang.Object,yfiles.router.IDecompositionListener{ - /** - * Cleans up the extension from the last partitioning with the current {@link yfiles.router.PathSearchConfiguration configuration} and {@link yfiles.router.GraphPartition}. - * @abstract - */ - cleanup():void; - /** - * Adds a {@link yfiles.router.IGraphPartitionExtension} to the {@link yfiles.router.GraphPartition}. - *

- * It is called by the given {@link yfiles.router.GraphPartition} upon initialization before its {@link yfiles.router.IObstaclePartition} - * is initialized. Implementations may use the graph upon which the given {@link yfiles.router.GraphPartition} is based to - * initialize themselves and/or to {@link yfiles.router.GraphPartition#createObstacle add obstacles} to the list with which {@link yfiles.router.IObstaclePartition} is initialized. - *

- * @param configuration the configuration used for the path search - * @param graphPartition the graph partition that uses this extension - * @abstract - */ - preparePartition(configuration:yfiles.router.PathSearchConfiguration,graphPartition:yfiles.router.GraphPartition):void; - } - var IGraphPartitionExtension:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IGraphPartitionExtension; - }; - /** - * This class implements a {@link yfiles.router.IPartition} that takes a list of {@link yfiles.router.Obstacle}s as input to subdivide an - * area into {@link yfiles.router.PartitionCell}s. - *

- * Implementations have to satisfy the following condition for each pair of {@link yfiles.router.Obstacle} and - * {@link yfiles.router.PartitionCell}: - *

- *
    - *
  • - * {@link yfiles.router.Obstacle}s either completely cover {@link yfiles.router.PartitionCell}s or do not intersect - * {@link yfiles.router.PartitionCell}s at all. - *
  • - *
- *

- * {@graph {"ann":{"s":[40,40],"d":1},"styles":{"6":{"s":"#0000ff", "f":null}},"n":[[380,280,[[394.66,309.35,10.67,18.7,"1"]]],[580,400,[[594.66,429.35,10.67,18.7,"2"]]],[240.2,280,139.8,40,6],[240.2,159.2,179.8,120.8,6],[240.2,320,179.95,280,6],[420.15,440,200,160,6],[420.15,400,159.85,40,6],[420.15,159.2,319.2,240.8,6],[620,400,119.35,200,6]],"e":[[0,1,[400,420]]],"vp":[240.0,159.0,500.0,441.0]}} Example of an {@link yfiles.router.IObstaclePartition} of a graph consisting of two nodes connected by one edge. The two nodes - * are considered to be obstacles. The colored partition cells subdivide the area such that each obstacle either completely - * covers a partition cell or does not intersect with a partition cell. - *

- * @interface - * @implements {yfiles.router.IPartition} - */ - export interface IObstaclePartition extends yfiles.lang.Object,yfiles.router.IPartition{ - /** - * Clears the partition data such that the {@link yfiles.router.IObstaclePartition} can be reused and {@link yfiles.router.IObstaclePartition#init initialized} with new - * {@link yfiles.router.Obstacle}s. - * @see yfiles.router.IObstaclePartition#init - * @abstract - */ - clear():void; - /** - * Returns all {@link yfiles.router.PartitionCell}s that are completely covered by the given {@link yfiles.router.Obstacle}. - * @param obstacle the obstacle for which the covered cells will be returned - * @returns an unmodifiable list of {@link } instances that are completely covered by the given obstacle - * @abstract - */ - getCellsForObstacle(obstacle:yfiles.router.Obstacle):yfiles.collections.IList; - /** - * Returns all {@link yfiles.router.Obstacle}s that cover the given {@link yfiles.router.PartitionCell}. - * @param cell the partition cell for which the obstacles will be returned - * @returns an unmodifiable list of {@link } instances that cover the given cell - * @abstract - */ - getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Initializes a new {@link yfiles.router.IObstaclePartition} of the area with the given bounds using the given list of - * {@link yfiles.router.Obstacle}s. - *

- * Unused partitions must be cleared using method {@link yfiles.router.IObstaclePartition#clear}. - *

- * @param obstacles a list of {@link }s that have to be considered by the partition - * @param bounds the bounds of the partition - * @see yfiles.router.IObstaclePartition#clear - * @abstract - */ - init(obstacles:yfiles.collections.IList,bounds:yfiles.algorithms.YRectangle):void; - } - var IObstaclePartition:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IObstaclePartition; - }; - /** - * This class divides a rectangular area into one or more {@link yfiles.router.PartitionCell}s. - *

- * {@link yfiles.router.PartitionCell}s have to be disjoint. The union of all - * {@link yfiles.router.PartitionCell}s covers the original area. - *

- * @interface - */ - export interface IPartition extends yfiles.lang.Object{ - /** - * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle. - * @param rect the rectangular area whose (partially) covered cells will be returned - * @returns a list of {@link }s that (partially) cover the given rectangular area - * @abstract - */ - getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; - /** - * Returns a list of all - * {@link yfiles.router.PartitionCell}s that are neighbors of the given cell, i.e., those cells that have a common border segment - * with the given cell. - * @param cell the cell whose neighbors will be returned - * @returns a list of {@link }s that are neighbors of the given cell - * @abstract - */ - getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Gets the bounds of the original rectangular area that is partitioned. - * @abstract - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - } - var IPartition:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IPartition; - }; - /** - * This class represents a one-dimensional closed interval. - * @class - */ - export interface Interval extends yfiles.lang.Object{} - export class Interval { - /** - * Creates a new {@link yfiles.router.Interval} between the given bounds. - *

- * The upper and lower bound of the two given values are determined automatically, i.e., the smaller one will be treated as - * the lower bound and the larger one as the upper bound. - *

- * @param bound1 the first interval bound - * @param bound2 the second interval bound - */ - constructor(bound1:number,bound2:number); - /** - * Returns the bridging {@link yfiles.router.Interval interval} between the given {@link yfiles.router.Interval intervals}. - *

- * The bridging interval is null if the given intervals intersect each other. Otherwise, the bridging interval is - * [minimum of upper bounds, maximum of lower bounds]. - *

- * @param i1 the first interval - * @param i2 the second interval - * @returns the bridging interval between the given intervals or null if the intervals intersect - * @static - */ - static calculateBridge(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; - /** - * Returns the intersection of the given {@link yfiles.router.Interval intervals}. - *

- * The intersection is null if the given intervals do not intersect each other. Otherwise, the intersection is - * [maximum of lower bounds, minimum of upper bounds]. - *

- * @param i1 the first interval - * @param i2 the second interval - * @returns the intersection of the given intervals or null if the intervals do not intersect - * @static - */ - static calculateIntersection(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; - /** - * Returns the spanning rectangle between the given {@link yfiles.router.Interval intervals}. - *

- * The first interval spans the rectangle in horizontal dimension, the second interval in vertical dimension. - *

- * @param horizontal the interval that defines the location and length of the rectangle in horizontal dimension - * @param vertical the interval that defines the location and length of the rectangle in vertical dimension - * @returns the spanning rectangle between the given intervals - * @static - */ - static calculateSpanningRectangle(horizontal:yfiles.router.Interval,vertical:yfiles.router.Interval):yfiles.algorithms.YRectangle; - /** - * Returns the union of the given {@link yfiles.router.Interval intervals} and the given value. - *

- * The union is between the minimum of the lower bound of the given interval and the given value and the maximum of the - * upper bound of the given interval and the given value. - *

- * @param interval the interval to be extended - * @param value the value to be in the union - * @returns the union of the given interval and the given value - * @static - */ - static calculateUnion(interval:yfiles.router.Interval,value:number):yfiles.router.Interval; - /** - * Returns the union of the given {@link yfiles.router.Interval intervals}. - *

- * The union is [minimum of lower bounds, maximum of upper bounds]. - *

- * @param i1 the first interval - * @param i2 the second interval - * @returns the union of the given intervals - * @static - */ - static calculateUnion(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; - /** - * Checks whether or not the given value lies within the interval. - * @param value the value to check - * @returns true if the value lies within the interval, false otherwise - */ - contains(value:number):boolean; - /** - * Checks whether or not the given {@link yfiles.router.Interval interval} fully covers this {@link yfiles.router.Interval interval} given a small epsilon value. - *

- * The given interval covers this interval, if other lower bound - epsilon <= this lower bound and - * this upper bound <= other upper bound + epsilon. - *

- * @param other the other interval - * @param [eps=1E-06] the epsilon value that determines the extended range of the other interval - * @returns true if this interval is fully covered by the other interval, false otherwise - */ - coveredBy(other:yfiles.router.Interval,eps?:number):boolean; - /** - * Returns the distance between this {@link yfiles.router.Interval interval} and the given {@link yfiles.router.Interval interval}. - *

- * If the intervals {@link yfiles.router.Interval#intersects intersect}, the distance is 0. Otherwise, it is equal to - * dist(minimum of upper bounds, maximum of lower bounds). - *

- * @param other the other interval to which the distance is calculated - * @returns the distance between this interval and the given interval - */ - distanceTo(other:yfiles.router.Interval):number; - /** - * Returns the distance between the value and this {@link yfiles.router.Interval interval}. - *

- * If this interval contains the specified value, the distance is 0. Otherwise, it is the minimum of dist(value, lower bound) - * and dist(value, upper bound). - *

- * @param value the value to which the distance is calculated - * @returns the distance between the value and the interval - */ - distanceTo(value:number):number; - /** - * Returns the {@link yfiles.router.Interval interval} bound that is closest to the given value. - * @param value the value for which the closest interval bound will be returned - * @returns - *
    - *
  • the value, if the given value lies within the interval, or
  • - *
  • the lower bound, if the given value is smaller than or equal to the lower bound, or
  • - *
  • the upper bound, if the given value is greater than or equal to the upper bound
  • - *
- */ - getClosest(value:number):number; - /** - * Checks whether or not this {@link yfiles.router.Interval interval} and the given {@link yfiles.router.Interval interval} cover the same range. - *

- * The intervals are considered to cover the same range, if their minimum values as well as their maximum values differ - * only in the given epsilon value. - *

- * @param other the other interval - * @param [eps=1E-06] the maximum distance between the two minimum and the two maximum values - * @returns true if the intervals cover the same range, false otherwise - */ - hasSameRange(other:yfiles.router.Interval,eps?:number):boolean; - /** - * Checks whether or not this {@link yfiles.router.Interval interval} intersects with the given - * {@link yfiles.router.Interval interval}, considering the given minimum intersection length. - * @param other the other interval to check - * @param [minIntersection=0] the minimum length of the intersection of the intervals - * @returns true if the intervals intersect at least by the given minimum length, false otherwise - */ - intersects(other:yfiles.router.Interval,minIntersection?:number):boolean; - /** - * Checks whether or not the lower bound of this {@link yfiles.router.Interval interval} is greater than the upper bound of the given interval. - * @param other the interval to compare - * @returns true if the current interval is on the right of the given one, false otherwise - */ - isGreaterThan(other:yfiles.router.Interval):boolean; - /** - * Checks whether or not the upper bound of this {@link yfiles.router.Interval interval} is smaller than the lower bound of the given interval. - * @param other the interval to compare - * @returns true if the current interval is on the left of the given one, false otherwise - */ - isLessThan(other:yfiles.router.Interval):boolean; - /** - * Gets the lower bound of the interval. - * @type {number} - */ - min:number; - /** - * Gets the upper bound of the interval. - * @type {number} - */ - max:number; - /** - * Gets the midpoint of the interval. - * @type {number} - */ - center:number; - /** - * Gets the size of the interval, i.e., the difference between the {@link yfiles.router.Interval#max upper bound} and the {@link yfiles.router.Interval#min lower bound}. - * @type {number} - */ - size:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Interval; - } - /** - * This class describes the obstacles that are used by implementations of {@link yfiles.router.IObstaclePartition} to subdivide an - * area into {@link yfiles.router.PartitionCell}s. - * @class - */ - export interface Obstacle extends yfiles.lang.Object{} - export class Obstacle { - /** - * Creates a new {@link yfiles.router.Obstacle} instance with the given bounds and additional data. - * @param bounds the bounds of the obstacle - * @param data the additional data associated to the obstacle - */ - constructor(bounds:yfiles.algorithms.YRectangle,data:any); - /** - * Gets the bounds of the obstacle. - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - /** - * Gets the additional data related to the obstacle. - * @type {any} - */ - data:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Obstacle; - } - /** - * A horizontal or vertical {@link yfiles.router.Interval} that additionally stores a y- (in the horizontal case) or x-coordinate - * (in the vertical case). - *

- * During a {@link yfiles.router.PathSearch}, orthogonal intervals are used for specifying the location where an edge enters or - * exits a {@link yfiles.router.PartitionCell partition cell}. - *

- * @see yfiles.router.PathSearch - * @class - */ - export interface OrthogonalInterval extends yfiles.lang.Object{} - export class OrthogonalInterval { - /** - * Creates a new {@link yfiles.router.OrthogonalInterval} instance using the from and to value as interval bounds. - * @param from the start of the interval bounds - * @param to the end of the interval bounds - * @param location the location in the two-dimensional coordinate system - * @param isVertical true if the orthogonal interval is vertical, false if it is horizontal - * @throws {Stubs.Exceptions.ArgumentError} if the given range is null - */ - constructor(from:number,to:number,location:number,isVertical:boolean); - /** - * Creates a new {@link yfiles.router.OrthogonalInterval} instance with the given interval bounds. - * @param range the given range - * @param location the location in the two-dimensional coordinate system - * @param isVertical true if the orthogonal interval is vertical, false if it is horizontal - * @throws {Stubs.Exceptions.ArgumentError} if the given range is null - */ - constructor(range:yfiles.router.Interval,location:number,isVertical:boolean); - /** - * Calculates the intersection of the given {@link yfiles.router.OrthogonalInterval orthogonal intervals}. - *

- * If the returned orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared vertical - * range of both intervals. If it is horizontal, it will have the same vertical location as i2 and the shared horizontal - * range of both intervals. The orthogonal intervals must have same orientation. - *

- * @param i1 the first orthogonal interval - * @param i2 the second orthogonal interval - * @returns the shared orthogonal interval of both given orthogonal intervals - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.OrthogonalInterval#intersects - * @static - */ - static calculateIntersection(i1:yfiles.router.OrthogonalInterval,i2:yfiles.router.OrthogonalInterval):yfiles.router.OrthogonalInterval; - /** - * Calculates the union of the given {@link yfiles.router.OrthogonalInterval orthogonal intervals}. - *

- * If the returned orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared vertical - * range of both orthogonal intervals. If it is horizontal, it will have the same vertical location as i2 and the shared - * vertical range of both orthogonal intervals. The orthogonal intervals must have same orientation. - *

- * @param i1 the first orthogonal interval - * @param i2 the second orthogonal interval - * @returns the union of both given orthogonal intervals - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.OrthogonalInterval#intersects - * @static - */ - static calculateUnion(i1:yfiles.router.OrthogonalInterval,i2:yfiles.router.OrthogonalInterval):yfiles.router.OrthogonalInterval; - /** - * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} is fully covered by the given {@link yfiles.router.OrthogonalInterval orthogonal interval}. - *

- * The given orthogonal interval covers this orthogonal interval, if this interval's range is covered by the given - * interval's range. The location of both orthogonal intervals is ignored. The orthogonal intervals must have the same - * orientation. - *

- * @param other the other orthogonal interval - * @returns true if this orthogonal interval is fully covered by the other orthogonal interval, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.PartitionCell - */ - coveredBy(other:yfiles.router.OrthogonalInterval):boolean; - /** - * Determines whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} crosses the given one. - *

- * The orthogonal intervals must have different orientations. - *

- * @param other the other orthogonal interval - * @returns true if this orthogonal interval crosses the given one, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the given orthogonal intervals have the same orientation - */ - crosses(other:yfiles.router.OrthogonalInterval):boolean; - /** - * Returns the distance of the {@link yfiles.router.OrthogonalInterval#range ranges} of this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval orthogonal interval}. - *

- * The orthogonal intervals must have the same orientation. - *

- * @param other the other orthogonal interval - * @returns 0 if the orthogonal intervals {@link #intersects intersect} each other, otherwise the minimal distance between the orthogonal intervals is - * returned - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - */ - distanceTo(other:yfiles.router.OrthogonalInterval):number; - /** - * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval orthogonal interval} cover the same range. - *

- * If both orthogonal intervals cover the same range, they are considered the same. The location of both orthogonal - * intervals is ignored. The orthogonal intervals must have the same orientation. - *

- * @param other the other orthogonal interval - * @returns true if the orthogonal intervals cover the same range, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.PartitionCell - */ - hasSameRange(other:yfiles.router.OrthogonalInterval):boolean; - /** - * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} intersects the given {@link yfiles.router.OrthogonalInterval orthogonal interval} and the intersection has a given - * minimum intersection size. - *

- * Orthogonal intervals intersect each other, if their ranges intersect each other by at least the given minimum - * intersection size. The location of both orthogonal intervals is ignored. The orthogonal intervals must have the same - * orientation. - *

- * @param other the other orthogonal interval - * @param [minIntersection=0] the minimum size of the intersection - * @returns true if this interval intersects the given other orthogonal interval, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.PartitionCell - */ - intersects(other:yfiles.router.OrthogonalInterval,minIntersection?:number):boolean; - /** - * Returns the Manhattan distance of this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval orthogonal interval}. - *

- * If both intervals have the same orientation, the Manhattan distance is the sum of the distance between the intervals' - * ranges and the distance between the intervals' locations. - *

- *

- * If the intervals have different orientations, the Manhattan distance is the sum of the distances between one interval's - * range and the other interval's location. - *

- * @param other the other orthogonal interval - * @returns the Manhattan distance between this interval and the given one - */ - manhattanDistanceTo(other:yfiles.router.OrthogonalInterval):number; - /** - * Gets whether or not the {@link yfiles.router.OrthogonalInterval orthogonal interval} is oriented vertically. - * @type {boolean} - */ - vertical:boolean; - /** - * Gets the lower bound of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. - * @type {number} - */ - min:number; - /** - * Gets the upper bound of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. - * @type {number} - */ - max:number; - /** - * Gets the length of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. - * @see yfiles.router.Interval#size - * @type {number} - */ - size:number; - /** - * Gets the range of this {@link yfiles.router.OrthogonalInterval orthogonal interval}. - * @type {yfiles.router.Interval} - */ - range:yfiles.router.Interval; - /** - * Gets the vertical coordinate for horizontal intervals or the horizontal coordinate for vertical intervals, - * respectively. - * @type {number} - */ - location:number; - /** - * Gets the center of this {@link yfiles.router.OrthogonalInterval orthogonal interval} in the 2D-coordinate system. - * @type {yfiles.algorithms.YPoint} - */ - center:yfiles.algorithms.YPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrthogonalInterval; - } - /** - * This class is a type-safe enumeration used for defining the border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @class - */ - export interface PartitionCellBorder extends yfiles.lang.Object{} - export class PartitionCellBorder { - /** - * Returns the type of the border that is passed through when entering a {@link yfiles.router.PartitionCell} in the given - * direction. - * @param direction the direction in which a {@link } has been entered - * @returns the type of the border that is passed through when entering a {@link } - * @see yfiles.router.PartitionCell - * @static - */ - static valueOfEnterDirection(direction:yfiles.layout.Direction):yfiles.router.PartitionCellBorder; - /** - * Returns the type of the border that is passed through when exiting a {@link yfiles.router.PartitionCell} in the given - * direction. - * @param direction the direction in which a {@link } has been exited - * @returns the type of the border that is passed through when exiting a {@link } - * @see yfiles.router.PartitionCell - * @static - */ - static valueOfExitDirection(direction:yfiles.layout.Direction):yfiles.router.PartitionCellBorder; - /** - * Returns the type of the border that is defined by the given {@link yfiles.layout.PortCandidate}. - *

- * The border type corresponds to the {@link yfiles.layout.PortCandidate#direction direction} of the given {@link yfiles.layout.PortCandidate}. - *

- * @param pc the port candidate for which the border type is returned - * @returns the type of the border that is defined by the given port candidate - * @see yfiles.layout.PortCandidate - * @static - */ - static valueOfPortCandidate(pc:yfiles.layout.PortCandidate):yfiles.router.PartitionCellBorder; - /** - * Returns the type of the border that is defined by the given {@link yfiles.layout.PortConstraint}. - *

- * The border type corresponds to the {@link yfiles.layout.PortConstraint#side side} of the given {@link yfiles.layout.PortConstraint}. - *

- * @param pc the port constraint for which the border type is returned - * @returns the type of the border that is defined by the given port constraint - * @see yfiles.layout.PortConstraint - * @static - */ - static valueOfPortConstraint(pc:yfiles.layout.PortConstraint):yfiles.router.PartitionCellBorder; - /** - * A type constant that defines the upper border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @const - * @static - * @type {yfiles.router.PartitionCellBorder} - */ - static NORTH:yfiles.router.PartitionCellBorder; - /** - * A type constant that defines the bottom border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @const - * @static - * @type {yfiles.router.PartitionCellBorder} - */ - static SOUTH:yfiles.router.PartitionCellBorder; - /** - * A type constant that defines the right border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @const - * @static - * @type {yfiles.router.PartitionCellBorder} - */ - static EAST:yfiles.router.PartitionCellBorder; - /** - * A type constant that defines the left border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @const - * @static - * @type {yfiles.router.PartitionCellBorder} - */ - static WEST:yfiles.router.PartitionCellBorder; - /** - * Gets the type of the border that is on the opposite side of the border defined by this type. - * @type {yfiles.router.PartitionCellBorder} - */ - mirrorBorder:yfiles.router.PartitionCellBorder; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PartitionCellBorder; - } - /** - * A {@link yfiles.router.PartitionCell} represents a rectangular part of a {@link yfiles.router.IPartition} as result of the decomposition - * process. - *

- * Each instance of {@link yfiles.router.PartitionCell} can hold arbitrary additional information (e.g. what element of the graph - * is covered by a {@link yfiles.router.PartitionCell}) which can be provided using method {@link yfiles.router.PartitionCell#putData}. - * Accessing and removing this information can be done using {@link yfiles.router.PartitionCell#getData} and - * {@link yfiles.router.PartitionCell#removeData}, respectively. - *

- * @see yfiles.router.PartitionCellKeys - * @class - */ - export interface PartitionCell extends yfiles.lang.Object{} - export class PartitionCell { - /** - * Creates a new {@link yfiles.router.PartitionCell} instance of the given {@link yfiles.router.IPartition} with the given bounds. - * @param x the x-coordinate of the upper-left corner of the partition cell - * @param y the y-coordinate of the upper-left corner of the partition cell - * @param width the width of the partition cell - * @param height the height of the partition cell - * @param partition the partition to which the partition cell belongs - * @see yfiles.router.IPartition - */ - constructor(x:number,y:number,width:number,height:number,partition:yfiles.router.IPartition); - /** - * Creates a new {@link yfiles.router.PartitionCell} of the given {@link yfiles.router.IPartition} with the location and the size of the - * given rectangle. - * @param bounds the bounds describing the size and location of the partition cell - * @param partition the partition to which the partition cell belongs - * @see yfiles.router.IPartition - */ - constructor(bounds:yfiles.algorithms.YRectangle,partition:yfiles.router.IPartition); - /** - * Clears all additional data for this {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#getData - * @see yfiles.router.PartitionCell#putData - * @see yfiles.router.PartitionCell#removeData - */ - clearData():void; - /** - * Returns an {@link yfiles.router.OrthogonalInterval} that defines the location, the size and the orientation of the given - * {@link yfiles.router.PartitionCellBorder}. - *

- * The values defining the border are: - *

- *
    - *
  • {@link yfiles.router.PartitionCellBorder#WEST}
  • - *
  • {@link yfiles.router.PartitionCellBorder#EAST}
  • - *
  • {@link yfiles.router.PartitionCellBorder#NORTH}
  • - *
  • {@link yfiles.router.PartitionCellBorder#SOUTH}
  • - *
- * @param border a border of this partition cell - * @returns an {@link } that defines the location, the size and the orientation of the given border - * @see yfiles.router.PartitionCellBorder - */ - createBorderInterval(border:yfiles.router.PartitionCellBorder):yfiles.router.OrthogonalInterval; - /** - * Returns the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. - * @param key the key whose associated data will be returned - * @returns the additional data associated with the given key or null if there is no data associated with the given key - * @see yfiles.router.PartitionCell#putData - * @see yfiles.router.PartitionCell#removeData - * @see yfiles.router.PartitionCell#clearData - * @see yfiles.router.PartitionCellKeys - */ - getData(key:any):any; - /** - * Stores the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. - * @param key the key with which the additional data will be associated - * @param data the additional data - * @returns the previous data associated with the given key or null if there was no data associated with the given key - * @see yfiles.router.PartitionCell#getData - * @see yfiles.router.PartitionCell#removeData - * @see yfiles.router.PartitionCell#clearData - * @see yfiles.router.PartitionCellKeys - */ - putData(key:any,data:any):any; - /** - * Removes the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. - * @param key the key for which the associated data will be removed - * @returns the additional data associated with the given key or null if there is no data associated with the given key - * @see yfiles.router.PartitionCell#getData - * @see yfiles.router.PartitionCell#putData - * @see yfiles.router.PartitionCell#clearData - * @see yfiles.router.PartitionCellKeys - */ - removeData(key:any):any; - /** - * Gets the {@link yfiles.router.IPartition partition} to which this {@link yfiles.router.PartitionCell} belongs. - * @see yfiles.router.IPartition - * @type {yfiles.router.IPartition} - */ - partition:yfiles.router.IPartition; - /** - * Gets a unique identifier of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - id:number; - /** - * Gets the bounds of this {@link yfiles.router.PartitionCell}. - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - /** - * Gets the x-coordinate of the left border of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - minX:number; - /** - * Gets the y-coordinate of the upper border of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - minY:number; - /** - * Gets the x-coordinate of the right border of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - maxX:number; - /** - * Gets the y-coordinate of the bottom border of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - maxY:number; - /** - * Gets the width of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - width:number; - /** - * Gets the height of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - height:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PartitionCell; - } - /** - * This class defines keys to obtain additional information about a {@link yfiles.router.PartitionCell}. - *

- * In order to get the data of the {@link yfiles.router.PartitionCell} that is associated with the given key, method {@link yfiles.router.PartitionCell#getData} - * should be used. - *

- * @class - * @static - */ - export interface PartitionCellKeys extends yfiles.lang.Object{} - export class PartitionCellKeys { - /** - * The key references a {@link yfiles.collections.IList.} of nodes whose bounds are covering a certain {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static NODES_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of nodes being in node to edge distance to a certain {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static NODES_IN_NODE_TO_EDGE_DISTANCE_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of {@link yfiles.layout.INodeLabelLayout}s covering a certain {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static NODE_LABEL_LAYOUTS_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of {@link number} values representing factors that are multiplied by an edge's {@link yfiles.router.PenaltySettings#nodeLabelCrossingPenalty node label crossing costs} in case - * the edge crosses the corresponding {@link yfiles.layout.INodeLabelLayout node label} registered with key - * {@link yfiles.router.PartitionCellKeys#NODE_LABEL_LAYOUTS_KEY}. - * @const - * @static - * @type {any} - */ - static NODE_LABEL_CROSSING_COST_FACTORS_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of {@link yfiles.layout.IEdgeLabelLayout}s covering a certain {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static EDGE_LABEL_LAYOUTS_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of {@link number} values representing factors that are multiplied by an edge's {@link yfiles.router.PenaltySettings#edgeLabelCrossingPenalty edge label crossing costs} in case - * the edge crosses the corresponding {@link yfiles.layout.IEdgeLabelLayout edge label} registered with key - * {@link yfiles.router.PartitionCellKeys#EDGE_LABEL_LAYOUTS_KEY}. - * @const - * @static - * @type {any} - */ - static EDGE_LABEL_CROSSING_COST_FACTORS_KEY:any; - /** - * The key references the {@link yfiles.layout.PartitionCellId} of the {@link yfiles.layout.PartitionGrid} cell covering a certain - * {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static PARTITION_GRID_CELL_ID_KEY:any; - /** - * The key references the row index of the {@link yfiles.layout.PartitionGrid} cell covering a certain - * {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static PARTITION_GRID_ROW_INDEX_KEY:any; - /** - * The key references the column index of the {@link yfiles.layout.PartitionGrid} cell covering a certain - * {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static PARTITION_GRID_COLUMN_INDEX_KEY:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PartitionCellKeys; - } - /** - * A {@link yfiles.router.Path} represents the result of a path search as a list of consecutive {@link yfiles.router.CellEntrance}s. - *

- * A path starts with a {@link yfiles.router.CellEntrance} for a {@link yfiles.router.PartitionCell} of the source node and ends with one - * for a {@link yfiles.router.PartitionCell} of the target node. - *

- * @see yfiles.router.PathSearch - * @see yfiles.router.PathSearchResult - * @class - */ - export interface Path extends yfiles.lang.Object{} - export class Path { - /** - * Creates a new instance of {@link yfiles.router.Path} for the given edge, {@link yfiles.router.CellEntrance cell entrances} and cost. - * @param edge the edge for which the path was calculated - * @param entrances the list of {@link } objects describing the edge path from source node to target node - * @param cost the overall cost of this path - */ - constructor(edge:yfiles.algorithms.Edge,entrances:yfiles.collections.IList,cost:number); - /** - * Returns the {@link yfiles.router.CellEntrance} at the given position of this path. - * @param position the position of the {@link } to return - * @returns the {@link } at the given position of this path - * @see yfiles.router.Path#setEntrance - */ - getEntrance(position:number):yfiles.router.CellEntrance; - /** - * Returns the number of {@link yfiles.router.CellEntrance} objects in this path. - * @returns the number of {@link } objects in this path - */ - length():number; - /** - * Returns the position of the first occurrence of the given {@link yfiles.router.CellEntrance} in this path, or -1 if this path - * does not contain this {@link yfiles.router.CellEntrance}. - * @param entrance the {@link } for which the position is retrieved - * @returns the position of the first occurrence of the given {@link } in this path, or -1 if this path does not - * contain this {@link } - */ - positionOf(entrance:yfiles.router.CellEntrance):number; - /** - * Replaces the {@link yfiles.router.CellEntrance} at the given position of this path with the given {@link yfiles.router.CellEntrance}. - * @param position the position of the {@link } to replace - * @param entrance the {@link } to be stored at the given position - * @see yfiles.router.Path#getEntrance - */ - setEntrance(position:number,entrance:yfiles.router.CellEntrance):void; - /** - * Gets the edge for which this path was calculated. - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - /** - * Gets the overall cost of this path. - * @type {number} - */ - cost:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Path; - } - /** - * This is a pathfinding algorithm that calculates the shortest (i.e., the cheapest) paths for a set of edges through a - * {@link yfiles.router.GraphPartition}. - *

- * It is based on an A*-algorithm and uses {@link yfiles.router.PartitionCell}s as steps between source node and target node. - *

- *

- * In each step, the algorithm takes a {@link yfiles.router.CellEntrance}, that consists mainly of a {@link yfiles.router.PartitionCell} - * and from where it was entered, from a queue with all seen {@link yfiles.router.CellEntrance}s, determines all possible neighbor - * cells and their enter intervals and enqueues the resulting {@link yfiles.router.CellEntrance}. To influence the order in which - * the {@link yfiles.router.CellEntrance}s will be processed, the path search assigns real costs (like Dijkstra) as well as - * heuristic costs (A*-algorithm's heuristic) to the enqueued {@link yfiles.router.CellEntrance}s. The real costs arise from - * entering a neighbor cell, e.g., a bend has to be created, while the heuristic costs are an estimation of how expensive - * it will be to reach the target node continuing the path with this neighboring cell. Therefore, the path search prefers - * searching in the direction in which the target node lies. The {@link yfiles.router.CellEntrance} with the lowest combined costs - * is processed next until the target cell is reached. - *

- *

- * {@link yfiles.router.PathSearchExtension}s modify the path search as they are able to add start entrances and weight them with - * costs. They also add real and heuristic costs to {@link yfiles.router.CellEntrance}s that are created for the currently entered - * {@link yfiles.router.PartitionCell} and calculate shorter enter intervals that are less expensive to pass. - *

- *

- * The algorithm gets a {@link yfiles.router.PathSearchContext} which provides information about the graph and the currently routed - * edge. It stores the results of the path search that can then be retrieved calling {@link yfiles.router.PathSearchContext#pathSearchResult}. - *

- * @see yfiles.router.PathSearch#addPathSearchExtension - * @see yfiles.router.PathSearch#addAdditionalEnterIntervalCalculator - * @class - */ - export interface PathSearch extends yfiles.lang.Object{} - export class PathSearch { - /** - * Creates a new instance of {@link yfiles.router.PathSearch}. - */ - constructor(); - /** - * Adds a new interval calculator to the list of registered {@link yfiles.router.IEnterIntervalCalculator}s. - *

- * {@link yfiles.router.IEnterIntervalCalculator}s may add - * {@link yfiles.router.CellEntrance}s with narrowed intervals to the queue. The interval is more specific and will be judged with - * lower costs. - *

- * @param enterIntervalCalculator the calculator to add - * @returns true if the calculator was successfully added, false otherwise - */ - addAdditionalEnterIntervalCalculator(enterIntervalCalculator:yfiles.router.IEnterIntervalCalculator):boolean; - /** - * Adds the given extension to the list of {@link yfiles.router.PathSearchExtension}s. - *

- * An extension can influence the pathfinding process by adding costs for entering certain {@link yfiles.router.CellEntrance}s. - *

- * @param extension the extension to add to this path search - * @returns true if the extension has been added, false otherwise - */ - addPathSearchExtension(extension:yfiles.router.PathSearchExtension):boolean; - /** - * Calculates the costs for moving from the current {@link yfiles.router.CellEntrance} to the neighboring {@link yfiles.router.PartitionCell} - * using different enter intervals. - *

- * It is called by {@link yfiles.router.PathSearch#handleNeighbor} to determine the costs for all - * {@link yfiles.router.CellEntrance}s that it will create and enqueue afterwards. - *

- *

- * The costs for the given enter intervals are retrieved from all registered - * {@link yfiles.router.PathSearchExtension}s. The calculation stops when it reaches the given maximum cost value. - *

- * @param currentEntrance the current cell entrance - * @param enteredCell the partition cell to enter - * @param enterIntervals the different entering intervals of the entered cell - * @param lastEdgeCellInfos the information about how the last cell was crossed - * @param context the context information - * @param costs the array in which the calculated costs for entering the neighbor cell via the according enter intervals shall be - * written - * @param maxAllowedCosts the maximum costs an enter interval may induce. If this cost is exceeded, no further additional costs for this interval - * are calculated. Note that the entries in this array get modified during cost calculation - * @see yfiles.router.PathSearchExtension#calculateCosts - * @protected - */ - calculateCosts(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,enterIntervals:yfiles.router.OrthogonalInterval[],lastEdgeCellInfos:yfiles.router.EdgeCellInfo[],context:yfiles.router.PathSearchContext,costs:number[],maxAllowedCosts:number[]):void; - /** - * Returns the estimated costs for the rest of the path when using the given {@link yfiles.router.CellEntrance} for the next step - * in the path search. - *

- * It is called by {@link yfiles.router.PathSearch#handleNeighbor} to determine the heuristic part of the costs with which the - * entrance will be enqueued. - *

- *

- * The heuristic costs for the given entrance are retrieved from all registered {@link yfiles.router.PathSearchExtension}s. - *

- * @param entrance the current entrance - * @param context the context information - * @returns the heuristic costs for the rest of the path if the given entrance is used - * @see yfiles.router.PathSearchExtension#calculateHeuristicCosts - * @protected - */ - calculateHeuristicCosts(entrance:yfiles.router.CellEntrance,context:yfiles.router.PathSearchContext):number; - /** - * Resets all registered {@link yfiles.router.PathSearchExtension}s and {@link yfiles.algorithms.DataProviders} added to this - * {@link yfiles.router.PathSearch}. - *

- * So, {@link yfiles.router.PathSearch} is ready to calculate paths for a new layout. - *

- * @see yfiles.router.PathSearchExtension#cleanUp - */ - clear():void; - /** - * Decreases the given penalty settings for the current edge. - *

- * If finding a path for the current edge takes too long according to the {@link yfiles.router.EdgeRouter#maximumDuration maximum duration} of the {@link yfiles.router.EdgeRouter edge routing algorithm}, - * the path search for the current edge is canceled and restarted using decreased penalties. The decreaseFactor indicates, - * how much the penalties shall be reduced. - *

- *

- * This method is called by - * {@link yfiles.router.PathSearch#findPathsForCurrentEdge}. If overriding this method, note that the penalty for creating bends - * should not be reduced as this results in more possible turns of the edge path and, therefore, a longer runtime of the - * path search. Furthermore, not all penalties should be decreased equally as these decreases would neutralize each other. - *

- *

- * The decreaseFactor takes values from [0,1], where 0 means no reduction while 1 means the strongest reduction. - *

- * @param penaltySettings the penalty settings whose penalties shall be reduced - * @param decreaseFactor the factor with values between 0 and 1 that indicates how strong to reduce the penalties - * @param context the context information of the current path search - * @protected - */ - decreasePenaltySettings(penaltySettings:yfiles.router.PenaltySettings,decreaseFactor:number,context:yfiles.router.PathSearchContext):void; - /** - * Informs all registered path search extensions about completing a path by calling their {@link yfiles.router.PathSearchExtension#finalizePath finalizePath(Path)} method. - *

- * That way, extensions can collect data about this path to use it later during path search. - *

- *

- * This method is called by {@link yfiles.router.PathSearch#findPathsForCurrentEdge} and may be overridden to use a custom - * finalization step. - *

- * @param path the path to finalize - * @protected - */ - finalizePath(path:yfiles.router.Path):void; - /** - * Finds paths for the edges in the given context and stores them in its {@link yfiles.router.PathSearchContext#pathSearchResult PathSearchResult}. - *

- * This is the main method of {@link yfiles.router.PathSearch}. - *

- *

- * It initializes its extensions using {@link yfiles.router.PathSearchExtension#initializeEdges} and delegates the path search for - * each edge to {@link yfiles.router.PathSearch#findPathsForCurrentEdge}. - *

- *

- * The path calculations for all edges are finalized by calling the extensions' {@link yfiles.router.PathSearchExtension#finalizeEdges} - * method and, after that, the path search result is filled with the path for each edge. - *

- *

- * At last, the extensions are asked to finalize the path search result using their {@link yfiles.router.PathSearchExtension#finalizePathSearchResult} - * callback. - *

- * @param context the context to use during the path search - * @see yfiles.router.PathSearchContext#edges - * @see yfiles.router.PathSearchContext#pathSearchResult - */ - findPaths(context:yfiles.router.PathSearchContext):void; - /** - * Finds the path for the current edge in the given context. - *

- * This method: - *

- *
    - *
  • Calls {@link yfiles.router.PathSearchExtension#initializeCurrentEdge} for all extensions.
  • - *
  • Collects and enqueues all start entrances.
  • - *
  • Iteratively processes the next cheapest cell entrance and
  • - *
  • Calls {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} for all extensions.
  • - *
- *

- * It is called by {@link yfiles.router.PathSearch#findPaths} and may be overridden to skip certain edges or implement a custom - * path search. - *

- * @param context the context information needed for finding a path - * @protected - */ - findPathsForCurrentEdge(context:yfiles.router.PathSearchContext):void; - /** - * Returns the path for the given edge if it has already been finalized. - *

- * The path is finalized if the {@link yfiles.router.PathSearch} chose it as the best result for the edge. - *

- * @param edge the edge for which the path is returned - * @returns the finalized path for the given edge or null if no path has been found and finalized - */ - getFinalizedPath(edge:yfiles.algorithms.Edge):yfiles.router.Path; - /** - * Adds - * {@link yfiles.router.CellEntrance}s for every interval through which the neighboring cell can be entered from the current - * entrance to the queue. - *

- * The algorithm calls this method in every step for each neighbor of the current cell to collect all next possible - * entrances for the current path. This path consists of several entrances where each knows the entrance through which it - * has been entered. - *

- *

- * After calculating all possible enter intervals to the given neighboring cell, each interval gets rated with costs. If - * there is already an entrance for the neighboring cell whose interval is the same with one of these intervals, this - * entrance will be used and re-enqueued, so that the path search can still reach it. The current entrance is set as its - * predecessor within the current path and its enter interval and costs will be updated. - *

- *

- * If there is an entrance for the neighboring cell whose interval is intersected by a current interval, new entrances will - * be created with the new enter intervals and enqueued. The same happens if there is no entrance that has been matched - * with one of the current intervals, yet. Costs will be added. If there are some entries afterwards that are intersected - * by the current interval and have higher costs, they will be removed from the queue. - *

- *

- * This method is called during cost calculation. It may be overridden to change the interval handling for the - * {@link yfiles.router.CellEntrance}s. - *

- * @param currentEntrance the current cell entrance - * @param neighborCell the neighboring cell that is handled. - * @param context the context information - * @see yfiles.router.PathSearch#calculateCosts - * @see yfiles.router.PathSearch#calculateHeuristicCosts - * @protected - */ - handleNeighbor(currentEntrance:yfiles.router.CellEntrance,neighborCell:yfiles.router.PartitionCell,context:yfiles.router.PathSearchContext):void; - /** - * Initializes the fields of this {@link yfiles.router.PathSearch}. - *

- * This method also calls {@link yfiles.router.PathSearchExtension#initialize} for all registered path search extensions. - *

- * @param configuration the configuration that the path search shall use - */ - init(configuration:yfiles.router.PathSearchConfiguration):void; - /** - * Removes the given interval calculator from the list of registered {@link yfiles.router.IEnterIntervalCalculator}s. - * @param enterIntervalCalculator the calculator to remove - * @returns true if an interval calculator was removed as a result of this call, false if the given calculator was not part of the - * list - */ - removeAdditionalEnterIntervalCalculator(enterIntervalCalculator:yfiles.router.IEnterIntervalCalculator):boolean; - /** - * Removes the given extension from the list of {@link yfiles.router.PathSearchExtension}s. - * @param extension the extension to remove from the path search - * @returns true if an extension was removed as a result of this call, false if the given extension was not contained in the list - */ - removePathSearchExtension(extension:yfiles.router.PathSearchExtension):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearch; - } - /** - * This class contains the basic configuration used by path search algorithms. - * @class - */ - export interface PathSearchConfiguration extends yfiles.lang.Object{} - export class PathSearchConfiguration { - /** - * Creates a new instance of {@link yfiles.router.PathSearchConfiguration} used for a path search. - * @param graph the graph containing the edges whose path will be searched - * @param grouping the grouping information of the graph - * @param edgeRouter the edge routing algorithm using this configuration - */ - constructor(graph:yfiles.layout.LayoutGraph,grouping:yfiles.layout.GroupingSupport,edgeRouter:yfiles.router.EdgeRouter); - /** - * Gets the graph containing the edges whose path is searched. - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets the grouping information of the graph. - * @type {yfiles.layout.GroupingSupport} - */ - grouping:yfiles.layout.GroupingSupport; - /** - * Gets the edge routing algorithm using this configuration. - * @type {yfiles.router.EdgeRouter} - */ - edgeRouter:yfiles.router.EdgeRouter; - /** - * Gets the remaining time (in milliseconds) within which the algorithm should complete its calculation. - * @type {number} - */ - remainingTime:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearchConfiguration; - } - /** - * This class provides context information that is useful for the {@link yfiles.router.PathSearch} algorithm. - *

- * Most notably, the context provides access to the edge that is currently being routed (see {@link yfiles.router.PathSearchContext#currentEdge}). - *

- * @class - */ - export interface PathSearchContext extends yfiles.lang.Object{} - export class PathSearchContext { - /** - * Creates a new instance of {@link yfiles.router.PathSearchContext}. - * @param pathSearch the path search that uses this context - * @param configuration the configuration used for the path search - */ - constructor(pathSearch:yfiles.router.PathSearch,configuration:yfiles.router.PathSearchConfiguration); - /** - * Adds an additional source cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge} if it is not already contained in the list of source cells. - * @param cell the new source cell to add - * @see yfiles.router.PathSearchContext#sourceCellCount - * @see yfiles.router.PathSearchContext#getSourceCell - */ - addSourceCell(cell:yfiles.router.PartitionCell):void; - /** - * Adds an additional target cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge} if it is not already contained in the list of target cells. - * @param cell the new target cell to add - * @see yfiles.router.PathSearchContext#targetCellCount - * @see yfiles.router.PathSearchContext#getTargetCell - */ - addTargetCell(cell:yfiles.router.PartitionCell):void; - /** - * Returns the source cell with the given index in the list of all cells that are covered by the source node of the - * {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @param index the index of the source cell - * @returns the source cell with the given index in the list of all source cells - */ - getSourceCell(index:number):yfiles.router.PartitionCell; - /** - * Returns the target cell with the given index in the list of all cells that are covered by the target node of the - * {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @param index the index of the target cell - * @returns the target cell with the given index in the list of all cells that are covered by the target node of the {@link #currentEdge current edge} - */ - getTargetCell(index:number):yfiles.router.PartitionCell; - /** - * Determines whether or not the given cell is a source cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @param cell the cell - * @returns true if the given cell is in the list of source cells, false otherwise - * @see yfiles.router.PathSearchContext#sourceCellCount - * @see yfiles.router.PathSearchContext#getSourceCell - */ - isSourceCell(cell:yfiles.router.PartitionCell):boolean; - /** - * Determines whether or not the given cell is a target cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @param cell the cell - * @returns true if the given cell is in the list of target cells, false otherwise - * @see yfiles.router.PathSearchContext#targetCellCount - * @see yfiles.router.PathSearchContext#getTargetCell - */ - isTargetCell(cell:yfiles.router.PartitionCell):boolean; - /** - * Specifies the edges that shall be routed. - * @param edges the list of edges that shall be routed - */ - setEdges(edges:yfiles.algorithms.EdgeList):void; - /** - * Returns the number of all cells that are covered by the source node of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @returns the number of all cells that are covered by the source node - */ - sourceCellCount():number; - /** - * Returns the number of all cells that are covered by the target node of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @returns the number of all cells that are covered by the target node - */ - targetCellCount():number; - /** - * Gets the {@link yfiles.router.PathSearch} that uses this context. - * @type {yfiles.router.PathSearch} - */ - pathSearch:yfiles.router.PathSearch; - /** - * Gets the configuration used for the {@link yfiles.router.PathSearch}. - * @type {yfiles.router.PathSearchConfiguration} - */ - configuration:yfiles.router.PathSearchConfiguration; - /** - * Gets the {@link yfiles.algorithms.IEdgeCursor} to iterate over the edges that are routed. - * @type {yfiles.algorithms.IEdgeCursor} - */ - edges:yfiles.algorithms.IEdgeCursor; - /** - * Gets or sets the edge that is currently routed. - *

- * This edge is one of those returned by {@link yfiles.router.PathSearchContext#edges}. - *

- * @type {yfiles.algorithms.Edge} - */ - currentEdge:yfiles.algorithms.Edge; - /** - * Gets the {@link yfiles.router.EdgeLayoutDescriptor} for the {@link yfiles.router.PathSearchContext#currentEdge current edge} containing edge specific settings for the path search. - * @type {yfiles.router.EdgeLayoutDescriptor} - */ - currentEdgeLayoutDescriptor:yfiles.router.EdgeLayoutDescriptor; - /** - * Gets an artificial {@link yfiles.router.PartitionCell partition cell} with the size of the bounding box of all source cells of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @see yfiles.router.PathSearchContext#getSourceCell - * @type {yfiles.router.PartitionCell} - */ - combinedSourceCell:yfiles.router.PartitionCell; - /** - * Gets an artificial {@link yfiles.router.PartitionCell partition cell} with the size of the bounding box of all target cells of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @see yfiles.router.PathSearchContext#getTargetCell - * @type {yfiles.router.PartitionCell} - */ - combinedTargetCell:yfiles.router.PartitionCell; - /** - * Gets the results of the {@link yfiles.router.PathSearch}. - * @type {yfiles.router.PathSearchResult} - */ - pathSearchResult:yfiles.router.PathSearchResult; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearchContext; - } - /** - * Extensions are added to a {@link yfiles.router.PathSearch} to influence the search process. - *

- * An extension contains several callback methods that are used by the {@link yfiles.router.PathSearch} to, e.g., calculate the - * costs for the next possible steps (i.e., entering the next partition cell) and to decide when the target is reached. - *

- *

- * The {@link yfiles.router.PathSearch} uses the callbacks in the following order: - *

- *
    - *
  1. {@link yfiles.router.PathSearchExtension#initialize}
  2. - *
  3. {@link yfiles.router.PathSearchExtension#initializeEdges}
  4. - *
  5. {@link yfiles.router.PathSearchExtension#initializeCurrentEdge}
  6. - *
  7. {@link yfiles.router.PathSearchExtension#appendStartEntrances}
  8. - *
  9. {@link yfiles.router.PathSearchExtension#calculateStartEntranceCost}
  10. - *
  11. {@link yfiles.router.PathSearchExtension#calculateCosts}
  12. - *
  13. {@link yfiles.router.PathSearchExtension#calculateHeuristicCosts}
  14. - *
  15. {@link yfiles.router.PathSearchExtension#isValidTargetEntrance}
  16. - *
  17. {@link yfiles.router.PathSearchExtension#finalizePath}
  18. - *
  19. {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} or {@link yfiles.router.PathSearchExtension#cancelCurrentEdge}
  20. - *
  21. {@link yfiles.router.PathSearchExtension#finalizeEdges}
  22. - *
  23. {@link yfiles.router.PathSearchExtension#finalizePathSearchResult}
  24. - *
  25. {@link yfiles.router.PathSearchExtension#cleanUp}
  26. - *
- * @see yfiles.router.PathSearch#addPathSearchExtension - * @see yfiles.router.PathSearchContext#currentEdge - * @class - */ - export interface PathSearchExtension extends yfiles.lang.Object{} - export class PathSearchExtension { - /** - * Creates a new instance of {@link yfiles.router.PathSearchExtension}. - */ - constructor(); - /** - * Appends additional start {@link yfiles.router.CellEntrance entrances} for the path search of the current edge to the given list of all previously generated - * entrances. - *

- * This method is called before starting the actual path search to determine possible starting points. The current - * implementation doesn't add any {@link yfiles.router.CellEntrance}s. It may be overridden to add {@link yfiles.router.CellEntrance}s with - * specific enter intervals, e.g., to consider {@link yfiles.layout.PortConstraint}s. - *

- * @param allStartEntrances a list of all previously generated entrances - */ - appendStartEntrances(allStartEntrances:yfiles.collections.IList):void; - /** - * Calculates the costs for entering the given {@link yfiles.router.PartitionCell} via the given enter - * {@link yfiles.router.OrthogonalInterval}. - *

- * The given {@link yfiles.router.EdgeCellInfo} describes how the partition cell that has been entered by the current entrance - * would be traversed if this enter interval to the neighboring cell would be chosen. - *

- *

- * The maxAllowedCosts describe the maximum costs that entering the neighboring cell via the given enter interval may - * induce. If the maximum cost is exceeded, calculations that may further increase its cost may be skipped because this - * interval won't be chosen anyway. - *

- *

- * This implementation doesn't add any costs. It may be overridden to add costs, e.g., if entering through the given - * interval would create a bend. - *

- * @param currentEntrance the entrance that was used for entering the current cell - * @param enteredCell the neighboring cell that shall be entered - * @param enterInterval the interval that shall be used for entering the neighboring cell - * @param edgeCellInfo the information about how the current cell would be traversed if the neighboring cell would be entered by this enter - * interval - * @param maxAllowedCosts the maximum allowed costs for this enter interval - * @returns the costs for entering the neighboring cell via the enter interval - * @protected - */ - calculateCosts(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,enterInterval:yfiles.router.OrthogonalInterval,edgeCellInfo:yfiles.router.EdgeCellInfo,maxAllowedCosts:number):number; - /** - * Calculates the heuristic costs for the given {@link yfiles.router.CellEntrance} that describe the minimal costs that will arise - * to finish the path if the given cell entrance is used as next step. - *

- * After evaluating the costs for each enter interval to a neighboring cell, this method is called for each of the - * resulting {@link yfiles.router.CellEntrance}s. - *

- *

- * This implementation doesn't add any costs. It may be overridden to add some heuristic costs, e.g., if the edge would - * have to bend to reach the target node from the given {@link yfiles.router.CellEntrance}. - *

- * @param entrance the entrance to calculate the heuristic costs for the rest of the path - * @returns the minimal costs that will arise to finish the path if the given cell entrance is used as next step - */ - calculateHeuristicCosts(entrance:yfiles.router.CellEntrance):number; - /** - * Returns the cost for starting the path in the given entrance. - *

- * This method is called for each start entrance of the current edge. - *

- *

- * The current implementation doesn't add any costs for the given {@link yfiles.router.CellEntrance}. It may be overridden to make - * start entrances with less specific intervals more expensive. For example, intervals that allow more than just the {@link yfiles.layout.PortConstraint} - * location to connect to the source node become more expensive. - *

- * @param startEntrance the start entrance for which the cost is calculated - * @returns the cost for starting the path in the given entrance - */ - calculateStartEntranceCost(startEntrance:yfiles.router.CellEntrance):number; - /** - * Handles the cancellation of the path search for the current edge. - *

- * This callback notifies the extension when the path search for the current edge is canceled. Then, the path search will - * proceed with altering the penalties of the current edge and reinitializing it again. - *

- *

- * This implementation does nothing. It may be overridden to reset some edge specific information, e.g., removing - * previously added listeners. - *

- * @param context the context containing the current edge for which the path search has been canceled - * @see yfiles.router.PathSearchExtension#initializeCurrentEdge - * @see yfiles.router.PathSearchExtension#finalizeEdges - */ - cancelCurrentEdge(context:yfiles.router.PathSearchContext):void; - /** - * Cleans up the extension from the path searches with the current {@link yfiles.router.PathSearchExtension#configuration configuration} and {@link yfiles.router.PathSearchExtension#context context}. - */ - cleanUp():void; - /** - * Handles the completion of the path search for the current edge. - *

- * This callback notifies the extension when enough paths are found for the current edge. After that, the path search - * either proceeds with initializing the next current edge in the context's edge list or calls {@link yfiles.router.PathSearchExtension#finalizeEdges} - * if all edges in this list have been handled. - *

- *

- * This implementation does nothing. It may be overridden to add/reset some edge specific information, e.g., removing - * previously added listeners or adding new start entrances. - *

- * @param context the context containing the current edge for which the path search has been finished - * @see yfiles.router.PathSearchExtension#initializeCurrentEdge - * @see yfiles.router.PathSearchExtension#finalizeEdges - */ - finalizeCurrentEdge(context:yfiles.router.PathSearchContext):void; - /** - * Handles the completion of all marked edges. - *

- * This callback notifies the extension if enough paths have been found for all edges in the context's edge list. - *

- * @param context the context containing the list of edges for which paths have been found - * @see yfiles.router.PathSearchContext#edges - */ - finalizeEdges(context:yfiles.router.PathSearchContext):void; - /** - * After finding a valid target entrance and creating a {@link yfiles.router.Path}, the extension is notified of the found path. - *

- * If the path search is configured to calculate several possible paths for an edge, the path search proceeds with choosing - * another unhandled {@link yfiles.router.CellEntrance}. - *

- *

- * This implementation does nothing. It may be overridden to collect some information about the given path that may - * influence the path search of later edges. - *

- * @param path the path found for the current edge in the context - * @see yfiles.router.PathSearchContext#currentEdge - */ - finalizePath(path:yfiles.router.Path):void; - /** - * Completes the path search result. - *

- * This callback notifies the extensions of the paths chosen for the edges in the current context. After calling - * {@link yfiles.router.PathSearchExtension#finalizeEdges finalizeEdges}, the {@link yfiles.router.PathSearch} decides, which of the found paths to use for each edge and adds them to the - * {@link yfiles.router.PathSearchResult}. - *

- *

- * With this callback, the registered extensions are notified of this result before the path search either initializes the - * next list of edges to route or ends the path search by calling - * {@link yfiles.router.PathSearchExtension#cleanUp}. This implementation does nothing. - *

- * @param pathSearchResult the path search result for the edge in the current context's edge list - * @see yfiles.router.PathSearchExtension#initializeEdges - * @see yfiles.router.PathSearchExtension#cleanUp - */ - finalizePathSearchResult(pathSearchResult:yfiles.router.PathSearchResult):void; - /** - * Initializes this extension for path searches using the given configuration. - *

- * This method is the first one to be called by the {@link yfiles.router.PathSearch}. It may be overridden to initialize this - * extension with necessary settings like {@link yfiles.layout.GroupingSupport}. - *

- * @param configuration the configuration to use for the following path searches - */ - initialize(configuration:yfiles.router.PathSearchConfiguration):void; - /** - * Initializes this extension with the current edge set in the given context. - *

- * This method is called for each edge of the {@link yfiles.router.PathSearchExtension#context context}. Each call will be balanced by a call to either {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} - * or {@link yfiles.router.PathSearchExtension#cancelCurrentEdge}. - *

- *

- * It may be overridden to initialize/reset the settings for the current edge (e.g. minimum distances). - *

- * @param context the context containing the current edge - * @see yfiles.router.PathSearchContext#currentEdge - */ - initializeCurrentEdge(context:yfiles.router.PathSearchContext):void; - /** - * Initializes this extension with the context that contains the list of edges for which paths are calculated. - *

- * This method may be called several times during a path search. Each call will be balanced by calls to {@link yfiles.router.PathSearchExtension#finalizeEdges} - * and {@link yfiles.router.PathSearchExtension#finalizePathSearchResult}. - *

- *

- * It may be overridden to initialize/reset the settings for the routed edges (e.g. minimum distances). - *

- * @param context the context containing the list of edges for which paths shall be found - * @see yfiles.router.PathSearchContext#edges - */ - initializeEdges(context:yfiles.router.PathSearchContext):void; - /** - * Determines whether or not this extension considers the given {@link yfiles.router.CellEntrance} as a valid target entrance, - * i.e., the path may end with the given entrance. - *

- * Each time a {@link yfiles.router.CellEntrance} is chosen as next step, all registered extensions are asked if this entrance is a - * valid target entrance. Only if none of the extensions returns false, a {@link yfiles.router.Path} is created. - *

- *

- * This implementation accepts all - * {@link yfiles.router.CellEntrance}s as valid targets. It may be overridden to only activate the target if the route fulfills a - * certain condition. - *

- * @param entrance the entrance to decide if it is a valid target entrance - * @returns true if the path may end with this entrance, false otherwise - */ - isValidTargetEntrance(entrance:yfiles.router.CellEntrance):boolean; - /** - * Gets the configuration used for the path search. - *

- * This property is initialized in {@link yfiles.router.PathSearchExtension#initialize}. - *

- * @type {yfiles.router.PathSearchConfiguration} - */ - configuration:yfiles.router.PathSearchConfiguration; - /** - * Gets the current context of the path search. - *

- * This property is initialized in {@link yfiles.router.PathSearchExtension#initializeEdges}. - *

- * @protected - * @type {yfiles.router.PathSearchContext} - */ - context:yfiles.router.PathSearchContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearchExtension; - } - /** - * This class manages the best {@link yfiles.router.Path}s found for each edge and provides according {@link yfiles.router.EdgeInfo}s. - *

- * These are used by the {@link yfiles.router.ChannelBasedPathRouting} algorithm to calculate the final segment locations for the - * segments of an edge path. - *

- * @class - */ - export interface PathSearchResult extends yfiles.lang.Object{} - export class PathSearchResult { - /** - * Creates a new instance of {@link yfiles.router.PathSearchResult}. - * @param configuration the configuration used for the path search - */ - constructor(configuration:yfiles.router.PathSearchConfiguration); - /** - * Returns an {@link yfiles.router.EdgeInfo} for the given edge. - *

- * If the given edge shall be routed but no path has been set for it, yet, null is returned. If no {@link yfiles.router.EdgeInfo} - * has been created for the path by this context before, a new one is instantiated, otherwise the stored one is returned. - *

- * @param edge the edge for which the {@link } will be returned - * @returns an {@link } describing the path of the edge - * @see yfiles.router.PathSearchResult#setPath - */ - getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.router.EdgeInfo; - /** - * Returns an {@link yfiles.router.EdgeInfo} for the given path. - *

- * If no {@link yfiles.router.EdgeInfo} has been created for this path by this context before, a new one is instantiated, otherwise - * the stored one is returned. - *

- * @param path the path for which the {@link } will be returned - * @returns an {@link } describing the given path - */ - getEdgeInfo(path:yfiles.router.Path):yfiles.router.EdgeInfo; - /** - * Returns the previously registered path found for the edge. - * @param edge the edge for which the path is provided - * @returns the previously registered path found for the edge or null if no path has been registered, yet - */ - getPath(edge:yfiles.algorithms.Edge):yfiles.router.Path; - /** - * Specifies a found path for an edge. - * @param edge the edge for which the path is set - * @param path the found path - */ - setPath(edge:yfiles.algorithms.Edge,path:yfiles.router.Path):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearchResult; - } - /** - * This class provides the cost penalties that are applied for violating restrictions during a {@link yfiles.router.PathSearch}. - *

- * The {@link yfiles.router.PathSearch} calculates the shortest path from the source to the target, where shortest path means the path with the - * lowest costs. Costs result from violations of restrictions that are defined by the different - * {@link yfiles.router.PathSearchExtension}s. This class defines penalties for the various violations. The {@link yfiles.router.PathSearch} - * can be adapted to specific needs by varying these penalties. In order to avoid a certain violation, the appropriate - * penalty must be increased. - *

- *

- * There are some predefined penalty settings which set a different focus for the path search: - * {@link yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS} - * and {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS}. - *

- * @class - */ - export interface PenaltySettings extends yfiles.lang.Object{} - export class PenaltySettings { - /** - * Creates a new instance of {@link yfiles.router.PenaltySettings}. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.router.PenaltySettings} instance. - *

- * This implementation uses method {@link yfiles.router.PenaltySettings#newInstance} to obtain a new instance which adopts all - * settings. - *

- * @returns a copy of this instance - */ - createCopy():yfiles.router.PenaltySettings; - /** - * Creates a new instance of {@link yfiles.router.PenaltySettings}. - *

- * This factory method is used by - * {@link yfiles.router.PenaltySettings#createCopy}. Subclasses can override this method in order to return a more specialized - * version. - *

- * @returns a specialized {@link } - * @protected - */ - newInstance():yfiles.router.PenaltySettings; - /** - * Optimization strategy that balances bends and edge crossings in the edge routes. - *

- * By default, this strategy is used for the path search. - *

- * @const - * @static - * @type {yfiles.router.PenaltySettings} - */ - static OPTIMIZATION_BALANCED:yfiles.router.PenaltySettings; - /** - * Optimization strategy that minimizes bends in the edge routes. - *

- * Edges may cross other edges to prevent bends occurring around them. - *

- * @const - * @static - * @type {yfiles.router.PenaltySettings} - */ - static OPTIMIZATION_EDGE_BENDS:yfiles.router.PenaltySettings; - /** - * Optimization strategy that minimizes edge crossings in the edge routes. - *

- * This may cause more bends. - *

- * @const - * @static - * @type {yfiles.router.PenaltySettings} - */ - static OPTIMIZATION_EDGE_CROSSINGS:yfiles.router.PenaltySettings; - /** - * Optimization strategy that minimizes the length of the edge routes. - *

- * In consequence, there may be more edge crossings. - *

- * @const - * @static - * @type {yfiles.router.PenaltySettings} - */ - static OPTIMIZATION_EDGE_LENGTHS:yfiles.router.PenaltySettings; - /** - * Gets or sets the penalty for the edge length. - *

- * This penalty will make long routes more expensive than short routes so edges will preferably be kept short. - *

- *

- * Increasing the edge length penalty will raise the importance of short edges in relation to all other penalties while - * decreasing this penalty will raise the importance of all other restrictions. A high edge length penalty will result in - * routes that have less bends and more edge crossings to maintain the edge as short as possible. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - edgeLengthPenalty:number; - /** - * Gets or sets the penalty for an edge bend. - *

- * This penalty will make routes with many bends more expensive than routes with few or no bends. Hence, edges will have - * preferably few bends. - *

- *

- * Increasing bend penalty will raise the importance of avoiding bends in relation to other penalties while decreasing this - * penalty will raise the importance of all other restrictions. A high bend penalty will result in routes that will - * preferably cross other edges instead of bending to avoid other edges. When increasing the edge bend penalty, the - * resulting routes will have more edge crossings. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - bendPenalty:number; - /** - * Gets or sets the penalty for a crossing of two edges. - *

- * This penalty will make routes that cross many other edges more expensive than routes that cross few other edges or no - * edges at all. Hence, edges preferably won't cross other edges. - *

- *

- * Increasing the edge crossing penalty will raise the importance of avoiding edge crossings in relation to other - * penalties, while decreasing this penalty will raise the importance of all other restrictions. When increasing the edge - * crossing penalty, the resulting route will be longer and have more bends because crossing other edges needs to be - * avoided. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - edgeCrossingPenalty:number; - /** - * Gets or sets the penalty for an edge crossing a regular node. - *

- * This penalty will make routes that cross normal nodes more expensive than routes that avoid crossing nodes. Hence, edges - * won't preferably cross any nodes. - *

- *

- * Increasing the node crossing penalty will raise the importance of avoiding node crossings in relation to other - * penalties, while decreasing this penalty will raise the importance of all other restrictions. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - nodeCrossingPenalty:number; - /** - * Gets or sets the penalty for an edge crossing a group node. - *

- * This penalty will make routes that cross group nodes more expensive than routes that avoid crossing group nodes. Hence, - * edges won't preferably cross any group nodes. - *

- *

- * Increasing the group node crossing penalty will raise the importance of avoiding group node crossings in relation to - * other penalties, while decreasing this penalty will raise the importance of all other restrictions. - *

- * @type {number} - */ - groupNodeCrossingPenalty:number; - /** - * Gets or sets the penalty for an edge crossing a node label. - *

- * This penalty will make routes that cross node labels more expensive than routes that avoid crossing node labels. Hence, - * edges won't preferably cross any node labels. - *

- *

- * Increasing the node label crossing penalty will raise the importance of avoiding node labels crossings in relation to - * other penalties, while decreasing this penalty will raise the importance of all other restrictions. A high label - * crossing penalty will cause edges to bend more often to avoid passing straight through labels. - *

- *

- * The crossing penalty can be weighted for each label individually using the - * {@link yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY}. - *

- *

- * Use {@link yfiles.router.EdgeRouter#considerNodeLabels} to set whether node labels should be considered when routing the edges. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#considerNodeLabels - * @type {number} - */ - nodeLabelCrossingPenalty:number; - /** - * Gets or sets the penalty for an edge crossing an edge label. - *

- * This penalty will make routes that cross edge labels of fixed edges more expensive than routes that avoid crossing edge - * labels, so edges won't preferably cross any edge labels that belong to fixed edges. - *

- *

- * Increasing the edge label crossing penalty will raise the importance of avoiding edge labels crossings in relation to - * other penalties, while decreasing this penalty will raise the importance of all other restrictions. A high label - * crossing penalty will cause edges to bend more often to avoid passing straight through labels. - *

- *

- * The crossing penalty can be weighted for each label individually using the - * {@link yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY}. - *

- *

- * Use {@link yfiles.router.EdgeRouter#considerEdgeLabels} to set whether edge labels should be considered when routing the edges. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#considerEdgeLabels - * @type {number} - */ - edgeLabelCrossingPenalty:number; - /** - * Gets or sets the penalty for violations of the minimum distance between any edge and any normal node side. - *

- * This penalty will make routes that pass too close to normal nodes more expensive than routes that maintain the specified - * minimum node to edge distance. - *

- *

- * Increasing the minimum node to edge distance penalty will raise the importance of maintaining the minimum distance to - * nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for violating - * the minimum distance between edges and nodes will produce edges that rather use a long route around nodes to maintain - * the specified distance than pass through a small channel between two nodes. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance - * @type {number} - */ - minimumNodeToEdgeDistancePenalty:number; - /** - * Gets or sets the penalty for violations of the minimum distance between any edge and any group node side. - *

- * This penalty will make routes that pass group nodes too close more expensive than routes that maintain the specified - * minimum node to edge distance. - *

- *

- * Increasing the minimum group node to edge distance penalty will raise the importance of maintaining the minimum distance - * to group nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for - * violating the minimum distance between edges and group nodes will produce edges that rather use a long route around - * group nodes to maintain the specified distance than pass through a small channel between two group nodes. - *

- *

- * Use {@link yfiles.router.EdgeRouter#minimumNodeToEdgeDistance} to set the minimum distance. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance - * @type {number} - */ - minimumGroupNodeToEdgeDistancePenalty:number; - /** - * Gets or sets the penalty for violations of the minimum distance between any two edges. - *

- * This penalty will make routes that pass other edges too close more expensive than routes that maintain the specified - * minimum edge to edge distance. - *

- *

- * Increasing the minimum edge to edge distance penalty will raise the importance of maintaining the minimum distance to - * other edges, while decreasing this penalty will raise the importance of all other restrictions. When this penalty has a - * high value, edges will maintain the specified distance. This may also reduce the number of edges that pass through a - * small channel between nodes. So, if such a channel is part of the shortest routes for many edges, some of them will take - * a longer way. - *

- *

- * Use {@link yfiles.router.EdgeLayoutDescriptor#minimumEdgeToEdgeDistance} to set the minimum distance for a certain edge to any other edge. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeLayoutDescriptor#minimumEdgeToEdgeDistance - * @type {number} - */ - minimumEdgeToEdgeDistancePenalty:number; - /** - * Gets or sets the penalty for violations of the minimum distance the edge shall maintain from node corners when entering - * or leaving the node. - *

- * This penalty will make routes that end too close to the corner of their source or target node more expensive than routes - * that maintain the specified minimum node corner distance. - *

- *

- * Increasing the node corner distance penalty will raise the importance of maintaining the minimum distance to the corner - * of the adjacent nodes, while decreasing this penalty will raise the importance of all other restrictions. - *

- *

- * Use {@link yfiles.router.EdgeLayoutDescriptor#minimumNodeCornerDistance} to set the minimum node corner distance for a certain edge. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeLayoutDescriptor#minimumNodeCornerDistance - * @type {number} - */ - minimumNodeCornerDistancePenalty:number; - /** - * Gets or sets the penalty for violations of the minimum length of the first and last segment of an edge. - *

- * This penalty will make routes whose first/last bend is too close to their source or target node more expensive than - * routes that maintain the specified minimum first/last segment length. - *

- *

- * Increasing the minimum first last segment length penalty will raise the importance of maintaining the first and last - * segment as long as they fit the minimum first/last segment length, while decreasing this penalty will raise the - * importance of all other restrictions. - *

- *

- * Use {@link yfiles.router.EdgeLayoutDescriptor#minimumFirstSegmentLength} to set the minimum length of the first segment and {@link yfiles.router.EdgeLayoutDescriptor#minimumLastSegmentLength} to set the minimum length of the last segment of a certain - * edge. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeLayoutDescriptor#minimumFirstSegmentLength - * @see yfiles.router.EdgeLayoutDescriptor#minimumLastSegmentLength - * @type {number} - */ - minimumFirstLastSegmentLengthPenalty:number; - /** - * Gets or sets the penalty for an edge bend being closer to the border of the source node, the target node or one of their - * ancestor group nodes than the minimum node to edge distance. - *

- * This penalty will make routes that bend too close to their source or target node more expensive than routes that - * maintain the specified minimum node to edge distance. - *

- *

- * Increasing the bends in node to edge distance penalty will raise the importance of avoiding bends that violate the - * minimum node to edge distance, while decreasing this penalty will raise the importance of all other restrictions. This - * penalty supports - * {@link yfiles.router.EdgeRouter#minimumNodeToEdgeDistance}. In case the path search finally reaches the target node, the minimum node to edge distance for this node must be - * violated. Penalizing bends that are too close to the node forces the edge to directly cross this distance and connect to - * the node. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance - * @type {number} - */ - bendsInNodeToEdgeDistancePenalty:number; - /** - * Gets or sets the penalty for violating the monotonic path restrictions of an edge. - *

- * This penalty will make routes with detours m ore expensive than routes that stay monotone. - *

- *

- * Increasing the monotony violation penalty will raise the importance of avoiding detours in the specified direction, - * while decreasing this penalty will raise the importance of all other restrictions. - *

- *

- * Use {@link yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction} to set the monotonic path restrictions of a certain edge. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - * @type {number} - */ - monotonyViolationPenalty:number; - /** - * Gets or sets the penalty for an edge leaving and reentering in the same {@link yfiles.layout.PartitionGrid partition grid} cell. - *

- * This penalty will make routes that re-enter the same partition grid cell more expensive than routes taking a more direct - * way. - *

- *

- * Increasing the partition grid reentrance penalty will raise the importance of taking the most direct way through the - * partition grid, while decreasing this penalty will raise the importance of all other restrictions. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.layout.PartitionGrid - * @type {number} - */ - partitionGridCellReentrancePenalty:number; - /** - * Gets or sets the penalty if an edge does not comply with its {@link yfiles.layout.PortCandidate}s or - * {@link yfiles.layout.PortConstraint}s. - *

- * This penalty will make routes that start or end at a point that doesn't comply with its port constraints more expensive - * than routes that obey them. - *

- *

- * Increasing the port violation penalty will raise the importance of maintaining port constraints, while decreasing this - * penalty will raise the importance of all other restrictions. It is recommended to have high penalties for port violation - * since the constraints lose purpose if they are disregarded. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.layout.PortCandidate - * @see yfiles.layout.PortConstraint - * @type {number} - */ - portViolationPenalty:number; - /** - * Gets or sets the penalty for an edge with a group ID that is not grouped at source or target side. - *

- * This penalty will make routes for grouped edges that don't use partly the same path as the other edges in this group - * more expensive than routes that stick to the group. - *

- *

- * Increasing the invalid edge grouping penalty will raise the importance of grouping edges with the same group ID, while - * decreasing this penalty will raise the importance of all other restrictions. As edge groups require that the route of an - * edge belonging to an edge group stays partly identical to the other edges of the group, the route may not be optimal - * with respect to the other restrictions. To maintain the edges together as long as possible, this penalty should be - * higher than most others. - *

- *

- * Grouped edges have the same source or target group ID assigned in the data provider registered with the graph with the {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * or {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} key. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {number} - */ - invalidEdgeGroupingPenalty:number; - /** - * Gets or sets the penalty for bends of a self-loop edge. - *

- * This penalty will make self-loops leave and enter the node at different sides unless they are forced to one side by - * {@link yfiles.layout.PortConstraint}s or {@link yfiles.layout.PortCandidate}s. - *

- *

- * Increasing this penalty will stronger enforce routing the self-loops between two sides of the node but it will also - * require more time for determining the edge path. Decreasing the penalty may result in self-loops that only connect to - * one side of the node. - *

- *

- * By default this value is set to 9. The value must be >= 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - singleSideSelfLoopPenalty:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PenaltySettings; - } - /** - * {@link yfiles.router.PolylineLayoutStage} extends the orthogonal edge paths with polyline segments. - *

- * The current implementation only adds octilinear segments to all orthogonal edges. Non-orthogonal edges are completely - * ignored. - *

- *

- * An octilinear segment is added between two consecutive vertical and horizontal segments. The length of an octilinear - * segment can be influenced by the {@link yfiles.router.PolylineLayoutStage#maximumNonOrthogonalSegmentRatio maximum non-orthogonal segment ratio} and the {@link yfiles.router.PolylineLayoutStage#preferredPolylineSegmentLength preferred polyline segment length}. The new - * octilinear segments maintain a {@link yfiles.router.PolylineLayoutStage#minimumNodeToEdgeDistance minimum distance} between the edges and all nodes in the graph if possible. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PolylineLayoutStage extends yfiles.layout.LayoutStageBase{} - export class PolylineLayoutStage { - /** - * Creates a new instance of {@link yfiles.router.PolylineLayoutStage} using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] the core layout routine - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected state of the nodes of the graph to - * be laid out. - *

- * If the {@link yfiles.router.PolylineLayoutStage#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}, only edges of selected nodes are routed, while all other edges are - * considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.router.PolylineLayoutStage#scope - * @type {any} - */ - affectedNodesDpKey:any; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected state of the edges of the graph to - * be laid out. - *

- * If the {@link yfiles.router.PolylineLayoutStage#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the selected edges are routed, while all other edges are considered to - * have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.router.PolylineLayoutStage#scope - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets the (sub-)set of edges to be routed in a polyline fashion. - * @throws {Stubs.Exceptions.ArgumentError} if the given argument is none of the predefined scope values - * @see yfiles.router.PolylineLayoutStage#affectedEdgesDpKey - * @see yfiles.router.PolylineLayoutStage#affectedNodesDpKey - * @type {yfiles.router.Scope} - */ - scope:yfiles.router.Scope; - /** - * Gets or sets the minimum distance between edges and node bounds. - *

- * Values should be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @type {number} - */ - minimumNodeToEdgeDistance:number; - /** - * Gets or sets the maximum segment length ratio at each end of an orthogonal segment that may get converted into a - * (non-orthogonal) polyline segment. - *

- * The ratio must be between 0 and 0.5. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the ratio does not lie within [0,0.5] interval - * @type {number} - */ - maximumNonOrthogonalSegmentRatio:number; - /** - * Gets or sets the preferred segment length for (non-orthogonal) polyline segments. - *

- * Values should be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the length is negative - * @type {number} - */ - preferredPolylineSegmentLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PolylineLayoutStage; - } - /** - * Represents a group of segments of different edges that shall be combined at their common source or target. - *

- * Grouped edges have the same source or target group ID assigned in the {@link yfiles.algorithms.IDataProvider} registered with - * the graph with {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} or {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} - * keys. - *

- *

- * The {@link yfiles.router.SegmentGroup} contains the {@link yfiles.router.SegmentGroup#commonLocationRange common location range} for the edge group and provides a {@link yfiles.router.SegmentGroup#commonSegmentInfo common segment info} - * representing the grouped segments. - *

- * @class - */ - export interface SegmentGroup extends yfiles.lang.Object{} - export class SegmentGroup { - /** - * Creates a new instance of {@link yfiles.router.SegmentGroup} that contains the given segments and a range to place them. - * @param commonLocationRange the location range of the given {@link }s - * @param segmentInfos the list containing the grouped {@link }s - */ - constructor(commonLocationRange:yfiles.router.Interval,segmentInfos:yfiles.collections.IList); - /** - * Gets the common location range for the {@link yfiles.router.SegmentGroup#segmentInfos segments} in this group. - *

- * For vertical grouped segments, this interval describes the horizontal range where this segment can be placed. Horizontal - * grouped segments are placed in a vertical range. - *

- * @type {yfiles.router.Interval} - */ - commonLocationRange:yfiles.router.Interval; - /** - * Gets the list of {@link yfiles.router.SegmentInfo}s contained in this group. - * @type {yfiles.collections.IList.} - */ - segmentInfos:yfiles.collections.IList; - /** - * Gets the common {@link yfiles.router.SegmentInfo} representing the grouped segments. - *

- * The returned segment info is used for placing the common segment. The coordinates are applied to all edges in the bundle - * later. - *

- * @type {yfiles.router.SegmentInfo} - */ - commonSegmentInfo:yfiles.router.SegmentInfo; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.SegmentGroup; - } - /** - * A {@link yfiles.router.SegmentInfo} holds information about the possible location of an orthogonal edge segment. - *

- * Most notably, it stores the {@link yfiles.router.SegmentInfoBase#direction direction} of the segment and the {@link yfiles.router.SegmentInfoBase#locationRange interval} that restricts the location of the segment. - *

- * @class - * @extends {yfiles.router.SegmentInfoBase} - */ - export interface SegmentInfo extends yfiles.router.SegmentInfoBase{} - export class SegmentInfo { - /** - * Creates a new instance of {@link yfiles.router.SegmentInfo} with the given information. - * @param edge the edge to which the segment of this info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param direction the direction to which the segment of this info points - * @param locationRange the range within which the common location of this segment has to lie - * @param minExtension the minimum interval in extension direction this segment is known to intersect - * @param maxExtension the maximum interval in extension direction this segment will span - * @param cellSegmentInfos the list of {@link } objects upon which this segment info is built - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval,cellSegmentInfos:yfiles.collections.IList); - /** - * Creates a new instance of {@link yfiles.router.SegmentInfo} using a {@link yfiles.algorithms.LineSegment} to describe the edge segment. - * @param edge the edge to which the segment of this info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param segment a line segment describing the edge segment - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,segment:yfiles.algorithms.LineSegment); - /** - * Returns the number of {@link yfiles.router.CellSegmentInfo} of this segment info. - * @returns the number of {@link } of this segment info - */ - cellSegmentInfoCount():number; - /** - * Returns the {@link yfiles.router.CellSegmentInfo} at the given index of this segment info. - * @param index the index of the {@link } to return - * @returns the {@link } at the given index of this segment info - */ - getCellSegmentInfo(index:number):yfiles.router.CellSegmentInfo; - /** - * Sets the {@link yfiles.router.SegmentGroup segment group} for this segment info and its associated {@link yfiles.router.CellSegmentInfo}s. - *

- * The {@link yfiles.router.SegmentInfoBase#locationRange location ranges} are adjusted to use the {@link yfiles.router.SegmentGroup#commonLocationRange}. - *

- * @see yfiles.router.SegmentGroup - * @type {yfiles.router.SegmentGroup} - */ - segmentGroup:yfiles.router.SegmentGroup; - /** - * Gets or sets whether or not this edge segment has the restriction of a strong {@link yfiles.layout.PortConstraint}. - * @type {boolean} - */ - atStrongPortConstraint:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.SegmentInfo; - } - /** - * This class stores location information for orthogonal edge segments. - *

- * Most notably, {@link yfiles.router.SegmentInfoBase} stores the {@link yfiles.router.SegmentInfoBase#direction direction} to which the segment points and the {@link yfiles.router.SegmentInfoBase#locationRange interval} describing - * possible locations and extensions of a segment. - *

- * @class - */ - export interface SegmentInfoBase extends yfiles.lang.Object{} - export class SegmentInfoBase { - /** - * Creates a new instance of {@link yfiles.router.SegmentInfoBase}. - * @param edge the edge to which the segment of this info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param direction the direction to which the segment of this info points - * @param locationRange the range within which the common location of this segment has to lie - * @param minExtension the minimum interval in extension direction this segment is known to intersect - * @param maxExtension the maximum interval in extension direction this segment will span - * @protected - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval); - /** - * Creates a new instance of {@link yfiles.router.SegmentInfoBase} using a line segment to describe the edge segment. - *

- * This constructor is meant to be used for fixed orthogonal edge segments. - *

- * @param edge the edge to which this segment info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param segment a line segment describing the edge segment - * @protected - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,segment:yfiles.algorithms.LineSegment); - /** - * Gets the minimum known extension of the segment, i.e., the minimum interval that this segment will cover in any case. - *

- * For horizontal intervals, this is the minimum horizontal extension; for vertical intervals, this is the minimum vertical - * extension. - *

- * @type {yfiles.router.Interval} - */ - minExtension:yfiles.router.Interval; - /** - * Gets the maximum extension that this segment can span. - *

- * For horizontal intervals, this is the maximum horizontal extension; for vertical intervals, this is the maximum vertical - * extension. - *

- * @type {yfiles.router.Interval} - */ - maxExtension:yfiles.router.Interval; - /** - * Gets the range, i.e., the interval within which the segment should be placed. - *

- * For horizontal segments, this is the range containing the vertical location; for vertical segments, this is the range - * containing the horizontal location. - *

- * @type {yfiles.router.Interval} - */ - locationRange:yfiles.router.Interval; - /** - * Gets or sets the preferred placement of this segment within its location range. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown alignment is given - * @type {yfiles.router.Alignment} - */ - preferredAlignment:yfiles.router.Alignment; - /** - * Gets or sets the {@link yfiles.router.SegmentInfoBase#fixed fixed} location within the {@link yfiles.router.SegmentInfoBase#locationRange location range} for this segment info. - *

- * For horizontal segments, this is the vertical location; for vertical segments, this is the horizontal location. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if the segment info already has a fixed location - * @throws {Stubs.Exceptions.ArgumentError} if the given location does not lie within the location range - * @see yfiles.router.SegmentInfoBase#fixed - * @see yfiles.router.SegmentInfoBase#locationRange - * @type {number} - */ - location:number; - /** - * Gets whether or not this segment info is fixed, i.e., a {@link yfiles.router.SegmentInfoBase#location fixed location} has been determined within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. - * @type {boolean} - */ - fixed:boolean; - /** - * Gets whether or not the associated segment is vertical. - * @type {boolean} - */ - vertical:boolean; - /** - * Gets the {@link yfiles.layout.Direction} to which the segment of this info points. - * @type {yfiles.layout.Direction} - */ - direction:yfiles.layout.Direction; - /** - * Gets the edge to which the segment of this info belongs. - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - /** - * Gets the index of the segment of this info. - * @type {number} - */ - segmentIndex:number; - /** - * Gets or sets the segment group to which this segment info belongs. - *

- * When defining the segment group, the {@link yfiles.router.SegmentInfoBase#locationRange location range} will be adjusted to use the common interval of the segment group. - *

- * @see yfiles.router.SegmentGroup#commonLocationRange - * @type {yfiles.router.SegmentGroup} - */ - segmentGroup:yfiles.router.SegmentGroup; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.SegmentInfoBase; - } - /** - * A descriptor for bus-related information to be associated with an edge. - *

- * It consists of a bus ID defining the bus of the associated edge, two optional edge group IDs for specifying the edge - * grouping at the source and target side, respectively, and an optional boolean flag to mark the edge as fixed. - *

- *

- * Every object except null can be used as a valid bus ID. Every edge of ID null forms a group of its own. Also, every - * object except null can be used as a valid edge group ID. If there is no group ID defined for an edge or if null is set, - * a default group ID is used. Therefore, all such edges ending at the same node belong to the same group. - *

- * @see yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY - * @class - */ - export interface BusDescriptor extends yfiles.lang.Object{} - export class BusDescriptor { - /** - * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters. - * @param busID the ID of the bus to which the associated edge belongs - * @param fixed true if associated edge is fixed, false otherwise - * @param sourceGroupID the group ID of the source side - * @param targetGroupID the group ID of the target side - */ - constructor(busID:any,fixed:boolean,sourceGroupID:any,targetGroupID:any); - /** - * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters and default group IDs. - * @param busID the ID of the bus to which the associated edge belongs - * @param fixed true if associated edge is fixed, false otherwise - */ - constructor(busID:any,fixed:boolean); - /** - * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters and marks it as not fixed. - * @param busID the ID of the bus to which the associated edge belongs - * @param sourceGroupID the group ID of the source side - * @param targetGroupID the group ID of the target side - */ - constructor(busID:any,sourceGroupID:any,targetGroupID:any); - /** - * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified bus ID which is marked as not fixed and uses the - * default edge group IDs. - * @param busID the ID of the bus to which the associated edge belongs - */ - constructor(busID:any); - /** - * Gets or sets the bus ID. - *

- * Edges associated with {@link yfiles.router.BusDescriptor descriptor instances} having the same bus ID belong to a common bus. Every edge associated with ID - * null forms a group of its own. - *

- * @type {any} - */ - busId:any; - /** - * Gets or sets the group ID for the source side of the edge. - *

- * Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections - * at v. - *

- * @type {any} - */ - sourceGroupId:any; - /** - * Gets or sets the group ID for the target side of the edge. - *

- * Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections - * at v. - *

- * @type {any} - */ - targetGroupId:any; - /** - * Gets or sets whether or not the associated edge is fixed. - *

- * The algorithm doesn't change the route of fixed edges but tries to prevent overlaps with non-fixed edges. - *

- * @type {boolean} - */ - fixed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.BusDescriptor; - } - /** - * This class provides helper methods to convert between buses given by complete subgraphs and buses represented by - * specific hub nodes. - *

- * In a representation by means of hubs, each connected subgraph induced by hubs establishes a bus. All regular nodes - * (non-hubs) which are connected to hubs of the same component are end-nodes of the same bus. In other words, nodes which - * are reachable on paths consisting of only hubs belong to the same bus. Of course, a node can be an end-node of more than - * one bus. - *

- *

- * Since a bus models a group of nodes in which every node is connected to every other node, it can be represented as a - * complete subgraph of these nodes. To distinguish buses in this representation, each edge must be associated with a - * unique ID which identifies the bus to which it is associated. This is the representation expected by - * {@link yfiles.router.BusRouter}. - *

- * @class - */ - export interface BusRepresentations extends yfiles.lang.Object{} - export class BusRepresentations { - /** - * Changes the representation of buses from hubs to complete subgraphs by creating new edges between regular nodes and - * removing the hubs. - *

- * This method respects multiple connections of nodes and creates appropriate - * {@link yfiles.router.BusDescriptor}s consisting of the bus ID as well as source and target group IDs. - *

- *

- * The path of each new edge follows the route defined by the component of the hubs. If the subgraph of hubs is not a tree, - * these paths are ambiguous. In this case, an arbitrary tree is computed from the hub's subgraph which defines all the - * paths. - *

- * @param graph the graph of the bus - * @param hubEdgesLists an array of {@link }s each containing the edges of a bus - * @param hubMarker a {@link } that marks hub nodes - * @param fixedMarker a {@link } that marks fixed edges - * @param descriptorAcceptor a {@link } for storing the created bus descriptors - * @returns a list of the created edges - * @static - */ - static replaceHubsBySubgraph(graph:yfiles.layout.LayoutGraph,hubEdgesLists:yfiles.algorithms.EdgeList[],hubMarker:yfiles.algorithms.IDataProvider,fixedMarker:yfiles.algorithms.IDataProvider,descriptorAcceptor:yfiles.algorithms.IDataAcceptor):yfiles.algorithms.EdgeList; - /** - * Changes the representation of buses from hubs to complete subgraphs. - *

- * This method delegates to {@link yfiles.router.BusRepresentations#replaceHubsBySubgraph}. - *

- * @param graph the graph of the bus - * @param hubMarker a {@link } that marks hub nodes - * @param descriptorAcceptor a {@link } for storing the created bus descriptors - * @returns a list of the created edges - * @see yfiles.router.BusRepresentations#replaceHubsBySubgraph - * @see yfiles.router.BusRepresentations#toEdgeLists - * @static - */ - static replaceHubsBySubgraph(graph:yfiles.layout.LayoutGraph,hubMarker:yfiles.algorithms.IDataProvider,descriptorAcceptor:yfiles.algorithms.IDataAcceptor):yfiles.algorithms.EdgeList; - /** - * Changes the representation of buses from complete subgraphs to hubs by replacing intersection points by hubs. - *

- * The edges of the given graph must form an orthogonal, cycle-free bus, otherwise an {@link yfiles.lang.Exception} is thrown. - *

- * @param graph the graph where each bus is represented by a complete subgraph of the corresponding nodes - * @param edgeCursor an {@link } of the regular edges - * @param descriptorProvider a {@link } that provides a {@link } for each edge - * @param busIDAcceptor an optional {@link } that stores the bus ID for each new edge - * @throws {Stubs.Exceptions.InvalidOperationError} if the path of an edge is not orthogonal or if some paths form a cycle - * @static - */ - static replaceSubgraphByHubs(graph:yfiles.layout.LayoutGraph,edgeCursor:yfiles.algorithms.IEdgeCursor,descriptorProvider:yfiles.algorithms.IDataProvider,busIDAcceptor:yfiles.algorithms.IDataAcceptor):void; - /** - * Calculates for every bus represented by hubs a list of all of its edges. - * @param graph the graph where buses are represented by means of hubs - * @param hubMarker a {@link } which marks hub nodes - * @returns an array of {@link }s where each list contains all edges of a bus - * @static - */ - static toEdgeLists(graph:yfiles.algorithms.Graph,hubMarker:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList[]; - /** - * Data acceptor key to transfer a user-defined object from each original edge to the respective newly created edge - *

- * Since there is no one-to-one mapping between original and new edges, the data provider of this key is responsible for - * the edges whose source endpoint is a regular node. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data acceptor key to transfer a user-defined object from each original edge to the respective newly created edge - *

- * Since there is no one-to-one mapping between original and new edges, the data provider of this key is responsible for - * the edges whose target endpoint is a regular node. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.BusRepresentations; - } - /** - * An edge routing algorithm which routes edges of a graph in an orthogonal bus-style. - *

- * Carefully observe that the resulting representation, with many edge segments drawn on top of each other, leaves little - * room for a sensible interpretation of edge direction. - *

- *

- * Layout Style - *

- *

- * Edge segments are bundled to buses. A bus is a segment shared by multiple edges to which shorter segments that connect - * to actual nodes are attached. Buses and all other segments are routed orthogonally. - *

- *

- * A bus can, for example, be created in parts of a diagram where each node is connected to each other node. There are no - * cycles induced by any two edge paths of the same bus, that is, the combination of all edge routes looks like an - * orthogonal tree. - *

- *

- * The algorithm tries to produce routes where the edges share as much of their paths as possible. It yields long line - * segments (so-called backbone segments) where ideally all but the first and last segments of all edge paths are drawn on top of each other - * (forming a - * bus), with short connections branching off to the nodes - * (bus connections). These short connections bundle the respective first or last segments of a node's incident edges. - *

- *

- * This algorithm will not modify positions or sizes of nodes in any way, but will route the edges of the graph. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[375,165],[375,255],[585,165],[585,255],[585,345],[705,345],[705,165],[705,255],[825,165],[495,435],[585,435],[585,525]],"e":[[2,1,-15,0,0,15,[555,180,555,315,390,315]],[2,3,-15,0,-15,0,[555,180,555,270]],[3,1,-15,0,0,15,[555,270,555,315,390,315]],[2,4,-15,0,-15,0,[555,180,555,360]],[3,4,-15,0,-15,0,[555,270,555,360]],[1,4,0,15,-15,0,[390,315,555,315,555,360]],[5,4,0,-15,-15,0,[720,315,555,315,555,360]],[5,1,0,-15,0,15,[720,315,390,315]],[5,3,0,-15,-15,0,[720,315,555,315,555,270]],[5,2,0,-15,-15,0,[720,315,555,315,555,180]],[5,7,0,-15,0,15],[7,4,0,15,-15,0,[720,315,555,315,555,360]],[7,1,0,15,0,15,[720,315,390,315]],[7,3,0,15,-15,0,[720,315,555,315,555,270]],[7,2,0,15,-15,0,[720,315,555,315,555,180]],[5,9,0,-15,15,0,[720,315,555,315,555,450]],[7,9,0,15,15,0,[720,315,555,315,555,450]],[2,9,-15,0,15,0,[555,180,555,450]],[3,9,-15,0,15,0,[555,270,555,450]],[1,9,0,15,15,0,[390,315,555,315,555,450]],[4,9,-15,0,15,0,[555,360,555,450]],[5,10,0,-15,-15,0,[720,315,555,315,555,450]],[7,10,0,15,-15,0,[720,315,555,315,555,450]],[2,10,-15,0,-15,0,[555,180,555,450]],[3,10,-15,0,-15,0,[555,270,555,450]],[1,10,0,15,-15,0,[390,315,555,315,555,450]],[4,10,-15,0,-15,0,[555,360,555,450]],[9,10,15,0,-15,0],[5,11,0,-15,-15,0,[720,315,555,315,555,540]],[7,11,0,15,-15,0,[720,315,555,315,555,540]],[2,11,-15,0,-15,0,[555,180,555,540]],[3,11,-15,0,-15,0,[555,270,555,540]],[1,11,0,15,-15,0,[390,315,555,315,555,540]],[4,11,-15,0,-15,0,[555,360,555,540]],[9,11,15,0,-15,0,[555,450,555,540]],[10,11,-15,0,-15,0,[555,450,555,540]],[0,1,0,15,0,-15,1],[0,2,0,15,0,15,1,[390,225,600,225]],[1,2,0,-15,0,15,1,[390,225,600,225]],[0,3,0,15,0,-15,1,[390,225,600,225]],[1,3,0,-15,0,-15,1,[390,225,600,225]],[3,2,0,-15,0,15,1],[0,6,0,15,0,15,1,[390,225,720,225]],[1,6,0,-15,0,15,1,[390,225,720,225]],[3,6,0,-15,0,15,1,[600,225,720,225]],[6,2,0,15,0,15,1,[720,225,600,225]],[0,7,0,15,0,-15,1,[390,225,720,225]],[1,7,0,-15,0,-15,1,[390,225,720,225]],[3,7,0,-15,0,-15,1,[600,225,720,225]],[7,2,0,-15,0,15,1,[720,225,600,225]],[7,6,0,-15,0,15,1],[0,8,0,15,0,15,1,[390,225,840,225]],[1,8,0,-15,0,15,1,[390,225,840,225]],[3,8,0,-15,0,15,1,[600,225,840,225]],[7,8,0,-15,0,15,1,[720,225,840,225]],[8,2,0,15,0,15,1,[840,225,600,225]],[8,6,0,15,0,15,1,[840,225,720,225]]],"vp":[375.0,165.0,480.0,390.0]}} Bus-style edge routing with default settings {@graph {"ann":{"s":[30,30],"d":0},"n":[[529,405,120,120],[765,405],[765,495],[945,405],[945,495],[255,405],[255,495],[435,405],[345,495],[435,495],[345,405],[765,212],[765,302],[945,212],[855,302],[945,302],[855,212],[675,302],[900,302],[900,212],[810,212],[810,302],[511,212],[435,212],[359,212],[283,212],[555,105],[622,105],[555,30],[622,30],[622,-45]],"e":[[0,1,60,0,0,15,[780,465]],[0,2,60,0,0,-15,[780,465]],[0,3,60,0,0,15,[960,465]],[0,4,60,0,0,-15,[960,465]],[0,5,-60,0,0,15,[270,465]],[0,6,-60,0,0,-15,[270,465]],[0,7,-60,0,0,15,[450,465]],[0,8,-60,0,0,-15,[360,465]],[0,9,-60,0,0,-15,[450,465]],[0,10,-60,0,0,15,[360,465]],[0,11,0,-60,0,15,[589,272,780,272]],[0,12,0,-60,0,-15,[589,272,780,272]],[0,13,0,-60,0,15,[589,272,960,272]],[0,14,0,-60,0,-15,[589,272,870,272]],[0,15,0,-60,0,-15,[589,272,960,272]],[0,16,0,-60,0,15,[589,272,870,272]],[0,17,0,-60,0,-15,[589,272,690,272]],[0,18,0,-60,0,-15,[589,272,915,272]],[0,19,0,-60,0,15,[589,272,915,272]],[0,20,0,-60,0,15,[589,272,825,272]],[0,21,0,-60,0,-15,[589,272,825,272]],[0,22,0,-60,0,15,[589,272,526,272]],[0,23,0,-60,0,15,[589,272,450,272]],[0,24,0,-60,0,15,[589,272,374,272]],[0,25,0,-60,0,15,[589,272,298,272]],[0,26,15,-60,15,0,[604,120]],[0,27,15,-60,-15,0,[604,120]],[0,28,15,-60,15,0,[604,45]],[0,29,15,-60,-15,0,[604,45]],[0,30,15,-60,-15,0,[604,-30]]],"vp":[255.0,-45.0,720.0,570.0]}} Edge routing sample including four different busesConcept - *

- *

- * The algorithm uses a two-phase process: - *

- *
    - *
  1. Backbone Selection: a set of suitable initial backbone segments is determined.
  2. - *
  3. - * Routing and Recombination: each initial backbone segment is connected to all other backbone segments and to each node by using orthogonal edge - * paths. Then, the resulting structure is reduced to the most optimal structure where backbone segments are long and - * connections to the nodes are short. - *
  4. - *
- *

- * Features - *

- *

- * To determine which edges belong to a common bus, a mapping that assigns a bus ID to each edge must be specified using - * {@link yfiles.router.BusDescriptor}s. A {@link yfiles.algorithms.IDataProvider} holding {@link yfiles.router.BusDescriptor} instances is - * expected to be registered with the graph using the - * {@link yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY descriptor key}. In the absence of an individual bus ID for an edge, a bus consisting only of the single edge is - * created. - *

- *

- * This algorithm supports {@link yfiles.layout.PortConstraint}s as well as - * {@link yfiles.layout.PortCandidate}s to control where edges should connect to nodes. - *

- *

- * Note that if edges of the same bus connect to a common node but have inconsistent or contradicting port - * constraints/candidates, then any of these constraints/candidates can determine the actual location of the common port. - * The same applies for edges that, in addition, belong to the same edge group. - *

- *

- * Also, the cardinality defined with a {@link yfiles.layout.PortCandidateSet} object is interpreted in terms of different bus IDs - * (group IDs) instead of number of edges. - *

- *

- * This algorithm supports incremental edge routing, that is, extending or updating an already existing bus-style - * representation. This is useful to rearrange existing edges or to include additional edges in an existing bus. - *
- * Incremental routing is supported by denoting so-called fixed edges using the - * {@link yfiles.router.BusDescriptor#fixed corresponding BusDescriptor property}. The paths of edges which are not marked as fixed are calculated by the algorithm. - * The structure induced by the fixed edges must be orthogonal and cycle-free. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface BusRouter extends yfiles.layout.LayoutStageBase{} - export class BusRouter { - /** - * Creates a new instance of {@link yfiles.router.BusRouter} with default settings. - */ - constructor(); - /** - * Data provider key for specifying a bus descriptor object for each edge - *

- * The {@link yfiles.router.BusDescriptor} for an edge provides the edge's bus ID, its optional group IDs and whether or not the - * edge is fixed. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the edge subset to be routed - *

- * This key is used if no custom key for specifying the subset is defined using {@link yfiles.router.BusRouter#affectedEdgesDpKey}. - *

- * @see yfiles.router.BusRouter#scope - * @see yfiles.router.BusRouter#affectedEdgesDpKey - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * Positive values greater than 2 are allowed. Positive values less than 2 are ignored, while negative values are mapped to - * their absolute value. - *

- * @see yfiles.router.BusRouter#gridRouting - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets whether or not to route edge segments on grid lines only. - * @type {boolean} - */ - gridRouting:boolean; - /** - * Gets or sets the minimum distance between edge segments and nodes. - *

- * Positive values greater than 2 are allowed. Positive values less than 2 are ignored, while negative values are mapped to - * their absolutes. - *

- * @type {number} - */ - minimumDistanceToNode:number; - /** - * Gets or sets the minimum distance between any two edge segments. - *

- * The edge routing algorithm adheres to this value if possible, but reduces the distance value selectively, i.e., only for - * a currently processed edge, when there is not enough space to find a path with the proper value. - *

- *

- * Positive values greater than 4 are allowed. Positive values less than 4 are ignored, while negative values are mapped to - * their absolute values. - *

- * @type {number} - */ - minimumDistanceToEdge:number; - /** - * Gets or sets the cost for each edge crossing. - *

- * A cost value of n means that it is more profitable for a path to change its direction n times rather than crossing the - * path of an edge. If the cost value is set to 0.0, no global crossing optimization is performed. - *

- *

- * The cost is defined to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given cost value is negative - * @type {number} - */ - crossingCost:number; - /** - * Gets or sets whether or not to perform an additional step to reroute the edges such that the number of edge crossings is - * reduced. - *

- * This features does not guarantee that the number of crossings will be the minimal. - *

- * @see yfiles.router.BusRouter#crossingCost - * @type {boolean} - */ - rerouting:boolean; - /** - * Gets or sets the maximum number of selected backbone segments with the same orientation. - *

- * This setting defines the number of backbone segments of the same orientation which are computed by the backbone - * selection phase. The final number of backbone segments may be different due to changes in the routing and recombination - * phase. - *

- *

- * The number must be a value greater than or equal to 1. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given preferred number is smaller than 1 - * @type {number} - */ - preferredBackboneSegmentCount:number; - /** - * Gets or sets the preferred minimum length of a backbone segment. - *

- * This number defines the minimum length of backbone segments which are computed by the backbone selection phase. Some of - * the final backbone segments may be shorter due to changes in the routing and recombination phase. - *

- *

- * The minimum length is defined to be a value greater than or equal to 1.0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum length is smaller than 1.0 - * @type {number} - */ - minimumBackboneSegmentLength:number; - /** - * Gets or sets the minimum number of bus connections a backbone segment must have. - *

- * If a backbone segment has less connections, it is removed and the affected nodes connect to another backbone segment. - *

- *

- * The minimum connection count must be a value greater than or equal to 1. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum count is smaller than 1 - * @type {number} - */ - minimumBusConnectionsCount:number; - /** - * Gets or sets whether or not collinear bends are removed from the layout. - *

- * A collinear bend is a bend that lies on a common line with its predecessor bend and successor bend. - *

- *

- * If an edge has a collinear bend, there is another edge which has a real bend at this point, i.e., the bend location is - * an intersection of the bus. Therefore, it may be advantageous for some applications to keep such bends. - *

- * @type {boolean} - */ - removeCollinearBends:boolean; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} for marking edges as selected. - *

- * If the {@link yfiles.router.BusRouter#scope scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the edges for which the registered {@link yfiles.algorithms.IDataProvider} - * returns true will be routed. All other edges will be considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets the scope for this routing algorithm that determines which edges are routed. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown scope is given - * @type {yfiles.router.Scope} - */ - scope:yfiles.router.Scope; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.BusRouter; - } - /** - * This edge routing algorithm generates orthogonal routes for the edges of the graph. - *

- * Compared to the routing algorithm implemented by class - * {@link yfiles.router.EdgeRouter}, this implementation is usually faster but supports less constraints and, by default, may - * produce node-edge overlaps. - *

- *

- * Layout Style Edges are routed in an orthogonal fashion, i.e., edge paths consist only of vertical and horizontal segments. - *

- *

- * During the routing process, the positions of the nodes are considered to be fixed and the routing algorithm will not - * modify their locations or their sizes in any way. - *

- *

- * The edge routing algorithm can be applied wherever it is required to route the edges as orthogonal segments, while - * keeping the positions of the nodes in the diagram fixed. Some potential applications include electric circuit design, - * floor planning, UML class diagrams/inheritance diagrams and navigation maps. - *

- *

- * {@graph {"ann":{"s":[45,30],"d":0},"n":[[210,270,60,30],[405,165,60,30],[120,270,60,30],[-7.5,270],[75,375,60,30],[502.5,165],[615,270,60,30],[630,330,30,30],[292.5,225,75,30],[232.5,60],[112.5,165,75,30],[630,60,30,30],[225,0,60,30],[712.5,330],[-7.5,375],[712.5,0],[120,330,60,30],[307.5,330],[712.5,270],[585,165,30,30],[412.5,225],[502.5,225],[232.5,120],[465,105,75,30]],"e":[[7,6,0,-15,0,15],[8,17,0,15,0,-15],[9,3,-22.5,0,-5,-15,[10,75]],[1,9,0,-15,22.5,0,[435,75]],[11,6,0,15,0,-15],[3,2,22.5,0,-30,0],[18,6,-22.5,0,30,0],[3,14,0,15,0,-15],[12,10,-30,0,-5,-15,[145,15]],[10,1,37.5,-5,-30,-5],[10,2,0,15,0,-15],[6,0,-30,0,30,0],[5,19,22.5,0,-15,0],[1,8,-8.75,15,5,-15,[426.25,205,335,205]],[9,11,5,-15,0,-15,[260,50,645,50]],[10,3,-37.5,0,5,-15,[20,180]],[8,0,-37.5,0,0,-15,[240,240]],[18,15,0,-15,0,15],[13,7,-22.5,0,15,0],[2,0,30,0,-30,0],[10,8,37.5,5,-5,-15,[325,185]],[16,17,30,0,-22.5,0],[13,18,0,-15,0,15],[1,5,30,0,-22.5,0],[12,15,30,0,-22.5,0],[12,9,-5,15,-5,-15],[14,4,22.5,0,-30,0],[16,2,0,-15,0,15],[8,20,37.5,0,-22.5,0],[20,1,1.25,-15,1.25,15],[21,5,0,-15,0,15],[22,9,0,-15,0,15],[22,10,-22.5,0,5,-15,[155,135]],[21,20,-22.5,0,22.5,0],[7,17,-15,0,22.5,0],[13,4,0,15,30,0,[735,390]],[23,11,0,-15,-15,0,[502.5,75]],[23,19,37.5,0,0,-15,[600,120]]],"vp":[-8.0,0.0,766.0,405.0]}} Sample output of the orthogonal edge routing algorithm with default settingsConcept This edge routing algorithm combines two - * strategic steps of edge routing and executes them one after the other. The first strategy is called path finder strategy - * and will route the edges, potentially with edge overlaps. The second strategy will then split overlapping edge segments - * inside their channels and distribute them according to the specific distribution strategy. - *

- *

- * The default path finding strategy is {@link yfiles.router.OrthogonalPatternEdgeRouter}. The default edge distribution strategy - * is {@link yfiles.router.OrthogonalSegmentDistributionStage}. - *

- *

- * Features - *

- *

- * This class itself has no special routing options except from specifying the {@link yfiles.router.ChannelEdgeRouter#pathFinderStrategy path finding} and {@link yfiles.router.ChannelEdgeRouter#edgeDistributionStrategy edge distribution} strategy. - * Most of the features like minimum element distances, grid spacing and path restrictions have to be set on the used - * instances for the two routing steps. - *

- *

- * For incremental edge routing, {@link yfiles.algorithms.IDataProvider} key {@link yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY} - * has to be registered with the graph to mark all edges that should be routed by the algorithm. The routes of the other - * edges remain unchanged. If there is no such key registered, the algorithm routes all edges. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface ChannelEdgeRouter extends yfiles.layout.LayoutStageBase{} - export class ChannelEdgeRouter { - /** - * Creates a new {@link yfiles.router.ChannelEdgeRouter} instance with default settings. - */ - constructor(); - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for marking the edges that should be routed - *

- * If this key is not registered with the graph, the algorithm will route all edges. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the strategy for the path finding step. - *

- * This step routes the edges and may produce edge overlaps which are later resolved in the {@link yfiles.router.ChannelEdgeRouter#edgeDistributionStrategy edge distribution} step. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - pathFinderStrategy:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the strategy for the edge distribution step. - *

- * This step distributes overlapping edge segments in their channel. The channel in which the segments can be distributed - * is defined by the surrounding graph elements. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - edgeDistributionStrategy:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ChannelEdgeRouter; - } - /** - * This edge routing algorithm applies organic routes to the edges of the graph. - *

- * Layout Style Edges are routed organically, i.e. in smooth curves around the nodes observing a {@link yfiles.router.OrganicEdgeRouter#minimumDistance minimum distance} to the nodes. - *

- *

- * During the routing process, the positions of the nodes are considered to be fixed and the router will not modify their - * locations or their sizes in any way. - *

- *

- * The edge routing algorithm can be applied whenever edge paths should avoid crossing any nodes in organic or cyclic - * layout styles. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[339,332],[314,663],[246,391],[112,365],[280,143],[309,245],[521,184],[519,462],[638,200],[118,200],[289,600],[419,153],[194,257],[564,349],[39,419],[266,76],[637,149],[247,23],[663,356],[420,517],[583,496],[183,525],[406,271],[498,406],[519,95],[250,263],[634,471],[340,459],[93,504],[368,110],[488,592],[177,154],[266,548],[470,161],[180,365],[606,400],[0,309],[130,256],[154,631],[60,311],[397,568],[16,241],[421,51],[22,368],[463,102],[67,224],[139,45],[196,95],[238,606],[347,510],[471,535],[365,631],[199,314],[125,96],[99,445],[421,463],[457,281],[497,35],[351,161],[572,190],[288,340],[400,220],[119,147],[570,98],[340,569],[526,513],[416,636],[196,35],[447,412],[242,496],[559,292],[150,416],[348,403],[38,477],[539,581],[228,146],[594,554],[610,280],[297,194],[329,0],[406,0],[181,206],[163,467],[317,66],[661,305],[55,150],[508,307],[180,576],[689,231],[96,555],[240,657],[543,241],[111,308],[555,405],[467,643],[449,352],[232,445],[666,416]],"e":[[0,1,[335.66,406.18,333.37,416.82,331.63,427.45,326.91,469.44,325.45,574.7,326.08,585.88,329.61,608.76,330.67,620.69]],[0,2,[322.18,373.25,310.13,381.03]],[0,3,[324.5,334.9,309.02,329.8,293.4,330.34,236.16,351.02,222.05,355.29,206.97,355.02,192.08,353.11,178.03,357.07]],[0,4,[351.49,268.72,349.88,254.78,343.6,242.42,331.57,234.82,303.36,234.17,292.35,226.33,286.5,215.59,286.02,203.04]],[0,5],[0,6,[428.62,311.49,440.22,302.84,454.41,274.85]],[0,7,[446.52,392.65,474.45,404,484.01,413.8,488.6,427.79,494.98,440.48]],[0,8,[426.01,313.31,439.52,303.87,453.15,277.95,464.34,271.34,476.96,270.23,500.5,273.67,544.26,281.36,555.61,282.65,567.08,280.79,577.87,275.33]],[0,9,[308.77,326.66,262.87,308.22,248.01,300.72,238.93,288.48,235.94,272.58,231.01,257.56,219.51,247.31,188.2,245.93,173.56,238.97]],[0,10,[338.79,396.59,334.49,413.65,328.25,447.31,320.83,497.58,312.44,564.66]],[0,11,[389.21,229.75,395.29,218.04]],[0,12,[317.61,329.41,260.47,307.45,250.73,302.73,241.57,296.79]],[0,13,[455.92,337.29,471.02,338.02,485.35,341.25,511.94,349.47]],[0,14,[322.04,373.66,309.3,379.72,294.9,380.89,266.5,377.98,252.08,379.76,238.85,386.12,213.64,401.5,199.41,406.7,183.85,406.68,167.87,404.99,151.09,407.31,134.98,411.26]],[0,15,[353.71,330.4,350.89,263.48,348.57,246.47,341.24,213.46,336.58,196.79,325.52,164.96,319.31,148.97,310.63,133.49]],[0,16,[414.67,318.85,438.09,305.77,445.29,294.3,450.39,282.07,458.9,273.15,469,266.59,548.02,222.11,556.91,213.74,565.88,190.33,574.87,182.39,586.14,178.03]],[0,17,[351.18,260.4,349.73,248.97,342.55,215.84,336.08,193.14,323.88,159.03,318.91,147.37,310.73,137.35,299.46,130.24,274.92,118.04,263.72,110.5,256.06,98.75,255.2,83.29]],[0,18,[449.23,337.24,460.44,336.84,472.05,337.94,483.25,340.2,515.57,347.93,527.01,348.23,538.21,346.05,570.17,336.94,581.97,336.14,593.53,338.61]],[0,19,[386.75,401.74,391.67,414.2,406.76,475.79,410.7,488.12,416.28,499.76,422.43,510.76,429.28,521.1]],[0,20,[441.16,390.65,454.09,396.14,467.28,401.18,479.65,408.23,486.46,419.97,490.73,433.62,499.82,443.19,513.09,447.19,527.26,449.42,540.69,452.14,552.84,459.14,562.64,469.33]],[0,21,[346.85,359.59,309.35,420.4,300.65,431.95,292.74,444.04,275.05,467.54,264.99,478.94,237.08,493.01,226.61,504.8]],[0,22],[0,23,[441.87,390.83,452.09,395.12,474.02,402.99]],[0,24,[394.9,278.08,405.38,265.78,420.33,260.03,433.54,253.67,440.93,239.63,453.72,194.88,457.41,179.4,462.73,163.54,473.96,151.35,489.87,142.62,505.68,131.98]],[0,25],[0,26,[443.76,391.94,454.52,396.46,465.49,400.4,475.94,405.45,483.96,413.69,487.9,425.26,492.62,436.58,501.97,444.03,513.85,447.54,538.88,451.1,551.26,454.29]],[0,27,[335.47,409.13,335.91,425.89,341.76,442.39]],[0,28,[304.63,401.81,279.42,427.37,264.93,433.6,249.25,434.04,233.94,436,177.31,454.17,162.81,461.08,150.78,471.69]],[0,29,[391.99,183.49,392.17,168.35]],[0,30,[379.7,389.49,387.21,404.3,392.85,419.75,407.6,477.96,412.89,491.58,422.65,501.66,437.13,505.23,451.35,510.41,461.14,523.17,460.71,539.45,459.43,556.24,467.8,571.02]],[0,31,[345.1,335.21,335.76,323.75,326.96,311.7,289.98,263.58,279.75,251.93]],[0,32,[343.55,373.14,315.75,453.99]],[0,33,[395.41,277.39,404.28,266.36,430.24,255.67,439.95,245.33,447.72,233.23,455.38,222.46,462.6,210.62,470.24,199.31]],[0,34,[320.5,374.57,310.3,379.58,299.25,381.01,267,377.27,256.18,376.82]],[0,35,[447.26,393.05,464.75,396.92,517.71,393.94,552.46,393.96,570.56,394.48,588.29,399.05]],[0,36,[324.51,334.8,313.86,330.99,302.52,329.37,291.4,331,229.75,353.05,218.61,355.85,206.54,355.04,194.57,352.53,183.37,351.65,140.67,350.4,74.42,351.92,63.14,348.81,43.25,339.26]],[0,37,[315.65,330.79,302.24,326.14,221.99,302.44,208.11,298.95,194.21,294.54]],[0,38,[291.97,443.38,271.04,472.33,261.99,480.94,249.87,486.16,238.48,492.54,232.04,503.67,229.86,516.59,221.46,592.14,216.53,604.24,208.21,614.3]],[0,39,[322.7,334.1,305.86,329.69,288.77,331.39,222.92,355.38,204.68,355.06,185.55,351.32,166.46,350.31,147.42,349.96,127.91,348.98,109.08,344.26]],[0,40,[385.83,399.93,391.14,415,405.18,536.96]],[0,41,[315.73,330.32,285.46,320.65,224.16,303.07,212.95,301.44,150.12,299.63,138.87,297.96,128.22,294.68]],[0,42,[392.06,206.63]],[0,43,[327.11,335.97,312.77,330.73,298.03,329.65,284.06,333.44,230.99,352.58,217.24,355.83,202.62,354.37,187.97,351.92,130.42,351.25,115.65,353.54]],[0,44,[389.02,229.97,397.45,216.12,410.94,207.76,438.95,194.72,452.19,186.4,459.38,173.33,463.33,158.21]],[0,45,[319.72,332.86,301.9,326.53,232.62,305.39,198.66,296.17,186.46,286.52,170.91,259.6,160.55,248.12,145.88,243.01]],[0,46,[286.25,258.53,248.79,216.04,242.43,206.94,235,197.31,228.43,187.39,221.82,176.16,217.01,162.99,210.26,150.25,198.66,139.63,188.34,129.15,180.36,115.63,173.55,101.92]],[0,47,[280.19,249.76,224.45,181.39,217.36,164.22]],[0,48,[285.9,512.16,276.58,527.31,263.6,539.9,254.29,553.79,252.08,570.91]],[0,49,[337.85,400.86,335.22,412.8,335.86,425.11,341.55,436.2,351.73,443.92,363.37,449.51,373.84,456.56,379.94,467.39,380.17,479.84,376.25,491.95,371.73,503.11]],[0,50,[363.53,357.76,373.66,368.31,383.38,379.43,393.44,390.12,433.18,435.74,454.89,458.54,463.23,472.48]],[0,51,[338.15,399.57,334.71,417.74,339.34,434.34,353.71,444.87,370.07,453.14,380.21,466.15,383.35,483.6,387.37,519.13,387.54,537.38,384.43,573.7]],[0,52,[319.73,332.96,301.78,329.04,283.75,328.69]],[0,53,[301.52,278.38,291.52,264.42,231.87,190.09,222.09,176.91,216.51,161.08,208.24,148.12,194.61,139.94]],[0,54,[328.75,368.24,314.97,377.91,298.88,381.42,264.15,377.59,247.67,381.71,234.12,393.32,188.56,445.62,174.64,454.91,158.8,458.39]],[0,55,[385.81,395.38]],[0,56,[442.78,309.64]],[0,57,[378.17,262.12,383.23,246.33,389.07,230.06,397.76,216.16,410.81,208.08,437.76,195.53,450.07,188.37,458.21,177.78,459.5,164.06,457.17,151.5,451.13,127.97,450.06,115.65,453.12,104.07,460.33,94.22]],[0,58],[0,59,[421.29,315.21,437.79,306.24,446.01,291.77,453.41,277.31,467.69,267.94]],[0,60],[0,61,[391.19,276.52]],[0,62,[343.32,333.1,332.31,319.71,321.89,305.25,289,262.94,276.51,250.23,222.11,206.93,207.08,197.5,173.74,189.82]],[0,63,[397.1,274,408.19,264.17,424.19,258.19,439.83,249.88,494.17,203.53]],[0,64,[336.87,404.08,333.8,419.28,329.35,464.32,329.41,479.8,333.11,509.98,335.6,525.23,339.44,540.66]],[0,65,[440.17,441.81,452.51,453.34]],[0,66,[384.08,396.29,390.86,414.32,393.85,433.39,403.11,506.26,405.93,524.42,409.95,542.54,421.55,555.65,435.45,567.44,440.34,583.83,438.64,600.97]],[0,67,[306.34,281.88,300.22,271.55,295.69,260.61,279.48,207.91,267.29,152.86,263.63,142.28,239.06,94.7]],[0,68],[0,69],[0,70,[469.45,323.87,482.71,319.47,494.32,311.46,505.19,301.93,517.88,296.03,532.51,296.41]],[0,71,[323.13,372.77,310.98,379.24,297.29,381.04,270.49,378.25,256.85,378.74,244.01,383.32,199,411.8]],[0,72],[0,73,[325.78,370.71,315.11,377.72,302.8,380.91,290.09,380.37,265.1,378.01,251.79,380.05,241.04,386.57,231.83,395.9,189.43,444.63,178.23,453.01,164.62,459.94,151.89,468.02,140.08,477.64,127.82,485.49,113.2,489.69,97.78,490.87]],[0,74,[453.85,457.25,464.04,469.46]],[0,75,[306.38,281.75,298.95,269.69]],[0,76,[440.85,442.45,452.16,452.04,509.45,492.6,521.63,499.85,535.67,502.44,550.32,503.97,562.01,512.5,580.43,536.15]],[0,77,[474.36,323,489.4,315.19,502.42,304.25,516.41,296.03,531.84,291.13,562.99,282.6,579.4,281.42,595.17,285.3]],[0,78,[353.21,311.51,351.75,274.78,349.92,255.71,341.42,238.46]],[0,79,[352.32,266.07,350.2,244.99,339.48,182.86,339.24,171.66,340.97,160.66,357.4,88.15,357.65,76.64,355.99,65.74]],[0,80,[375.1,267.1,384.99,225.91,396.91,184.78,409.57,132.2,410.69,121.28,408.94,67.51,410.21,56.22,412.62,45.46]],[0,81,[291.41,265.52,281.99,255.89,270.2,249.04]],[0,82,[289.83,417.4,279.44,426.99,267.12,432.95,253.03,433.84,239.16,435.43,227.3,441.61]],[0,83,[351.51,265.09,349.93,248.44,339.25,182.25,337.18,165.16]],[0,84,[455.7,337.03,469.05,337.55,481.96,339.78,505.92,345.81,518.43,348.12,531.41,347.66,567.71,337.38,580.54,334.73]],[0,85,[316.07,329.16,263.32,308.39,250.39,302.01,240.77,292.16,236.59,279.05,234.5,265.5,228.38,254.17,217.84,247.14,204.95,246.22,191.96,246.62,180.26,242.04,172.3,232.48,166.36,221.23,160.82,209.17,153.71,198.91,143.37,190.93,113.51,182.34]],[0,86],[0,87,[306.22,421.73,276.69,464.63,265.95,478.34,238.46,492.28,231.78,504.76,228.46,518.2,223.15,544.77,217.77,557.47]],[0,88,[476.59,322,487.46,316.77,506.01,301.68,516.62,295.9,628.38,263.9]],[0,89,[304.58,402.64,286.25,421.15,275.66,429.7,262.67,433.71,248.08,433.9,234.11,437.41,223.91,447.62,217.54,460.12,206.11,485.16,198.82,497.66,189.34,507.33]],[0,90,[348.03,366.59,344.43,376.17,335.23,405.79,332.53,416.36,309.42,567.16,304.71,578.23,296.24,587.44,286.64,595.91,279.81,606.85,278.36,620.58,275.34,634.69]],[0,91,[428.72,311.52,440.09,302.99,453.32,277.82,465.13,270.94,478.69,267.74]],[0,92,[327.03,335.9,312.92,330.7,298.41,329.58,284.16,333.41,230.95,352.66,216.96,355.85,202.5,353.87]],[0,93,[444.66,391.69,459.07,395.94,474.15,396.91,503.46,395.07,518.07,396.29,531.89,400.88]],[0,94,[386.41,400.52,390.51,410.75,392.91,421.24,405.97,527.76,408.98,540.16,416.51,551.43,428.68,560.5,438.65,572.18,453.33,600.22]],[0,95],[0,96,[288.85,419.25,275.08,433.27]],[0,97,[435.13,387.04,451.62,394.24,468.82,397.13,501.49,394.44,533.26,393.31,563.5,393.53,578.12,395.81,590.16,403.49,595.24,416.31,599.59,429.12,608.91,437.7,621.12,440.69,633.66,439.71,669.2,433.82]]],"vp":[0.0,0.0,719.0,693.0]}}Concept The edge routing algorithm uses a force-directed approach to calculate the edge paths. Nodes are considered to be - * repulsive forces while edges will try to become as short as possible. - *

- *

- * Each edge is routed separately and is influenced by the nodes in a certain area around it. The algorithm will add bends - * to the edge path that are placed by balancing the forces. - *

- *

- * The quality of the result highly depends on how much space there is between the nodes. More precisely, the distance - * between each pair of nodes should be at least twice the specified {@link yfiles.router.OrganicEdgeRouter#minimumDistance minimum distance}. If it is not necessary that the - * nodes keep their locations, this can be ensured using a combination of {@link yfiles.organic.RemoveOverlapsStage} and - * {@link yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage node enlargement stage}. - *

- *

- * Features - *

- *

- * {@link yfiles.router.OrganicEdgeRouter#minimumDistance} will make edges keep a custom distance to the nodes. However, if there is not enough space between the nodes, this - * distance may be undershot (i.e. edges will be closer to nodes). - *

- *

- * {@link yfiles.router.OrganicEdgeRouter} is able to - * {@link yfiles.router.OrganicEdgeRouter#keepExistingBends reuse existing bends}. Edges will contain those bends along with other bends added by the layout algorithm. - *

- *

- * This edge routing algorithm is realized as a {@link yfiles.layout.ILayoutStage} which can be applied to a graph directly or - * using a {@link yfiles.router.OrganicEdgeRouter#coreLayout core layout algorithm}. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface OrganicEdgeRouter extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class OrganicEdgeRouter { - /** - * Creates a new {@link yfiles.router.OrganicEdgeRouter} with the given {@link yfiles.router.OrganicEdgeRouter#coreLayout core layout algorithm}. - * @param core the core layout algorithm - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - /** - * Creates a new {@link yfiles.router.OrganicEdgeRouter} instance with the default settings. - */ - constructor(); - /** - * Performs the organic routing of the edges of the input graph. - * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Returns a {@link yfiles.layout.ILayoutStage} which temporarily increases the sizes of the nodes to avoid overlaps. - *

- * The edges will keep a greater distance to the nodes. Therefore, they won't cross them. - *

- * @returns the {@link } that resizes the nodes - */ - createNodeEnlargementStage():yfiles.layout.ILayoutStage; - /** - * Data provider key for selecting edges that should be routed - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets whether or not edges are allowed to cross nodes. - *

- * Allowing edges to overlap with nodes will produce smoother edges, because the edge paths can be closer to the nodes. - *

- * @see yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage - * @see yfiles.router.OrganicEdgeRouter#minimumDistance - * @type {boolean} - */ - edgeNodeOverlapAllowed:boolean; - /** - * Gets or sets the core layout algorithm which arranges the graph before edge routing. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the minimum distance the algorithm should guarantee between nodes and non-incident edges. - *

- * The distance also influences how many bends are added to the path (a higher distance leads to less bends). - *

- *

- * The minimum distance is defined to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @type {number} - */ - minimumDistance:number; - /** - * Gets or sets whether or not the initial bend coordinates are kept when determining the edge path. - *

- * The bends are considered as fixed nodes and stay part of the path. - *

- * @type {boolean} - */ - keepExistingBends:boolean; - /** - * Gets or sets whether a rerouting step is performed on all edges or just on a subset where distances are violated. - *

- * If only a subset of edges is rerouted, only those edges which cross nodes or come too close to a node are included. - * During rerouting, more bends are added to the edges that will be influenced by the repulsive forces. - *

- * @type {boolean} - */ - routeAllEdges:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrganicEdgeRouter; - } - /** - * {@link yfiles.router.OrthogonalPatternEdgeRouter} routes edges orthogonally such that the resulting layout of the edges consists - * only of vertical and horizontal segments. - *

- * Note that the location and size of the nodes in a diagram remains unchanged. - *

- *

- * The edge router will not try to find a perfect route from source to edge (unlike to what {@link yfiles.router.EdgeRouter} does) - * but chooses the best path out of a set of fixed paths. The best path out of these possible paths is determined by its - * cost. The costs may be influenced by setting several cost factors. The distance that an edge will have from its source - * and target node is determined by {@link yfiles.router.OrthogonalPatternEdgeRouter#minimumDistance}. - *

- *

- * The edges whose paths have to be routed can be defined registering a {@link yfiles.algorithms.IDataProvider} with key - * {@link yfiles.router.OrthogonalPatternEdgeRouter#DEFAULT_AFFECTED_EDGES_DP_KEY}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrthogonalPatternEdgeRouter extends yfiles.layout.LayoutStageBase{} - export class OrthogonalPatternEdgeRouter { - /** - * Creates a new instance of {@link yfiles.router.OrthogonalPatternEdgeRouter} with default settings. - */ - constructor(); - /** - * Calculates the costs for all bends of the given path. - *

- * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation multiplies - * the number of bends with the according {@link yfiles.router.OrthogonalPatternEdgeRouter#bendCost costs}. It may be overridden to change the calculation of these costs. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the costs for the bends of this path - * @protected - */ - calculateBendCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the edge cost of a possible edge path, in order to determine which path is the best, i.e., the cheapest. - *

- * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#applyLayout} in order to decide which path is the - * best. The default implementation considers the edge length, the number of bends, edge crossings, - * {@link yfiles.layout.PortCandidate}s and monotonic path restrictions. It may be overridden to apply a different set of costs or - * a different weighting. - *

- * @param edge the edge whose costs to calculate - * @param path the edge's path - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the sum of all costs for this edge's path - * @protected - */ - calculateCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the overall crossing costs of the given path, including edge crossings, edge overlaps and node crossings. - *

- * This method is called by - * {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation will determine overlaps and - * crossings between edge segments and nodes and sum up the costs. It may be overridden to use a different combination of - * costs. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the overall crossing costs of the given path, including edge crossings, edge overlaps and node crossings - * @protected - */ - calculateCrossingCosts(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the costs for the length of the given path. - *

- * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation returns - * costs between 0 for short paths and 1 for long paths. Hence, it has relatively little impact on the overall costs. The - * method may be overridden to introduce a different weighting of the edge length. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the costs for the length of the given path - * @protected - */ - calculateEdgeLength(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the costs for the chosen {@link yfiles.layout.PortCandidate}s. - *

- * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation will return - * the {@link yfiles.layout.PortCandidate#cost candidates' costs}. It may be overridden to change the calculation of these costs. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the costs for the {@link }s - * @protected - */ - calculatePortCandidateCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the extra penalty that is added to the path's cost if the edge is a self-loop and source and target ports - * have the same direction. - *

- * This method is called by - * {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation adds costs for another bend if - * source and target ports share the same node side. In this manner, paths with different source and target directions are - * cheaper and thus preferred. The method may be overridden to change the calculation of this penalty. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns an extra penalty for specific self-loop paths - * @protected - */ - calculateSelfLoopSelfSidePenaltyCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for determining which edges are routed - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the monotonic path restriction that should be applied. - * @throws {Stubs.Exceptions.ArgumentError} if the specified path restriction is unknown - * @type {yfiles.router.MonotonicPathRestriction} - */ - monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which determines the edges that shall be routed by - * this algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets the minimum distance that an edge will maintain from its source and target node. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - minimumDistance:number; - /** - * Gets or sets the spacing of the grid on which edges are routed. - *

- * The spacing between two grid lines must be at least 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified grid spacing is less than 2 - * @see yfiles.router.OrthogonalPatternEdgeRouter#gridRouting - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets the origin of the grid. - * @throws {Stubs.Exceptions.ArgumentError} if the specified point is null - * @see yfiles.router.OrthogonalPatternEdgeRouter#gridRouting - * @type {yfiles.algorithms.YPoint} - */ - gridOrigin:yfiles.algorithms.YPoint; - /** - * Gets or sets whether or not to route the edges on a grid. - *

- * The grid can be defined using methods {@link yfiles.router.OrthogonalPatternEdgeRouter#gridOrigin} and {@link yfiles.router.OrthogonalPatternEdgeRouter#gridSpacing}. - *

- * @see yfiles.router.OrthogonalPatternEdgeRouter#gridOrigin - * @see yfiles.router.OrthogonalPatternEdgeRouter#gridSpacing - * @type {boolean} - */ - gridRouting:boolean; - /** - * Gets or sets the costs for a crossing between two edges. - *

- * These costs are used for finding the best path out of the predefined paths from which the router can choose. - *

- *

- * The costs need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative - * @type {number} - */ - edgeCrossingCost:number; - /** - * Gets or sets the costs for edges that cross nodes. - *

- * These costs are used for finding the best path out of the predefined paths from which the router can choose. - *

- *

- * The costs need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative - * @type {number} - */ - nodeCrossingCost:number; - /** - * Gets or sets the costs for creating a bend on the edge's path. - *

- * These costs are used for finding the best path out of the predefined paths from which the router can choose. - *

- *

- * The costs need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative - * @type {number} - */ - bendCost:number; - /** - * Gets or sets the costs for overlapping edge paths. - *

- * These costs are used for finding the best path out of the predefined paths from which the router can choose. - *

- *

- * The costs need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative - * @type {number} - */ - edgeOverlapCost:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrthogonalPatternEdgeRouter; - } - /** - * {@link yfiles.router.OrthogonalSegmentDistributionStage} distributes overlapping edge segments of orthogonally routed edges. - *

- * The edge segments are assigned to the so-called channels within which they are distributed. Those channels are defined by the - * surrounding graph elements. - *

- *

- * The algorithm will not distribute the segments, whose endpoints connect to a node using a port that has a strong {@link yfiles.layout.PortConstraint} - * or a fixed {@link yfiles.layout.PortCandidate}. - *

- *

- * Features - *

- *

- * It is possible to define a {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistance preferred distance} between distributed edge segments. This distance will only be applied if - * there is enough space in the according channel. In the case where there is not enough space, the preferred distance may - * be {@link yfiles.router.OrthogonalSegmentDistributionStage#flexiblePreferredDistance reduced} for the edges. If the layout algorithm is not allowed to reduce the preferred distance, these edges won't be - * distributed. - *

- *

- * Edges can be distributed on {@link yfiles.router.OrthogonalSegmentDistributionStage#gridRouting grid coordinates}. The grid can only be considered if there is enough space in the according - * channel for at least as many grid lines as the number of segments. In the case where there is not enough space, the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} - * may be {@link yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing reduced} in this channel. If the layout algorithm is not allowed to reduce the grid spacing, these edges won't be - * distributed. - *

- *

- * Method {@link yfiles.router.OrthogonalSegmentDistributionStage#lockFirstAndLastSegment} can be used to guarantee that the first and last segment of an edge won't be distributed. So, ports can easily - * be maintained without setting explicit strong {@link yfiles.layout.PortConstraint}s or fixed {@link yfiles.layout.PortCandidate}s. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrthogonalSegmentDistributionStage extends yfiles.layout.LayoutStageBase{} - export class OrthogonalSegmentDistributionStage { - /** - * Creates a new instance of {@link yfiles.router.OrthogonalSegmentDistributionStage} with default settings. - */ - constructor(); - /** - * Specifies the coordinates of the origin of the grid. - *

- * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. - *

- * @param offsetX the x-coordinate of the grid origin - * @param offsetY the y-coordinate of the grid origin - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - */ - setGridOrigin(offsetX:number,offsetY:number):void; - /** - * Data provider key for determining which edges are distributed - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which determines the edges that shall be routed by - * this algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets whether or not the preferred distance between edges can be reduced if there is not enough space. - *

- * The space between the nodes restricts the distribution of the orthogonal segments while considering the - * {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistance preferred distance}. In case this option is enabled, the layout algorithm may reduce the preferred distance, otherwise - * the algorithm will only distribute segments if there is enough space. - *

- * @type {boolean} - */ - flexiblePreferredDistance:boolean; - /** - * Gets or sets whether or not the grid spacing can be reduced if there is not enough space. - *

- * The space between the nodes limits the number of grid lines on which edges are placed. In case this option is enabled, - * the layout algorithm will divide the given grid spacing by 2 as long as there are not enough grid lines on which the - * segments can be distributed, otherwise the grid spacing remains unchanged. - *

- * @type {boolean} - */ - flexibleGridSpacing:boolean; - /** - * Gets or sets whether or not the orthogonal segments are distributed on grid coordinates. - * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing - * @see yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing - * @type {boolean} - */ - gridRouting:boolean; - /** - * Gets or sets the spacing between two grid lines. - *

- * The spacing should be at least 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing is negative - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - * @see yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing - * @type {number} - */ - gridSpacing:number; - /** - * Gets the x-coordinate of the origin of the grid. - *

- * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. - *

- * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridOriginY - * @type {number} - */ - gridOriginX:number; - /** - * Gets the y-coordinate of the origin of the grid. - *

- * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. - *

- * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridOriginX - * @type {number} - */ - gridOriginY:number; - /** - * Gets or sets whether or not the first and last segment of an edge will be distributed. - * @type {boolean} - */ - lockFirstAndLastSegment:boolean; - /** - * Gets or sets the preferred distance between each two segments. - *

- * This value also applies to the distance between a segment and the border of the containing channel. - *

- *

- * The preferred distance should be at least 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @see yfiles.router.OrthogonalSegmentDistributionStage#flexiblePreferredDistance - * @type {number} - */ - preferredDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrthogonalSegmentDistributionStage; - } - /** - * {@link yfiles.router.SnapOuterPortsToNodeBorderStage} moves edge ports that are outside the corresponding area of the nodes to - * their border. - *

- * Thus, it guarantees that ports are always in the interior of the nodes or on their borders. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface SnapOuterPortsToNodeBorderStage extends yfiles.layout.LayoutStageBase{} - export class SnapOuterPortsToNodeBorderStage { - /** - * Creates a new instance of {@link yfiles.router.SnapOuterPortsToNodeBorderStage}. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.SnapOuterPortsToNodeBorderStage; - } - /** - * Specifies custom data for the {@link yfiles.router.BusRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface BusRouterData extends yfiles.layout.LayoutData{} - export class BusRouterData { - constructor(); - /** - * Gets or sets the collection of edges affected by this router. - *

- * This collection is only used by the router if the {@link yfiles.router.BusRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. The {@link yfiles.layout.DpKeyItemCollection.#dpKey} only has to - * be specified if the {@link yfiles.router.BusRouter#affectedEdgesDpKey} is not {@link yfiles.router.BusRouter#DEFAULT_AFFECTED_EDGES_DP_KEY} - *

- * @see yfiles.router.BusRouter#affectedEdgesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedEdges:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the mapping of edges to their {@link yfiles.router.BusDescriptor} - * @see yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.BusRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.ChannelEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface ChannelEdgeRouterData extends yfiles.layout.LayoutData{} - export class ChannelEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of edges affected by this router. - * @see yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ChannelEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.OrganicEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface OrganicEdgeRouterData extends yfiles.layout.LayoutData{} - export class OrganicEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of edges routed by this router. - * @see yfiles.router.OrganicEdgeRouter#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrganicEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.OrthogonalPatternEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface OrthogonalPatternEdgeRouterData extends yfiles.layout.LayoutData{} - export class OrthogonalPatternEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of edges affected by this router. - * @see yfiles.router.OrthogonalPatternEdgeRouter#affectedEdgesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedEdges:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrthogonalPatternEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.ParallelEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface ParallelEdgeRouterData extends yfiles.layout.LayoutData{} - export class ParallelEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of edges affected by this router. - * @see yfiles.router.ParallelEdgeRouter#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the collection of leading edges. - *

- * A leading edge is the edge whose layout is used to obtain the layout of the corresponding parallel edges. - *

- * @see yfiles.router.ParallelEdgeRouter#LEADING_EDGE_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - leadingEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ParallelEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.EdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface PolylineEdgeRouterData extends yfiles.layout.LayoutData{} - export class PolylineEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of affected edges. - *

- * This collection is only used by the router if the {@link yfiles.router.EdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. - *

- * @see yfiles.router.EdgeRouter#affectedEdgesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedEdges:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the collection of affected nodes. - *

- * This collection is only used by the router if the {@link yfiles.router.EdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}. - *

- * @see yfiles.router.EdgeRouter#affectedNodesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedNodes:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the collection of labels of nodes or fixed edges that are ignored by the router. - * @see yfiles.layout.LabelLayoutKeys#IGNORED_LABELS_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - ignoredLabels:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping of edges to their {@link yfiles.router.EdgeLayoutDescriptor} - *

- * If an edge is mapped to null, the {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default descriptor} is used. - *

- * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from labels to a crossing penalty factor. - *

- * The crossing penalty factor of a label is multiplied with the basic penalty for an edge crossing the label so crossing a - * label with a higher cost factor is stronger avoided then crossing one with a lower factor. - *

- * @see yfiles.router.PenaltySettings#edgeLabelCrossingPenalty - * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty - * @see yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - labelCrossingPenaltyFactors:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the partition grid layout data. - * @type {yfiles.layout.PartitionGridData} - */ - partitionGridData:yfiles.layout.PartitionGridData; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PolylineEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.StraightLineEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface StraightLineEdgeRouterData extends yfiles.layout.LayoutData{} - export class StraightLineEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of affected edges. - *

- * This collection is only used by the router if the {@link yfiles.router.StraightLineEdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. - *

- * @see yfiles.router.StraightLineEdgeRouter#affectedEdgesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedEdges:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the collection of affected nodes. - *

- * This collection is only used by the router if the {@link yfiles.router.StraightLineEdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}. - *

- * @see yfiles.router.StraightLineEdgeRouter#affectedNodesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedNodes:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.StraightLineEdgeRouterData; - } - }export namespace partial{ - export enum EdgeRoutingStrategy{ - /** - * A routing strategy that produces orthogonal routes for partial edges and inter-edges. - *

- * A route of an edge is called orthogonal if it only consists of vertical and horizontal segments. - *

- *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - ORTHOGONAL, - /** - * A routing strategy that produces straight-line routes for partial edges and inter-edges. - *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - STRAIGHTLINE, - /** - * Automatically chooses a suitable routing strategy for partial edges and inter-edges by analyzing the routes of the fixed - * edges. If, for example, all fixed edges have orthogonal edge routes, inter-edges will be routed orthogonally, too. - *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - AUTOMATIC, - /** - * A routing strategy that produces organic routes for partial edges and inter-edges. - *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - ORGANIC, - /** - * A routing strategy that produces octilinear routes for partial edges and inter-edges. - *

- * A route of an edge is called octilinear if the slope of each segment is a multiple of 45 degrees. - *

- *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - OCTILINEAR - } - export enum ComponentAssignmentStrategy{ - /** - * A component assignment strategy that assigns each partial node to a separate subgraph component. - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - SINGLE, - /** - * A component assignment strategy where the subgraph components correspond to the connected components of the graph - * induced by the partial elements. - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - CONNECTED, - /** - * A component assignment strategy where the subgraph components correspond to the clusters computed by a clustering - * algorithm based on {@link yfiles.algorithms.Groups#edgeBetweennessClustering edge betweenness centrality}. - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - CLUSTERING, - /** - * A component assignment strategy where the subgraph components are defined by the user. Two partial nodes are considered - * to be in the same component if the {@link yfiles.algorithms.IDataProvider} associated with key {@link yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY} - * returns the same object for both of them. - * @see yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - CUSTOMIZED - } - export enum SubgraphPlacement{ - /** - * A positioning strategy which tries to place each subgraph component close to the barycenter of its graph neighbors. - * @see yfiles.partial.PartialLayout#subgraphPlacement - */ - BARYCENTER, - /** - * A positioning strategy which tries to place each subgraph component close to its original position. - * @see yfiles.partial.PartialLayout#subgraphPlacement - */ - FROM_SKETCH - } - export enum LayoutOrientation{ - /** - * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each - * predecessor of a node v is placed above v and each successor below v. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - TOP_TO_BOTTOM, - /** - * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each - * predecessor of a node v is placed below v and each successor above v. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - BOTTOM_TO_TOP, - /** - * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each - * predecessor of a node v is placed to the left of v and each successor to the right of v. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - LEFT_TO_RIGHT, - /** - * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each - * predecessor of a node v is placed to the right of v and each successor to the left of v. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - RIGHT_TO_LEFT, - /** - * Layout orientation specifier where the algorithm automatically detects the layout orientation. - *

- * The algorithm analyzes the flow direction of fixed edges in the current drawing. If there is no common flow direction, - * the results are the same as for {@link yfiles.partial.LayoutOrientation#NONE}. Otherwise, the layout orientation is either - * {@link yfiles.partial.LayoutOrientation#TOP_TO_BOTTOM}, {@link yfiles.partial.LayoutOrientation#BOTTOM_TO_TOP}, {@link yfiles.partial.LayoutOrientation#LEFT_TO_RIGHT} - * or {@link yfiles.partial.LayoutOrientation#RIGHT_TO_LEFT}. - *

- * @see yfiles.partial.PartialLayout#layoutOrientation - */ - AUTO_DETECT, - /** - * Layout orientation specifier where the layout orientation is completely ignored. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - NONE - } - /** - * This class represents a partial layout algorithm which changes the coordinates for a given set of graph elements (called - * partial elements) only. - *

- * The location and size of the remaining elements (called fixed elements) is not allowed to be changed.Layout Style - *

- *

- * This partial layout algorithm offers a kind of generic partial layout support for other existing layout algorithms. - * Hence, its layout style heavily depends on the selected {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm} as well as the specified {@link yfiles.partial.PartialLayout#edgeRouter edge router} or - * {@link yfiles.partial.PartialLayout#edgeRoutingStrategy edge routing strategy}. - *

- *

- * The partial layout is suitable for applications where users may incrementally add new elements to an existing drawing. - * The added elements should be arranged so that they fit best possible into the given diagram without making any changes - * to the already existing layout. Hence, the so-called mental map of the existing drawing is preserved. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1},"n":[[49.74,127.62,295.26,342.38,2,[[49.74,150,295.26,22.38,"Group"]]],[270,425,[[291.33,449.35,17.35,18.7,"16"]]],[270,375,[[291.33,399.35,17.35,18.7,"18"]]],[200,375,[[221.33,399.35,17.35,18.7,"19"]]],[64.74,405.17,1,[[86.07,429.52,17.35,18.7,"13"]]],[200,265,[[221.33,289.35,17.35,18.7,"20"]]],[100,215,[[124.66,239.35,10.67,18.7,"2"]]],[100,165,[[124.66,189.35,10.67,18.7,"3"]]],[100,265,[[121.33,289.35,17.35,18.7,"22"]]],[-420.63,317.87,375.21,302.93,3,[[-420.63,340.25,375.21,22.38,"Group"]]],[-179.98,534.8,1,[[-155.31,559.15,10.67,18.7,"6"]]],[-163.42,363.25,1,[[-142.09,387.6,17.35,18.7,"12"]]],[-371.63,364.65,1,[[-346.96,389,10.67,18.7,"8"]]],[-333.29,532.76,1,[[-308.62,557.11,10.67,18.7,"9"]]],[-176.17,453.25,1,[[-154.84,477.6,17.35,18.7,"11"]]],[370,215,[[394.66,239.35,10.67,18.7,"1"]]],[370,165,[[394.66,189.35,10.67,18.7,"4"]]],[-130.4,215,1,[[-105.74,239.35,10.67,18.7,"5"]]],[-224.19,264.44,1,[[-199.52,288.79,10.67,18.7,"7"]]],[370,425,[[391.33,449.35,17.35,18.7,"10"]]],[370,265,[[391.33,289.35,17.35,18.7,"14"]]],[370,375,[[391.33,399.35,17.35,18.7,"15"]]],[270,505,[[291.33,529.35,17.35,18.7,"17"]]],[440,165,[[461.33,189.35,17.35,18.7,"21"]]]],"e":[[13,12,0,-15,0,15],[13,14],[10,13,-30,4,0,0],[14,11],[6,7,0,-15,0,15],[5,8,-30,0,30,0],[1,2,0,-15,0,15],[2,3,-30,0,30,0],[4,3],[15,6,-30,0,30,0],[15,16,0,-15,0,15],[7,16,30,0,-30,0],[6,17],[17,18],[18,12],[10,19],[15,20,0,15,0,-15],[19,21,0,-15,0,15],[21,20,0,-15,0,15],[19,1,-30,0,30,0],[1,22,0,15,0,-15],[20,5,-30,0,30,0],[16,23,30,0,-30,0],[11,4,-30,0,0,0]],"vp":[-421.0,127.0,921.0,494.0]}} The input graph where marked nodes denote the partial elements that were incrementally added to the existing diagram. {@graph {"ann":{"s":[60,30],"d":1},"n":[[67.37,127.62,260,342.38,2,[[67.37,150,260,22.38,"Group"]]],[252.37,425,[[273.7,449.35,17.35,18.7,"16"]]],[252.37,375,[[273.7,399.35,17.35,18.7,"18"]]],[182.37,375,[[203.7,399.35,17.35,18.7,"19"]]],[182.37,321,1,[[203.7,345.35,17.35,18.7,"13"]]],[182.37,265,[[203.7,289.35,17.35,18.7,"20"]]],[82.37,215,[[107.03,239.35,10.67,18.7,"2"]]],[82.37,165,[[107.03,189.35,10.67,18.7,"3"]]],[82.37,265,[[103.7,289.35,17.35,18.7,"22"]]],[-147.05,387.62,180,185.56,3,[[-147.05,410,180,22.38,"Group"]]],[-42.05,425,1,[[-17.38,449.35,10.67,18.7,"6"]]],[-42.05,474.19,1,[[-20.72,498.54,17.35,18.7,"12"]]],[-132.05,425,1,[[-107.38,449.35,10.67,18.7,"8"]]],[-132.05,474.19,1,[[-107.38,498.54,10.67,18.7,"9"]]],[-42.05,528.19,1,[[-20.72,552.54,17.35,18.7,"11"]]],[352.37,215,[[377.03,239.35,10.67,18.7,"1"]]],[352.37,165,[[377.03,189.35,10.67,18.7,"4"]]],[-13.63,215,1,[[11.03,239.35,10.67,18.7,"5"]]],[-13.63,265,1,[[11.03,289.35,10.67,18.7,"7"]]],[352.37,425,[[373.7,449.35,17.35,18.7,"10"]]],[352.37,265,[[373.7,289.35,17.35,18.7,"14"]]],[352.37,375,[[373.7,399.35,17.35,18.7,"15"]]],[252.37,505,[[273.7,529.35,17.35,18.7,"17"]]],[422.37,165,[[443.7,189.35,17.35,18.7,"21"]]]],"e":[[13,12,0,-15,0,15],[13,14,0,15,-30,0,[-102.05,543.19]],[10,13,-30,0,30,0,[-54.55,440,-54.55,489.19]],[14,11,0,-15,0,15],[6,7,0,-15,0,15],[5,8,-30,0,30,0],[1,2,0,-15,0,15],[2,3,-30,0,30,0],[4,3,0,15,0,-15],[15,6,-30,0,30,0],[15,16,0,-15,0,15],[7,16,30,0,-30,0],[6,17,-30,0,30,0],[17,18,0,15,0,-15],[18,12,-30,0,0,-15,[-102.05,280]],[10,19,30,0,0,15,[27.95,440,27.95,474,382.37,474]],[15,20,0,15,0,-15],[19,21,0,-15,0,15],[21,20,0,-15,0,15],[19,1,-30,0,30,0],[1,22,0,15,0,-15],[20,5,-30,0,30,0],[16,23,30,0,-30,0],[11,4,30,5.2,-30,0,[119.87,494.39,119.87,336]]],"vp":[-148.0,127.0,631.0,447.0]}} - * The result of a partial layout run with {@link yfiles.partial.PartialLayout#componentAssignmentStrategy component assignment strategy} set to {@link yfiles.partial.ComponentAssignmentStrategy#SINGLE} - * and with {@link yfiles.partial.PartialLayout#considerNodeAlignment node alignment} enabled.Features - *

- *

- * Similar to the layout style, the supported feature set mainly depends on the features supported by the specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm} - * as well as the specified {@link yfiles.partial.PartialLayout#edgeRouter edge router} or {@link yfiles.partial.PartialLayout#edgeRoutingStrategy edge routing strategy}. The internal step that {@link yfiles.partial.PartialLayout#placeSubgraphs places the components} can handle - * group nodes as well as minimum distance constraints. Furthermore, it is able to consider node labels. - *

- *

- * Concept The layout algorithm tries to place the partial elements such that the resulting drawing (including the fixed elements) - * has a good quality with respect to common graph drawing aesthetics. - *

- *

- * The layout algorithm handles each selected graph element as partial element. For this, it looks up the {@link yfiles.algorithms.IDataProvider} - * keys {@link yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY} and {@link yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY}. Partial - * node elements can be assigned to the so-called subgraph components. During the layout process each subgraph induced by the nodes of a - * component is first laid out using the specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm}. Then, the different components are placed - * one-by-one onto the drawing area such that the number of overlaps among graph elements is small. The user can specify - * different objectives for finding 'good' positions for subgraph components (see {@link yfiles.partial.PartialLayout#subgraphPlacement}), e.g., {@link yfiles.partial.SubgraphPlacement#BARYCENTER} - * specifies that the component should be placed close to the barycenter of its graph neighbors and {@link yfiles.partial.SubgraphPlacement#FROM_SKETCH} - * specifies that the component should be placed close to its original position. - *

- *

- * Method {@link yfiles.partial.PartialLayout#componentAssignmentStrategy} allows to specify the strategy that assigns partial nodes to subgraph components. Possible values are - * {@link yfiles.partial.ComponentAssignmentStrategy#CLUSTERING}, {@link yfiles.partial.ComponentAssignmentStrategy#CONNECTED}, {@link yfiles.partial.ComponentAssignmentStrategy#SINGLE} - * and - * {@link yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED}. The last value allows to use a customized component assignment. - * Note that nodes of a component cannot be assigned to different group nodes. - *

- *

- * Furthermore, the user can specify the edge routing strategy (see {@link yfiles.partial.PartialLayout#edgeRoutingStrategy}) that is used for routing partial edges and edges - * between different subgraph components (so-called inter-edges). Possible values are {@link yfiles.partial.EdgeRoutingStrategy#ORGANIC}, - * {@link yfiles.partial.EdgeRoutingStrategy#ORTHOGONAL}, {@link yfiles.partial.EdgeRoutingStrategy#STRAIGHTLINE}, {@link yfiles.partial.EdgeRoutingStrategy#OCTILINEAR} - * and {@link yfiles.partial.EdgeRoutingStrategy#AUTOMATIC}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PartialLayout extends yfiles.layout.LayoutStageBase{} - export class PartialLayout { - /** - * Creates a new instance of {@link yfiles.partial.PartialLayout} which uses the specified {@link yfiles.layout.ILayoutAlgorithm} instance - * as the core layout algorithm. - *

- * This instance is applied to each subgraph component, see {@link yfiles.partial.PartialLayout#componentAssignmentStrategy}. - *

- * @param [subgraphLayouter=null] the layout algorithm that is applied to the subgraph components - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - constructor(subgraphLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * This method is called each time when edges are routed with an edge router. - *

- * Subclasses may modify the configuration of the given edge router instance. - *

- *

- * The type of the given instance depends on the edge routing strategy, i.e., if the routing strategy is set to {@link yfiles.partial.EdgeRoutingStrategy#OCTILINEAR} - * or {@link yfiles.partial.EdgeRoutingStrategy#ORTHOGONAL} it's an instance of {@link yfiles.router.EdgeRouter}, if the routing strategy - * is set to {@link yfiles.partial.EdgeRoutingStrategy#ORGANIC} it's an instance of {@link yfiles.organic.OrganicLayout}, and, if the - * routing strategy is set to {@link yfiles.partial.EdgeRoutingStrategy#STRAIGHTLINE} it's an instance of a private - * {@link yfiles.router.StraightLineEdgeRouter}. If the edge routing strategy is set to - * {@link yfiles.partial.EdgeRoutingStrategy#AUTOMATIC}, the layout algorithm chooses one of the above strategies that best fits - * the routing style of the fixed edges. - *

- * @param edgeRouter the instance used for routing the edges - * @see yfiles.partial.PartialLayout#edgeRouter - * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - * @protected - */ - configureEdgeRouter(edgeRouter:yfiles.layout.ILayoutAlgorithm):void; - /** - * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and calculates the layout for the given subgraph component using the - * specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm}. - *

- * It is called once for each subgraph component. - *

- *

- * Subclasses may implement a custom layout strategy or add some additional data. - *

- * @param subGraph the subgraph component - * @protected - */ - layoutSubgraph(subGraph:yfiles.layout.LayoutGraph):void; - /** - * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and places the subgraph components one-by-one onto the drawing area. - *

- * Therefore, it considers the {@link yfiles.partial.PartialLayout#subgraphPlacement specified objective} for finding a suitable position. - *

- *

- * Subclasses may implement a custom placement strategy or add some additional data. However, they must not modify the - * given subgraph component lists. - *

- * @param graph the input graph - * @param subgraphComponents each entry contains a {@link } that induces a subgraph component - * @protected - */ - placeSubgraphs(graph:yfiles.layout.LayoutGraph,subgraphComponents:yfiles.algorithms.NodeList[]):void; - /** - * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and routes all partial edges that connect two fixed elements. - *

- * It either uses a {@link yfiles.partial.PartialLayout#edgeRouter custom edge router} or an internal edge router that produces routes according to the specified - * {@link yfiles.partial.PartialLayout#edgeRoutingStrategy routing strategy}. - *

- *

- * Subclasses may implement a custom routing strategy or add some additional data. - *

- * @param graph the subgraph of the input graph induced by the fixed nodes - * @param partialEdges the {@link list of partial edges} to be routed - * @protected - */ - routeEdgesBetweenFixedElements(graph:yfiles.layout.LayoutGraph,partialEdges:yfiles.algorithms.EdgeList):void; - /** - * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and routes all inter-edges. - *

- * Inter-edges are edges between different subgraph components including edges between fixed and partial elements. For the routing, - * this method uses the edge router instance set with method {@link yfiles.partial.PartialLayout#edgeRouter}. If no edge router was specified by the user, it uses an - * internal edge router with routing strategy {@link yfiles.partial.PartialLayout#edgeRoutingStrategy}. - *

- *

- * Subclasses may implement a custom routing strategy or add some additional data. - *

- * @param graph the relevant subgraph - * @param interEdges the {@link list of inter-edges} to be routed - * @protected - */ - routeInterEdges(graph:yfiles.layout.LayoutGraph,interEdges:yfiles.algorithms.EdgeList):void; - /** - * Data provider key for marking partial nodes - * @see yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying the edges that should be considered to be directed - *

- * If a layout orientation is specified (i.e., {@link yfiles.partial.PartialLayout#layoutOrientation} is not - * {@link yfiles.partial.LayoutOrientation#NONE}), the algorithm tries to route directed edges such that they adhere to that - * orientation. - *

- * @see yfiles.partial.PartialLayout#layoutOrientation - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DIRECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for marking partial edges - * @see yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for obtaining the edges that should be routed by the edge router - * @see yfiles.partial.PartialLayout#edgeRouter - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ROUTE_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for defining custom subgraph components - * @see yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static COMPONENT_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm} instance that is applied to each subgraph component. - *

- * More precisely, during the layout process each subgraph induced by the (partial) nodes of a component (see - * {@link yfiles.partial.PartialLayout#componentAssignmentStrategy}) is first laid out using this instance. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the preferred time limit (in milliseconds) for the layout algorithm. - *

- * The specified value has to be greater than or equal to 0. If the value is 0x7FFFFFFF, the time is not limited. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets whether or not edges between different subgraph components should be routed immediately. - *

- * If this option is enabled, edges are routed during the placement of the subgraph components, i.e., immediately after a - * component is placed, its edges to other already placed components are routed. Otherwise, these edges are routed in a - * separate step after placing all subgraph components. Hence, while enabling this option usually leads to shorter edge - * routes, the placement of subgraph components is less compact. - *

- * @see yfiles.partial.PartialLayout#routeInterEdges - * @see yfiles.partial.PartialLayout#placeSubgraphs - * @type {boolean} - */ - routeInterEdgesImmediately:boolean; - /** - * Gets or sets whether or not a subgraph component may be placed within another subgraph component. - *

- * Enabling this option leads to more compact layout results but requires more runtime. - *

- * @type {boolean} - */ - componentCompaction:boolean; - /** - * Gets or sets whether or not fixed (non-partial) group nodes may be resized. - *

- * Enabling this option may lead to better results if there are fixed group nodes, since there is more space for the - * partial elements. - *

- * @type {boolean} - */ - resizeFixedGroups:boolean; - /** - * Gets or sets the objective used for finding 'good' positions for subgraph components. - * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined positioning strategies - * @type {yfiles.partial.SubgraphPlacement} - */ - subgraphPlacement:yfiles.partial.SubgraphPlacement; - /** - * Gets or sets the minimum distance between two adjacent nodes. - *

- * The specified value has to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets whether or not partial nodes should be aligned. - *

- * If this option is enabled, the algorithm tries to align the center of partial nodes with other nodes. - *

- * @type {boolean} - */ - considerNodeAlignment:boolean; - /** - * Gets or sets the strategy that assigns partial nodes to subgraph components. - *

- * The specified core layouter (see {@link yfiles.partial.PartialLayout#coreLayout}) independently calculates the layout for each such subgraph component. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined assignment strategies. - * @see yfiles.partial.PartialLayout#coreLayout - * @type {yfiles.partial.ComponentAssignmentStrategy} - */ - componentAssignmentStrategy:yfiles.partial.ComponentAssignmentStrategy; - /** - * Gets or sets whether or not a postprocessing step should be applied to reduce the number of directed edges that do not - * comply with the specified layout orientation. - * @see yfiles.partial.PartialLayout#layoutOrientation - * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY - * @type {boolean} - */ - optimizeOrientation:boolean; - /** - * Gets or sets the custom edge router instance that is used for partial edges and edges between different subgraph - * components (so-called inter-edges). - * @see yfiles.partial.PartialLayout#ROUTE_EDGE_DP_KEY - * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - * @type {yfiles.layout.ILayoutAlgorithm} - */ - edgeRouter:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the routing strategy that is used for partial edges and edges between different subgraph components - * (so-called inter-edges). - * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined routing strategies - * @see yfiles.partial.PartialLayout#edgeRouter - * @type {yfiles.partial.EdgeRoutingStrategy} - */ - edgeRoutingStrategy:yfiles.partial.EdgeRoutingStrategy; - /** - * Gets or sets the layout orientation that is considered during the placement of partial elements. - *

- * More precisely, the algorithm tries to place each {@link yfiles.partial.PartialLayout#componentAssignmentStrategy subgraph component} such that each predecessor of a component's node v - * is placed before v and each successor after v with respect to the layout orientation. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation does not match one of the predefined orientations - * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY - * @type {yfiles.partial.LayoutOrientation} - */ - layoutOrientation:yfiles.partial.LayoutOrientation; - /** - * Gets or sets whether or not subgraph components are mirrored to improve the layout quality. - *

- * If enabled, the algorithm checks for each component which of the four possible mirrorings minimizes the edge length. - *

- * @type {boolean} - */ - allowMirroring:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.partial.PartialLayout; - } - /** - * Specifies custom data for the {@link yfiles.partial.PartialLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface PartialLayoutData extends yfiles.layout.LayoutData{} - export class PartialLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes placed by the layout. - * @see yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the collection of edges placed by the layout. - * @see yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the collection of edges that are considered as directed by the layout. - *

- * Only if the {@link yfiles.partial.PartialLayout#layoutOrientation} is not {@link yfiles.partial.LayoutOrientation#NONE} the directedness of edges has an effect. - *

- * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - directedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from partial nodes to an object defining their component assignment. - *

- * All partial nodes associated with the same object are assigned to the same subgraph component. - *

- * @see yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY - * @see yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - * @type {yfiles.layout.ItemMapping.} - */ - componentIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the partition grid layout data. - * @type {yfiles.layout.PartitionGridData} - */ - partitionGridData:yfiles.layout.PartitionGridData; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.partial.PartialLayoutData; - } - }export namespace tree{ - /** - * Encapsulates information bound to a node while the algorithm calculates a layout. - * @class - */ - export interface BalloonLayoutNodeInfo extends yfiles.lang.Object{} - export class BalloonLayoutNodeInfo { - /** - * The upper angle of the subtree wedge rooted at the node. - * @type {number} - */ - upperAngle:number; - /** - * The lower angle of the subtree wedge rooted at the node. - * @type {number} - */ - lowerAngle:number; - /** - * The angle of the gap to the wedge of the previous child node. - * @type {number} - */ - gapAngle:number; - /** - * The distance of the node to its root node. - * @type {number} - */ - dist:number; - /** - * Gets the sum of all wedge angles of the subtree rooted at this node. - * @type {number} - */ - angleSum:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.BalloonLayoutNodeInfo; - } - /** - * A tree layout algorithm that arranges the subtrees of the tree in a balloon-like fashion. - *

- * Layout Style {@link yfiles.tree.BalloonLayout} is designed to arrange directed and undirected tree graphs. Subtrees rooted at a node are - * placed in a radial fashion around their root node. All direct children of one node can be placed on a common circle - * around their parent node (depending on the {@link yfiles.tree.BalloonLayout#childAlignmentPolicy alignment policy}). Therefore, subtrees look like balloons or stars, - * especially if subtrees have similar sizes. The edges of the tree are drawn as straight lines. {@graph {"ann":{"s":[30,30],"d":1,"c":1},"n":[[765.94,466.2],[616.19,1035.44],[858.96,1192.81],[289.45,1092.35],[983.21,685.48],[390.63,1191.59],[1141.69,322.61],[1215.22,473.98],[599.06,923.71],[924.21,1082.3],[291.41,844.85],[1077.22,396.06],[999.14,1284.78],[391.43,1274.01],[324.89,753.04],[236.05,1223.63],[930.33,1330.15],[1013.36,1203.58],[1165.73,539.9],[1084.13,551.52],[612.56,192.18],[1004.03,1061.74],[901.39,675.54],[684.7,152.3],[1022.85,458.01],[190.18,1336.4],[767.32,1282.66],[473.05,1190.8],[684.09,233.13],[385.33,871.88],[1139.17,442.18],[925.13,116.39],[353.13,675.6],[334.78,932.43],[685.33,1291.17],[152.25,1056.81],[427.86,640.81],[1239.04,331.19],[1006.49,764.55],[934.86,198.24],[732.68,1169.96],[1046.6,632.79],[412.14,1021.39],[1266.98,538.13],[716.32,76.19],[1068.06,1329.99],[76.94,1090.32],[792.51,44.73],[576.22,1141.17],[944.59,280.09],[718.72,987.86],[132.38,1277.64],[1007.52,113.83],[318.35,600.87],[686.08,946.6],[0,1060.76],[621.34,1239.22],[684.87,0],[47.38,1167.26],[929.76,34.1],[866.88,1320.91],[425.22,944.01],[1181.1,233.18],[374.69,793.72],[118.75,981.5],[903.65,1002.48],[532.13,493.99],[200.85,981.73],[760.81,183.93],[633.38,1355.17],[1177.35,621.5],[775.83,1364.64],[784.35,1446.63],[1237.23,394.55],[272.59,1334.67],[974.02,603.57],[457.46,831.99],[159.13,1412.75],[260.6,752.11],[1069.67,256.55],[1044.67,310.87],[1121.63,226.96],[1225.82,272.87],[597.56,111.13],[530.37,198.46],[610.06,274.57],[555.63,251.79],[547.23,141.92],[1062.07,709.49],[929.94,748.38],[843.55,104.61],[857.02,162.82],[1295.93,457.26],[193.97,837.29],[246.66,931.74],[206.06,892.47],[214.43,784.65],[979.61,1149.06],[838.99,1066.04],[786.55,1086.86],[172.43,1172.3],[317.44,1231.28],[428.9,1117.65],[872.95,52.59],[984.14,58.85],[987.6,170.17],[521.61,289.78],[410.77,300.73],[412.02,412.1],[523.07,420.56],[465.9,437.92],[389.75,356.66],[464.06,273.7],[553.17,340.51],[472.17,355.73]],"e":[[0,1],[1,2],[1,3],[0,4],[3,5],[0,6],[6,7],[1,8],[2,9],[3,10],[6,11],[2,12],[5,13],[10,14],[3,15],[12,16],[12,17],[7,18],[18,19],[0,20],[9,21],[4,22],[20,23],[11,24],[15,25],[2,26],[5,27],[20,28],[10,29],[7,30],[0,31],[14,32],[10,33],[26,34],[3,35],[32,36],[6,37],[4,38],[31,39],[2,40],[4,41],[3,42],[7,43],[23,44],[12,45],[35,46],[44,47],[1,48],[39,49],[1,50],[25,51],[31,52],[32,53],[1,54],[46,55],[34,56],[44,57],[46,58],[31,59],[2,60],[29,61],[6,62],[10,63],[35,64],[9,65],[0,66],[3,67],[23,68],[34,69],[18,70],[26,71],[71,72],[7,73],[25,74],[4,75],[29,76],[25,77],[10,78],[6,79],[6,80],[6,81],[6,82],[20,83],[20,84],[20,85],[20,86],[20,87],[4,88],[4,89],[31,90],[31,91],[7,92],[10,93],[10,94],[10,95],[10,96],[2,97],[2,98],[2,99],[3,100],[3,101],[3,102],[31,103],[31,104],[31,105],[0,114],[114,106],[114,107],[114,108],[114,109],[114,110],[114,111],[114,112],[114,113]],"vp":[0.0,0.0,1326.0,1477.0]}} Sample balloon-drawing of - * a large tree obtained with default settings {@graph {"ann":{"s":[20,20],"d":1,"c":1},"n":[[302.82,325.51,70,70,[[323.15,369.86,29.35,18.7,"Root"]]],[467.87,433.16,35,35],[555.28,457.63,[[581.09,480.55,27.36,18.7,0.20775573281806076,-0.978180737635551,"Leaf"]]],[539.95,490.69,[[558.57,519.19,27.36,18.7,0.6124052098749311,-0.7905440271851036,"Leaf"]]],[511.78,513.79,[[521.49,544.2,27.36,18.7,0.8952174454926904,-0.4456295830457645,"Leaf"]]],[617.42,438.44,[[645.7,457.5,27.36,18.7,-0.01562900399598557,-0.9998778596579152,"Leaf"]]],[604.25,500.42,[[626.78,526.54,27.36,18.7,0.42067550054279435,-0.9072111789672069,"Leaf"]]],[168.96,426.6,35,35],[122.16,495.14,[[108.91,545.35,27.36,18.7,-0.7471310564613752,-0.6646767518658294,"Leaf"]]],[101.02,465.46,[[72.6,501.56,27.36,18.7,-0.38380727069642384,-0.9234132222144982,"Leaf"]]],[94.89,429.54,[[58.95,446.33,27.36,18.7,0.0558744858236695,-0.9984378006836183,"Leaf"]]],[108.08,558.63,[[104.38,613.01,27.36,18.7,-0.8765491095440469,-0.48131243341257923,"Leaf"]]],[60.74,516.51,[[39.11,560.52,27.36,18.7,-0.5800788870754927,-0.8145603014935467,"Leaf"]]],[472.4,260.75,35,35],[534.73,207.69,[[563.84,210.51,27.36,18.7,-0.7413022827299817,-0.6711713086979497,"Leaf"]]],[555.61,237.55,[[585.94,249.4,27.36,18.7,-0.3757344582282841,-0.9267273692407589,"Leaf"]]],[561.43,273.52,[[588.93,294.02,27.36,18.7,0.06458526120504259,-0.997912192547559,"Leaf"]]],[549.36,144.32,[[576.39,143.07,27.36,18.7,-0.8723155432038684,-0.48894334343044304,"Leaf"]]],[596.34,186.85,[[626.56,194.12,27.36,18.7,-0.5729485100623841,-0.8195913645331399,"Leaf"]]],[316.53,515.88,35,35],[349.51,601,[[356.29,631.15,27.36,18.7,0.9501038773669919,-0.3119336823945245,"Leaf"]]],[313.23,604.36,[[326.48,660.69,27.36,18.7,-0.9912225732921417,-0.1322036693745865,"Leaf"]]],[279.09,591.61,[[271.88,644.75,27.36,18.7,-0.8351387927609661,-0.5500392684397689,"Leaf"]]],[397.33,645.07,[[408.68,675.44,27.36,18.7,0.8566078613378385,-0.5159679950289693,"Leaf"]]],[337.13,664.84,[[339.49,693.76,27.36,18.7,0.9957417304784997,-0.09218680048511825,"Leaf"]]],[52.71,198.2,[[17.59,197.15,27.36,18.7,0.42857629306653433,-0.9035055954565794,"Leaf"]]],[39,260.06,[[3.57,279.73,27.36,18.7,-0.006902939255060647,-0.9999761744309916,"Leaf"]]],[145.3,185.63,[[126.97,158.82,27.36,18.7,0.8990721607310399,-0.43780046801987216,"Leaf"]]],[116.92,208.49,[[85.4,197.66,27.36,18.7,0.6192806018773118,-0.7851697498875478,"Leaf"]]],[101.3,241.41,[[64.86,250.7,27.36,18.7,0.21628395104715628,-0.9763305037329477,"Leaf"]]],[173.56,251.58,35,35],[321.26,36.12,[[318.14,1.56,27.36,18.7,0.9965082870714412,-0.08349391473599899,"Leaf"]]],[260.88,55.36,[[239.7,30.94,27.36,18.7,0.861077857359917,-0.5084731296385823,"Leaf"]]],[378.65,109.85,[[406.52,110,27.36,18.7,-0.8303070560332068,-0.557306192950939,"Leaf"]]],[344.63,96.81,[[366.44,90.16,27.36,18.7,-0.9900311505600138,-0.14084857443657478,"Leaf"]]],[308.31,99.85,[[295.59,69.34,27.36,18.7,0.9527898006751772,-0.30363068970273144,"Leaf"]]],[325.62,170.19,35,35],[620.15,245.57,[[649.55,261.91,27.36,18.7,-0.15959409597274285,-0.9871827209441234,"Leaf"]]],[565.45,550.51,[[579.72,580.47,27.36,18.7,0.7732871466592579,-0.6340559823955481,"Leaf"]]],[36.42,458,[[3.15,484.87,27.36,18.7,-0.1682027041762925,-0.9857524285071697,"Leaf"]]],[91.95,148.45,[[66.13,128.88,27.36,18.7,0.7787908142925284,-0.6272837217508362,"Leaf"]]],[383.99,45.04,[[409.22,41.45,27.36,18.7,-0.933684654259895,-0.3580963088326663,"Leaf"]]],[274.32,656.46,[[277.16,712.35,27.36,18.7,-0.9367740425600954,-0.34993484134280844,"Leaf"]]]],"e":[[0,1,[],[[405.66,401.96,61.37,18.7,0.5213485166954306,-0.8533438487148509,"Root-Edge"]]],[1,2],[1,3],[1,4],[1,5],[1,6],[0,7,[],[[268.23,398.95,61.37,18.7,0.4834440722369951,0.8753752504034548,"Root-Edge"]]],[7,8],[7,9],[7,10],[7,11],[7,12],[0,13,[],[[407.74,322.69,61.37,18.7,-0.4757866709710364,-0.8795607106540735,"Root-Edge"]]],[13,14],[13,15],[13,16],[13,17],[13,18],[0,19,[],[[336.08,439.99,61.37,18.7,0.999759704932882,0.02192104907427582,"Root-Edge"]]],[19,20],[19,21],[19,22],[19,23],[19,24],[0,30,[],[[270.35,318.48,61.37,18.7,-0.5287754007295448,0.8487617896579165,"Root-Edge"]]],[30,29],[30,28],[30,27],[30,26],[30,25],[0,36,[],[[340.26,281.05,61.37,18.7,-0.9995303423338449,-0.030644652942837143,"Root-Edge"]]],[36,35],[36,34],[36,33],[36,32],[36,31],[13,37],[1,38],[7,39],[30,40],[36,41],[19,42]],"vp":[-1.0,0.0,678.0,722.0]}} Sample balloon-drawing featuring interleaved child placement and ray-like - * node labels ConceptThe algorithm executes the following steps: - *

- *
    - *
  1. Select a root node according to the specified {@link yfiles.tree.BalloonLayout#rootNodePolicy root policy}.
  2. - *
  3. Determine the placement of subtrees around the root using a bottom-up recursive approach (starting with leaf nodes).
  4. - *
  5. Assign the actual coordinates of nodes, again using a recursive approach (starting with the root node).
  6. - *
- *

- * Features - *

- *

- * The algorithm features integrated {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling edge labeling} as well as {@link yfiles.tree.BalloonLayout#integratedNodeLabeling node labeling}. Edge labels and node labels are placed - * automatically without generating overlaps with other labels or graph elements. There are different {@link yfiles.tree.BalloonLayout#nodeLabelingPolicy ways} to place node - * labels. Edge labeling will take the settings of {@link yfiles.layout.PreferredPlacementDescriptor} into account. - *

- *

- * Defining a {@link yfiles.tree.BalloonLayout#preferredChildWedge preferred wedge angle} has a great influence on the layout style. Subtrees rooted at a node get a certain - * amount of radial space to be placed around the parent node, such that a preferred angle close to 360 degrees will - * generate drawings where subtrees look like balloons, while an angle close to 180 degrees could be chosen to get drawings - * where subtrees look like semicircles. - *

- *

- * Since it is computationally not very complex, {@link yfiles.tree.BalloonLayout} is very well suited for large tree graphs. It - * performs well even for huge graphs. - *

- *

- * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} - * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. These edges - * will later be reinserted and routed separately. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface BalloonLayout extends yfiles.layout.MultiStageLayout{} - export class BalloonLayout { - /** - * Creates a new {@link yfiles.tree.BalloonLayout} instance with default settings. - */ - constructor(); - /** - * Calculates the wedge angle that has to be reserved for the subtree rooted at the given node scaling the {@link yfiles.tree.BalloonLayoutNodeInfo#dist distance} with - * the given scale factor. - *

- * Given some {@link yfiles.tree.BalloonLayoutNodeInfo#dist distance} the {@link yfiles.tree.BalloonLayoutNodeInfo#upperAngle upper angle} and {@link yfiles.tree.BalloonLayoutNodeInfo#lowerAngle lower angle} of the wedge belonging to the subtree rooted at root will be - * calculated and stored in the {@link yfiles.tree.BalloonLayoutNodeInfo} instance associated with root - * ({@link yfiles.tree.BalloonLayout#getInfo}). - *

- *

- * This method may be overridden to perform a custom wedge angle assignment scheme. The method is called when - * {@link yfiles.tree.BalloonLayout#calculateChildArrangement arranging child nodes}. Large edge labels on the incoming edge to root need to be considered, if {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling integrated edge labeling} - * should still work properly. - *

- * @param root the node for which the wedge angles are calculated - * @param [scaleFactor=1.0] a factor to be applied to the {@link #dist distance} of root - * @returns the sum of the upper and lower wedge angle of the subtree rooted at the given root node - * @see yfiles.tree.BalloonLayout#calculateChildArrangement - * @protected - */ - calculateAngles(root:yfiles.algorithms.Node,scaleFactor?:number):number; - /** - * Calculates a child node arrangement for a given root node of the tree. - *

- * During the arrangement, child nodes of root will be {@link yfiles.tree.BalloonLayout#sortChildNodes sorted}. Furthermore, distances of the child nodes will be chosen - * such that the wedge of the subtree of root fits into the preferred wedge angle, which is either defined via {@link yfiles.tree.BalloonLayout#preferredRootWedge} or {@link yfiles.tree.BalloonLayout#preferredChildWedge}. - * Calculated distances are stored in {@link yfiles.tree.BalloonLayoutNodeInfo#dist}. - *

- *

- * The angle values - upper and lower wedge angle - may also be updated during this process and stored in {@link yfiles.tree.BalloonLayoutNodeInfo#upperAngle} - * and {@link yfiles.tree.BalloonLayoutNodeInfo#lowerAngle}, respectively. To compute the angles of wedges, method {@link yfiles.tree.BalloonLayout#calculateAngles} - * is used. - *

- *

- * This method may be overridden to perform a custom child node arrangement. If support for available features like {@link yfiles.tree.BalloonLayout#interleavedMode interleaving} - * should be maintained, then these features need to be carefully considered during the arrangement. - *

- * @param root the node for whose children to compute an arrangement - * @protected - */ - calculateChildArrangement(root:yfiles.algorithms.Node):void; - /** - * Determines the root node of {@link yfiles.tree.BalloonLayout#graph} according to the chosen {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy}. - *

- * This method may be overridden to implement some other strategy for choosing the root node of the input graph. It is - * called before the rest of the layout process within {@link yfiles.tree.BalloonLayout#applyLayoutCore}. - *

- * @returns the root node of {@link #graph} - * @see yfiles.tree.BalloonLayout#rootNodePolicy - * @protected - */ - determineRoot():yfiles.algorithms.Node; - /** - * Returns the {@link yfiles.tree.BalloonLayoutNodeInfo} object associated with the given node while the layout algorithm is - * active. - *

- * The returned object contains detailed information describing the placement of a node in the layout being computed, e.g., - * a node's distance to its parent or the wedge angle of the subtree rooted at a node. - *

- *

- * Subclasses may want to override this method to realize another node information setup. This method is called throughout - * the algorithm, each time some information associated with a node needs to be retrieved or stored. - *

- * @param node the node whose information object should be retrieved - * @returns the {@link } instance associated to the given node - * @see yfiles.tree.BalloonLayoutNodeInfo - */ - getInfo(node:yfiles.algorithms.Node):yfiles.tree.BalloonLayoutNodeInfo; - /** - * Returns the preferred radial amount (wedge) in degrees that child nodes may in total occupy around the given node. - *

- * The wedge angle controls the degree to which the child nodes may radiate from the center of layout. A value close to 360 - * means that the child nodes may radiate in (almost) any direction from their parent node, edge lengths can in consequence - * stay rather small. On the other hand, a small value means that children are restricted to a small angle; thus, edges - * lengths (and drawings) may become large. - *

- *

- * This method returns the {@link yfiles.tree.BalloonLayout#preferredRootWedge preferred root wedge} if node root was selected as global root node ({@link yfiles.tree.BalloonLayout#rootNodePolicy}). Otherwise, it either - * returns {@link yfiles.tree.BalloonLayout#preferredChildWedge} or if the given node has an outdegree equal to 2, it returns the minimum of {@link yfiles.tree.BalloonLayout#preferredChildWedge} and 180. - *

- *

- * This method may be overridden to provide a custom child wedge function. - *

- * @param root the node to get the preferred wedge angle for - * @returns the preferred wedge angle for root in degrees - * @see yfiles.tree.BalloonLayout#preferredChildWedge - * @see yfiles.tree.BalloonLayout#preferredRootWedge - * @protected - */ - getPreferredChildWedge(root:yfiles.algorithms.Node):number; - /** - * Sorts the child nodes (successors) of the given node. - *

- * This implementation uses the original node coordinates if {@link yfiles.tree.BalloonLayout#fromSketchMode From Sketch mode} is enabled. Otherwise it uses {@link yfiles.tree.BalloonLayout#comparer the specified comparator} - * to sort the outgoing edges and thus the children of root. If there is no such comparator, then the sorting depends on - * whether or not the child nodes are placed in an {@link yfiles.tree.BalloonLayout#interleavedMode interleaved} fashion: - *

- *
    - *
  • Normal: Children are sorted according to the chosen {@link yfiles.tree.BalloonLayout#childOrderingPolicy child ordering policy}.
  • - *
  • - * Interleaved: Children are sorted such that the resulting interleaved node placement is compact, while children inducing - * larger subgraphs are placed next to smaller ones. - *
  • - *
- *

- * This method may be overridden to realize a custom child node ordering. It gets called in method {@link yfiles.tree.BalloonLayout#calculateChildArrangement} - * before coordinates are assigned and just after the wedge sizes for all subtrees rooted at root are determined. - *

- * @param root the node whose child nodes will be sorted - * @protected - */ - sortChildNodes(root:yfiles.algorithms.Node):void; - /** - * Data provider key for marking nodes whose child nodes should be placed in an interleaved fashion - *

- * This {@link yfiles.algorithms.IDataProvider} allows to individually configure the interleaving feature for each node in the - * graph. - *

- * @see yfiles.tree.BalloonLayout#interleavedMode - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static INTERLEAVED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking the node that will be used as root node of the tree - * @see yfiles.tree.BalloonLayout#rootNodePolicy - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * The layout graph being acted upon. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} instance that determines the order of the outgoing edges for each node of the tree. - *

- * If no {@link yfiles.collections.IComparer.} is specified (i.e. the {@link yfiles.collections.IComparer.} is null), the outgoing edges will be sorted according to the current - * {@link yfiles.tree.BalloonLayout#childOrderingPolicy child ordering policy}. - *

- * @see yfiles.tree.BalloonLayout#childOrderingPolicy - * @see yfiles.tree.BalloonLayout#fromSketchMode - * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the child ordering policy for sorting the child nodes around their parents. - *

- * The sorting policy can affect the compactness of drawings. Advantageous orderings allow adjacent subtrees to be close - * together and can thus make the whole layout more compact. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown ordering policy is given - * @see yfiles.tree.BalloonLayout#fromSketchMode - * @see yfiles.tree.BalloonLayout#comparer - * @type {yfiles.tree.ChildOrderingPolicy} - */ - childOrderingPolicy:yfiles.tree.ChildOrderingPolicy; - /** - * Gets or sets the minimum distance to be kept between the nodes in the tree. - *

- * The distance needs to be a non-negative integer value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @see yfiles.tree.BalloonLayout#allowOverlaps - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets whether or not to consider the given coordinates of the input diagram when arranging the tree. - *

- * Enabling this feature, the original circular order of child nodes around their parent nodes will be maintained according - * to the initial coordinates when determining the order of the child nodes. - *

- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Gets or sets the root node selection policy of this layout algorithm. - *

- * The policy determines which node is chosen as (virtual) tree root during the layout process. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown root node policy is given - * @type {yfiles.tree.RootNodePolicy} - */ - rootNodePolicy:yfiles.tree.RootNodePolicy; - /** - * Gets or sets the preferred radial amount (wedge) in degrees that child nodes may in total occupy around their parent - * node. - *

- * The wedge angle controls the degree to which the child nodes may radiate from the center of layout. A value close to 360 - * means that the child nodes may radiate in (almost) any direction from their parent node, edge lengths can in consequence - * stay rather small. On the other hand, a small value means that children are restricted to a small angle; thus, edge - * lengths (and drawings) may become large. - *

- *

- * The minimum allowed wedge angle is 1 and the maximum allowed value is 359. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given angle is smaller than 1 or larger than 359 - * @see yfiles.tree.BalloonLayout#preferredRootWedge - * @type {number} - */ - preferredChildWedge:number; - /** - * Gets or sets the preferred radial amount (wedge) in degrees that child nodes may in total occupy around the global - * root. - *

- * This property allows to separately control the wedge angle for the designated root node of the tree, while {@link yfiles.tree.BalloonLayout#preferredChildWedge} controls the - * angles of all child nodes. The root node will be determined depending on the {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy}. - *

- *

- * The minimum allowed root wedge angle is 1 and the maximum allowed value is 360. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given angle is smaller than 1 or larger than 360 - * @see yfiles.tree.BalloonLayout#preferredChildWedge - * @type {number} - */ - preferredRootWedge:number; - /** - * Gets or sets whether or not (partially) overlapping nodes are allowed. - *

- * If overlaps are allowed, the resulting layouts can become significantly more compact. Overlaps will mostly occur at the - * borders of nodes. Nodes will not be totally covered by other nodes. - *

- * @type {boolean} - */ - allowOverlaps:boolean; - /** - * Gets or sets the factor defining how compact layout results will potentially be, where a smaller factor produces - * potentially more compact layouts. - *

- * The algorithm tries to optimize the child node arrangement around each tree node such that each subtree is as close to - * its root as possible, while still fitting into the {@link yfiles.tree.BalloonLayout#preferredChildWedge preferred wedge angle} and not overlapping with adjacent subtrees. - *

- *

- * High compactness factor values induce the optimization procedure to be less strict and accept less optimal results, - * while low factor values mean that the optimization will only stop when being nearly optimal. Thus, lower values lead to - * a potentially higher runtime. - *

- *

- * The minimum factor value is 0.05 and the maximum is 1.0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the factor is smaller than 0.05 or greater than 1.0 - * @type {number} - */ - compactnessFactor:number; - /** - * Gets or sets the minimum length that this layout algorithm assigns to edges of the graph. - *

- * A lower minimum edge length allows generally more compact layouts. It has the highest effect if most nodes of the graph - * have a low degree, as the minimum can potentially be met for such graphs. - *

- *

- * The minimum length must be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given length is negative - * @type {number} - */ - minimumEdgeLength:number; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels. - *

- * The size of nodes will temporarily be adjusted such that the label is included. Therefore, result drawings may get - * significantly larger if this feature is enabled. - *

- * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets the mode for child node arrangement. - *

- * Child nodes are either placed interleaved or on a single layer around their parent node. Interleaved placement means - * that child nodes are placed around their common parent in two different layers in an alternating fashion. For example, - * the first child is on the inner layer, the second child on the outer layer, the third one again on the inner layer, - * etc. - *

- *

- * Independent of this mode, the alignment of child nodes on the same layer is still defined by the {@link yfiles.tree.BalloonLayout#childAlignmentPolicy alignment policy}. - * However, {@link yfiles.tree.ChildAlignmentPolicy#SMART} is only supported for non-interleaved arrangement. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode for interleaved arrangement is given - * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - * @type {yfiles.tree.InterleavedMode} - */ - interleavedMode:yfiles.tree.InterleavedMode; - /** - * Gets or sets the child alignment policy for this layout algorithm. - *

- * This policy influences the distance of child nodes to their parent nodes and the alignment of children with the same - * parent. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given - * @type {yfiles.tree.ChildAlignmentPolicy} - */ - childAlignmentPolicy:yfiles.tree.ChildAlignmentPolicy; - /** - * Gets or sets whether or not the layout algorithm automatically places node labels. - *

- * If enabled, this layout algorithm will calculate the positions for the node labels assuring that no overlaps occur. - *

- *

- * Different labeling strategies may be selected using {@link yfiles.tree.BalloonLayout#nodeLabelingPolicy}. - *

- * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy - * @type {boolean} - */ - integratedNodeLabeling:boolean; - /** - * Gets or sets whether or not the layout algorithm automatically places edge labels. - *

- * If enabled, this layout algorithm will calculate the positions for the edge labels assuring that no overlaps occur. - *

- * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets the policy defining how node labels are placed by the integrated node labeling mechanism (for example, the - * desired label orientation). - * @throws {Stubs.Exceptions.ArgumentError} if an unknown labeling policy is given - * @see yfiles.tree.BalloonLayout#integratedNodeLabeling - * @type {yfiles.tree.NodeLabelingPolicy} - */ - nodeLabelingPolicy:yfiles.tree.NodeLabelingPolicy; - /** - * Gets or sets the distance between node labels belonging to the same node. - *

- * It also defines the distance between labels and the node they belong to in case of label placement outside of the node - * (e.g. for {@link yfiles.tree.NodeLabelingPolicy#RAY_LIKE ray-like label placement}). - *

- *

- * The spacing must have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing value is negative - * @see yfiles.tree.BalloonLayout#integratedNodeLabeling - * @type {number} - */ - nodeLabelSpacing:number; - /** - * Gets or sets the distance between edge labels belonging to the same edge as well as the distance of the edge labels to - * the target node of the edge. - *

- * The spacing must have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given label spacing value is negative - * @see yfiles.tree.BalloonLayout#integratedEdgeLabeling - * @type {number} - */ - edgeLabelSpacing:number; - /** - * Gets or sets whether or not chains are drawn straight or not. - *

- * A chain is defined as a tree node with exactly one child node. If this feature is enabled, then the incoming edge and - * outgoing edge of the chain will have the same orientation, i.e., the whole chain looks straight. - *

- *

- * Straightening all chains can lead to smoother, more symmetric results. - *

- * @type {boolean} - */ - chainStraighteningMode:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.BalloonLayout; - } - export enum FillStyle{ - /** - * Style specifier which defines that rows/columns are aligned with their leading side. - * @see yfiles.tree.AspectRatioNodePlacer#fillStyle - */ - LEADING, - /** - * Style specifier which defines that rows/columns are aligned with their center. - * @see yfiles.tree.AspectRatioNodePlacer#fillStyle - */ - CENTERED, - /** - * Style specifier which defines that rows/columns are justified to have the same width/height. - * @see yfiles.tree.AspectRatioNodePlacer#fillStyle - */ - JUSTIFY, - /** - * Style specifier which defines that rows/columns are aligned with their trailing side. - * @see yfiles.tree.AspectRatioNodePlacer#fillStyle - */ - TRAILING - } - export enum RootPlacement{ - /** - * A root placement specifier for placing the root centered above its subtree, depending on the actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. - * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - */ - TOP, - /** - * A root placement specifier for placing the root in the upper left corner of the subtree bounds with respect to the - * actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. - *

- * Whether the root is placed entirely beside the subtree with no horizontal overlaps or entirely above the subtree without - * vertical overlaps will be determined by the layout of the subtree. The layout algorithm tries to minimize the bounds of - * the subtree. - *

- * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - * @see yfiles.tree.RootPlacement#CORNER_TOP - * @see yfiles.tree.RootPlacement#CORNER_SIDE - */ - CORNER, - /** - * A root placement specifier for placing the root in the upper left corner of the subtree bounds with respect to the - * actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. - *

- * The root is placed entirely beside the subtree with no horizontal overlaps. This might by important if the root's height - * is very large while its width is small. - *

- * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - */ - CORNER_SIDE, - /** - * A root placement specifier for placing the root of a subtree in the upper left corner of the subtree bounds with respect - * to the actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. - *

- * The root is placed entirely above the subtree with no vertical overlaps. This might by important if the root's width is - * very large while its height is small. - *

- * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - */ - CORNER_TOP - } - export enum SubtreeArrangement{ - /** - * A direction specifier for placing the child nodes next to each other in direction of the actual - * {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}, with the edges connecting in the direction of flow. - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY - */ - HORIZONTAL, - /** - * A direction specifier for placing the child nodes above each other in direction of the actual - * {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}, with the edges connecting orthogonally to the direction of flow. - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY - */ - VERTICAL - } - export enum InterleavedMode{ - /** - * A child placement mode where all child nodes are placed around their parent with equal distances. - * @see yfiles.tree.BalloonLayout#interleavedMode - */ - OFF, - /** - * A child placement mode where nodes are placed in an interleaved fashion, that is, with two different, alternating - * distances to the parent node. - * @see yfiles.tree.BalloonLayout#interleavedMode - */ - ALL_NODES, - /** - * A child placement mode where child nodes of selected nodes are placed in an interleaved fashion, that is, with two - * different, alternating distances to the parent node. - *

- * All other nodes are placed without interleaving. The node selection can be specified by registering an appropriate {@link yfiles.algorithms.IDataProvider} - * for key {@link yfiles.tree.BalloonLayout#INTERLEAVED_NODES_DP_KEY}. - *

- * @see yfiles.tree.BalloonLayout#interleavedMode - */ - MARKED_NODES - } - export enum NodeLabelingPolicy{ - /** - * Node labeling policy for ray-like label placement at nodes with zero or one child node. - *

- * Labels belonging to leaf nodes and nodes with exactly one successor (thus forming a sort of chain) will not be oriented - * horizontal but ray-like; they get the same orientation as their nodes' incoming edge. The labels of the other nodes will - * be oriented horizontally and placed at the center of the corresponding node. - *

- * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy - */ - RAY_LIKE, - /** - * Node labeling policy for ray-like label placement at leaf nodes. - *

- * Labels corresponding to leaf nodes get the same orientation as their nodes' incoming edge and are placed outside the - * node (without overlaps). The labels of the other nodes will be oriented horizontally and placed at the center of the - * corresponding node. - *

- * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy - */ - RAY_LIKE_LEAVES, - /** - * Node labeling policy for horizontal label placement at all nodes. - *

- * The node labels are placed at the center of the corresponding node. - *

- * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy - */ - HORIZONTAL - } - export enum ChildAlignmentPolicy{ - /** - * Alignment policy to align child nodes rooted at the same parent such that the border of their convex hull has the same - * distance to the parent node's center. - * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - */ - PLAIN, - /** - * Alignment policy to align child nodes rooted at the same parent such that each child has the same center-to-center - * distance to the parent node. - *

- * All nodes will be placed on a common radius around their parent, respective to their center coordinates. - *

- * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - */ - SAME_CENTER, - /** - * Alignment policy for aligning child nodes such that the distances to their parent are kept short and drawings can - * potentially become more compact. - *

- * This policy realizes the exact same child alignment as {@link yfiles.tree.ChildAlignmentPolicy#PLAIN} if there are no edge - * labels associated with edges going to child nodes or if {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling integrated edge labeling} is disabled. - *

- *

- * If edge labels need to be considered, edge labels will be added to the convex hull of the child node to which the edge - * connects. This means that child nodes connected with a labeled edge will be aligned at the border where the edge label - * begins. In consequence, edge labels will be aligned with neighboring edge labels as well as neighboring child nodes if a - * child node has no edge label at its incoming edge. - *

- *

- * This alignment strategy is especially effective if large edge labels need to be considered while drawings should still - * be compact and distances from parent to child nodes short. - *

- * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - */ - COMPACT, - /** - * Alignment policy to align child nodes rooted at the same parent using a mixture of the other policies and aiming to - * achieve symmetry and compactness at the same time. - *

- * Similar to - * {@link yfiles.tree.ChildAlignmentPolicy#SAME_CENTER}, this policy aims to achieve alignments featuring equal distances between - * parent and child node centers. However, a much larger distance for all child nodes caused by single large subtrees is - * avoided by this policy. In such cases, the smaller subtrees may be placed on a common radius and the large subtrees are - * placed with different distances. - *

- * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - */ - SMART - } - export enum ChildOrderingPolicy{ - /** - * Child ordering policy which orders child nodes depending on their subtree size such that large subtrees are placed next - * to small ones in order to save space. - *

- * The actual area of a subtree is used as the subtree size. The smallest subtree is placed next to the largest subtree, - * followed by the second smallest subtree and so on. This way, drawings can become more compact, because the adjacent - * placement of large subtrees is avoided (which would require edges to become longer for subtrees to fit next to each - * other). - *

- * @see yfiles.tree.BalloonLayout#childOrderingPolicy - */ - COMPACT, - /** - * Child ordering policy which sorts the child nodes according to their wedge angles. - *

- * The node with the greatest angle gets median position in the sorting order. The smaller the wedges, the farther away a - * node will be placed from the median position. Using this policy, the produced results are often more symmetric. - *

- * @see yfiles.tree.BalloonLayout#childOrderingPolicy - */ - SYMMETRIC - } - export enum RootNodePolicy{ - /** - * Root node policy for choosing a node with indegree 0 as root node of the tree. - *

- * The selection of the root node will happen according to {@link yfiles.algorithms.Trees#getRoot}. - *

- * @see yfiles.tree.BalloonLayout#rootNodePolicy - * @see yfiles.algorithms.Trees#getRoot - */ - DIRECTED_ROOT, - /** - * Root node policy for choosing the center node as root node of the tree. - *

- * A {@link yfiles.algorithms.Trees#getCenterRoot center node} induces a minimum depth tree when being used as the root of that tree. - *

- * @see yfiles.tree.BalloonLayout#rootNodePolicy - * @see yfiles.algorithms.Trees#getCenterRoot - */ - CENTER_ROOT, - /** - * Root node policy for choosing a weighted center node as root node of the tree. - *

- * A {@link yfiles.algorithms.Trees#getWeightedCenterNode weighted center node} is a node which is part of the greatest number of all undirected paths in a graph. - *

- * @see yfiles.tree.BalloonLayout#rootNodePolicy - */ - WEIGHTED_CENTER_ROOT, - /** - * Root node policy for choosing a custom node as the root node of the tree. - *

- * The root node is specified using a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.tree.BalloonLayout#SELECTED_ROOT_DP_KEY}. - *

- * @see yfiles.tree.BalloonLayout#rootNodePolicy - */ - SELECTED_ROOT - } - export enum ChildPlacement{ - /** - * Placement specifier which defines that subtrees are placed one below the other and left of the root node. - * @see yfiles.tree.DefaultNodePlacer#childPlacement - */ - VERTICAL_TO_LEFT, - /** - * Placement specifier which defines that subtrees are placed one below the other and right of the root node. - * @see yfiles.tree.DefaultNodePlacer#childPlacement - */ - VERTICAL_TO_RIGHT, - /** - * Placement specifier which defines that subtrees are placed horizontally next to each other and above the root node. - * @see yfiles.tree.DefaultNodePlacer#childPlacement - */ - HORIZONTAL_UPWARD, - /** - * Placement specifier which defines that subtrees are placed horizontally next to each other and below the root node. - * @see yfiles.tree.DefaultNodePlacer#childPlacement - */ - HORIZONTAL_DOWNWARD - } - export enum RootAlignment{ - /** - * Alignment specifier which defines that the root node is placed ahead of all its child subtrees. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed ahead (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) of the combined bounding box of all subtrees without labels. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - LEADING_OFFSET, - /** - * Alignment specifier which defines that the root node is placed aligned with its first subtree. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed aligned with the bounding box of its first (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) subtree. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - LEADING, - /** - * Alignment specifier which defines that the root node is placed aligned with the center of its subtrees. - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - CENTER, - /** - * Alignment specifier which defines that the root node is placed at the median of the connection points to its subtrees. - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - MEDIAN, - /** - * Alignment specifier which defines that the root node is placed aligned with its last subtree. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed aligned with the bounding box of its last (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) subtree. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - TRAILING, - /** - * Alignment specifier which defines that the root is placed after all its subtree. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed after (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) of the combined bounding box of all subtrees without labels. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - TRAILING_OFFSET, - /** - * Alignment specifier which defines that the root is placed after all its subtrees, centered on the bus. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed after (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) of the combined bounding box of all subtrees without labels. The - * bus leaves directly from the root node. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - TRAILING_ON_BUS, - /** - * Alignment specifier which defines that the root is placed ahead of all its subtrees, centered on the bus. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed ahead (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) of the combined bounding box of all subtrees without labels. The - * bus leaves directly from the root node. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - LEADING_ON_BUS - } - export enum RoutingStyle{ - /** - * Routing style specifier which defines that edge paths are routed orthogonally with the bends located in the channel - * between the root node and the child nodes. - * @see yfiles.tree.DefaultNodePlacer#routingStyle - */ - FORK, - /** - * Routing style specifier which defines that edge paths are routed orthogonally with just one bend. - *

- * Edges will leave the root node at its sides and bend exactly above the according child node. If the child node is placed - * directly below the root node, the edge will bend inside of the root node and leave it at the bottom. - *

- * @see yfiles.tree.DefaultNodePlacer#routingStyle - */ - FORK_AT_ROOT, - /** - * Routing style specifier which defines that edge paths are routed with a straight segment to the center of the child - * nodes. - * @see yfiles.tree.DefaultNodePlacer#routingStyle - */ - STRAIGHT, - /** - * Routing style constant which defines that edge paths are routed with a straight segment to the connector of the {@link yfiles.tree.SubtreeShape} - * of the child nodes. - * @see yfiles.tree.DefaultNodePlacer#routingStyle - */ - POLYLINE - } - export enum PortAssignmentMode{ - /** - * A port assignment specifier that defines that - * {@link yfiles.layout.PortConstraint}s are considered. Ports are placed using the following rules: - *
    - *
  • edges without a {@link yfiles.layout.PortConstraint} are anchored at the center of the node
  • - *
  • edges with a weak {@link yfiles.layout.PortConstraint} are anchored at the center of their specified side
  • - *
  • edges with a strong {@link yfiles.layout.PortConstraint} are anchored at their initial coordinates
  • - *
- *

- * If edges with - * {@link yfiles.layout.PortConstraint}s are grouped, all edges in the same group will use the port coordinates of the first edge - * in the group. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - PORT_CONSTRAINT, - /** - * A port assignment specifier which defines that edges are distributed evenly at the northern side of their nodes. - *

- * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the - * distribution. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED_NORTH, - /** - * A port assignment specifier which defines that edges are distributed evenly at the southern side of their nodes. - *

- * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the - * distribution. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED_SOUTH, - /** - * A port assignment specifier which defines that edges are distributed evenly at the eastern side of their nodes. - *

- * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the - * distribution. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED_EAST, - /** - * A port assignment specifier which defines that edges are distributed evenly at the western side of their nodes. - *

- * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the - * distribution. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED_WEST, - /** - * A port assignment specifier which defines that all ports are reset to the center of their nodes. - */ - NONE - } - export enum ConnectorDirection{ - /** - * A direction constant that describes that the last connector segment points up. The edge from the parent will connect to - * the north of the {@link yfiles.tree.SubtreeShape}. - * @see yfiles.tree.SubtreeShape#connectorDirection - */ - NORTH, - /** - * A direction constant that describes that the last connector segment points to the right. The edge from the parent will - * connect to the east of the {@link yfiles.tree.SubtreeShape}. - * @see yfiles.tree.SubtreeShape#connectorDirection - */ - EAST, - /** - * A direction constant that describes that the last connector segment points down. The edge from the parent will connect - * to the south of the {@link yfiles.tree.SubtreeShape}. - * @see yfiles.tree.SubtreeShape#connectorDirection - */ - SOUTH, - /** - * A direction constant that describes that the last connector segment points to the left. The edge from the parent will - * connect to the west of the {@link yfiles.tree.SubtreeShape}. - * @see yfiles.tree.SubtreeShape#connectorDirection - */ - WEST - } - export enum BorderLineSide{ - /** - * Side constant that defines the index of the northern border line. - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - NORTH, - /** - * Side constant that defines the index of the eastern border line. - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - EAST, - /** - * Side constant that defines the index of the southern border line. - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - SOUTH, - /** - * Side constant that defines the index of the western border line. - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - WEST - } - export enum LayeredRoutingStyle{ - /** - * Routing style specifier which defines that edges consist of one straight segment. - * @see yfiles.tree.LayeredNodePlacer#routingStyle - */ - STRAIGHT, - /** - * Routing style specifier which defines that edges are routed in an orthogonal, bus-like fashion. - * @see yfiles.tree.LayeredNodePlacer#routingStyle - */ - ORTHOGONAL - } - export enum MultiParentRoutingStyle{ - /** - * Routing style for routing non-shared edge segments in a polyline fashion. - *

- * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. - * This style only applies to the part of the edges where they split to connect to different multi-parents. - *

- * @see yfiles.tree.MultiParentDescriptor#edgeStyle - */ - POLYLINE, - /** - * Routing style for routing non-shared edge segments in an orthogonal fashion. - *

- * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. - * This style only applies to the part of the edges where they split to connect to different multi-parents. - *

- * @see yfiles.tree.MultiParentDescriptor#edgeStyle - */ - ORTHOGONAL, - /** - * Routing style for routing non-shared edge segments straight. This style will route the part of the edges that doesn't - * share the same path directly from the center of the multi-parent to the common point of the edges in the multi-parent - * structure. - *

- * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. - * This style only applies to the part of the edges where they split to connect to different multi-parents. - *

- * @see yfiles.tree.MultiParentDescriptor#edgeStyle - */ - STRAIGHT - } - export enum ParentConnectorDirection{ - /** - * Direction specifier which indicates that no connector should be calculated. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - NONE, - /** - * Direction specifier which indicates that any direction can be used for the connector to the parent node. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - ANY, - /** - * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended - * by a segment that goes north. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - NORTH, - /** - * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended - * by a segment that goes east. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - EAST, - /** - * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended - * by a segment that goes south. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - SOUTH, - /** - * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended - * by a segment that goes west. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - WEST - } - export enum PortStyle{ - /** - * A constant defining that ports are placed at the center of the nodes. - *

- * This constant uses (0,0) as port offset. - *

- * @see yfiles.tree.ClassicTreeLayout#portStyle - */ - NODE_CENTER, - /** - * A constant defining that ports are placed at the center of the border of the nodes. - * @see yfiles.tree.ClassicTreeLayout#portStyle - */ - BORDER_CENTER, - /** - * A constant defining that ports are evenly distributed along the border of the nodes. - * @see yfiles.tree.ClassicTreeLayout#portStyle - */ - BORDER_DISTRIBUTED, - /** - * A constant defining that ports are assigned based on given {@link yfiles.layout.PortConstraint port constraints}. - * @see yfiles.tree.ClassicTreeLayout#portStyle - */ - PORT_CONSTRAINTS_AWARE - } - export enum EdgeRoutingStyle{ - /** - * A constant for routing the edges as straight-line segments. - * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle - */ - PLAIN, - /** - * A constant for routing the edges orthogonally in a bus-like fashion. - * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle - */ - ORTHOGONAL - } - export enum LeafPlacement{ - /** - * A policy for placing the leaf nodes in a stack-like fashion with balanced stack heights. - *

- * In this context, a stack-like fashion means that leaf nodes that connect to the same parent node are placed one upon the - * other, resulting in horizontally compact layouts. - *

- *

- * This policy tries to balance stack heights, i.e., for each subtree that consists only of leaf nodes, {@link yfiles.tree.LeafPlacement#LEAVES_STACKED_RIGHT} - * or {@link yfiles.tree.LeafPlacement#LEAVES_STACKED_LEFT_AND_RIGHT} will be used depending on the number of leaves in the - * subtree. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - LEAVES_STACKED, - /** - * A policy for placing the leaf nodes in a stack-like fashion using a single stack left. - *

- * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the - * other, resulting in horizontally compact layouts. - *

- *

- * This policy uses a single stack that lies to the left relative to the center of the parent node. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - LEAVES_STACKED_LEFT, - /** - * A policy for placing the leaf nodes in a stack-like fashion using a single stack right. - *

- * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the - * other, resulting in horizontally compact layouts. - *

- *

- * This policy uses a single stack that lies to the right relative to the center of the parent node. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - LEAVES_STACKED_RIGHT, - /** - * A policy for placing the leaf nodes in a stack-like fashion using two stacks. - *

- * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the - * other, resulting in horizontally compact layouts. - *

- *

- * This policy distributes leaf nodes among two stacks, one to the left and one to the right relative to the center of the - * parent node. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - LEAVES_STACKED_LEFT_AND_RIGHT, - /** - * A policy for placing the leaf nodes in a Dendrogram-like fashion. - *

- * According to this policy, all leaf nodes are placed in one layer (i.e. all leaves are placed on one horizontal line in a - * top-to-bottom or in a bottom-to-top layout). - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - ALL_LEAVES_ON_SAME_LAYER, - /** - * A policy for placing the leaf nodes with the same parent in the same layer. - *

- * For example, siblings are being placed on a horizontal line in a top-to-bottom or in a bottom-to-top layout. - *

- *

- * This policy produces vertically compact layouts. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - SIBLINGS_ON_SAME_LAYER - } - /** - * This {@link yfiles.tree.INodePlacer} places the subtrees such that the overall aspect ratio of the arranged subtree will be - * close to a preferred aspect ratio. - *

- * Layout Style The aspect ratio describes the relation between width and height of the subtree. To achieve the desired aspect ratio, - * this {@link yfiles.tree.INodePlacer} divides the child {@link yfiles.tree.SubtreeShape}s into as much rows as needed. The edges are - * either routed along the rows or along the columns. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[280,70],[70,140],[140,140],[210,140],[280,140],[70,210],[140,210],[210,210],[280,210],[70,280],[140,280],[210,280],[280,280]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[260,15,260,85]],[0,5,[50,15,50,155]],[0,6,[120,15,120,155]],[0,7,[190,15,190,155]],[0,8,[260,15,260,155]],[0,9,[50,15,50,225]],[0,10,[120,15,120,225]],[0,11,[190,15,190,225]],[0,12,[260,15,260,225]],[0,13,[50,15,50,295]],[0,14,[120,15,120,295]],[0,15,[190,15,190,295]],[0,16,[260,15,260,295]]],"vp":[0.0,0.0,310.0,310.0]}} - *

- *

- * Aspect ratio 1 - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[70,140],[140,140],[210,140],[70,210],[140,210],[210,210],[70,280],[140,280],[210,280],[70,350],[140,350],[210,350],[70,420]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[50,15,50,155]],[0,5,[120,15,120,155]],[0,6,[190,15,190,155]],[0,7,[50,15,50,225]],[0,8,[120,15,120,225]],[0,9,[190,15,190,225]],[0,10,[50,15,50,295]],[0,11,[120,15,120,295]],[0,12,[190,15,190,295]],[0,13,[50,15,50,365]],[0,14,[120,15,120,365]],[0,15,[190,15,190,365]],[0,16,[50,15,50,435]]],"vp":[0.0,0.0,240.0,450.0]}} - *

- *

- * Aspect ratio 0.5 - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[280,70],[350,70],[420,70],[490,70],[560,70],[70,140],[140,140],[210,140],[280,140],[350,140],[420,140],[490,140],[560,140]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[260,15,260,85]],[0,5,[330,15,330,85]],[0,6,[400,15,400,85]],[0,7,[470,15,470,85]],[0,8,[540,15,540,85]],[0,9,[50,15,50,155]],[0,10,[120,15,120,155]],[0,11,[190,15,190,155]],[0,12,[260,15,260,155]],[0,13,[330,15,330,155]],[0,14,[400,15,400,155]],[0,15,[470,15,470,155]],[0,16,[540,15,540,155]]],"vp":[0.0,0.0,590.0,170.0]}} - *

- *

- * Aspect ratio 2 - *

- * @class - * @extends {yfiles.tree.NodePlacerBase} - * @implements {yfiles.tree.IFromSketchNodePlacer} - */ - export interface AspectRatioNodePlacer extends yfiles.tree.NodePlacerBase,yfiles.tree.IFromSketchNodePlacer{} - export class AspectRatioNodePlacer { - /** - * Creates a new instance of {@link yfiles.tree.AspectRatioNodePlacer} with default settings. - */ - constructor(); - /** - * Creates an {@link yfiles.collections.IComparer. edge comparator} which takes the initial coordinates of the nodes into account. - *

- * This {@link yfiles.collections.IComparer.} defines the order of the outgoing edges of a node before the actual placement of the node's subtree is calculated. - * It also considers whether or not the rows are placed {@link yfiles.tree.AspectRatioNodePlacer#horizontal horiontally}. - *

- * @returns the {@link } for the edges - */ - createFromSketchComparer():yfiles.collections.IComparer; - /** - * Gets or sets whether child nodes are distributed in horizontal rows or vertical columns. - * @type {boolean} - */ - horizontal:boolean; - /** - * Gets or sets the vertical distance between the {@link yfiles.tree.SubtreeShape}s. - *

- * The nodes will be placed below each other, keeping this distance. - *

- *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - verticalDistance:number; - /** - * Gets or sets the horizontal distance between the {@link yfiles.tree.SubtreeShape}s. - *

- * The nodes will be placed next to each other, keeping this distance. - *

- *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - horizontalDistance:number; - /** - * Gets or sets the preferred aspect ratio (width/height) for the subtrees. - *

- * This ratio determines among how many rows/columns the nodes will be distributed. - *

- *

- * The aspect ratio needs to be positive. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified aspect ratio is 0 or negative - * @type {number} - */ - aspectRatio:number; - /** - * Gets or sets how rows/columns are aligned with each other. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown fill style is specified - * @type {yfiles.tree.FillStyle} - */ - fillStyle:yfiles.tree.FillStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.AspectRatioNodePlacer; - } - /** - * The {@link yfiles.tree.AspectRatioTreeLayout} arranges tree graphs in a compact fashion. - *

- * Layout Style This layout algorithm tries to generate compact tree layouts with a certain preferred aspect ratio. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[40,740],[360,740],[480,810],[400,810],[240,810],[80,810],[160,810],[560,810],[200,880],[200,940],[200,1000],[200,1060],[200,1120],[120,880],[120,940],[120,1000],[120,1060],[120,1120],[280,880],[280,940],[320,880],[320,940],[600,880],[600,940],[600,1000],[520,880],[520,940],[520,1000],[440,880],[440,940],[440,1000],[440,1060],[440,1120],[40,70],[390,70],[80,450],[80,640],[200,140],[200,450],[80,140],[150,680],[190,680],[240,210],[240,270],[240,330],[120,520],[120,580],[160,520],[160,580],[270,490],[270,550],[310,490],[310,550],[350,490],[350,550],[120,210],[120,270],[120,330],[120,390],[160,210],[160,270],[160,330],[430,610],[580,510],[430,510],[430,140],[510,140],[590,140],[470,610],[650,550],[500,550],[540,550],[630,210],[630,270],[630,330],[470,210],[470,270],[470,330],[470,390],[470,450],[550,210],[550,270],[550,330],[550,390],[550,450]],"e":[[0,1,-10,0,0,0,[5,50,5,720,55,720]],[0,2,-10,0,0,0,[5,50,5,720,375,720]],[2,3,-10,0,0,0,[365,790,495,790]],[2,4,-10,0,0,0,[365,790,415,790]],[1,5,-10,0,0,0,[45,790,255,790]],[1,6,-10,0,0,0,[45,790,95,790]],[1,7,-10,0,0,0,[45,790,175,790]],[2,8,-10,0,0,0,[365,790,575,790]],[7,9,-10,0,0,0,[165,860,215,860]],[7,10,-10,0,0,0,[165,860,165,920,215,920]],[7,11,-10,0,0,0,[165,860,165,980,215,980]],[7,12,-10,0,0,0,[165,860,165,1040,215,1040]],[7,13,-10,0,0,0,[165,860,165,1100,215,1100]],[6,14,-10,0,0,0,[85,860,135,860]],[6,15,-10,0,0,0,[85,860,85,920,135,920]],[6,16,-10,0,0,0,[85,860,85,980,135,980]],[6,17,-10,0,0,0,[85,860,85,1040,135,1040]],[6,18,-10,0,0,0,[85,860,85,1100,135,1100]],[5,19,-10,0,0,0,[245,860,295,860]],[5,20,-10,0,0,0,[245,860,245,920,295,920]],[5,21,-10,0,0,0,[245,860,335,860]],[5,22,-10,0,0,0,[245,860,245,920,335,920]],[8,23,-10,0,0,0,[565,860,615,860]],[8,24,-10,0,0,0,[565,860,565,920,615,920]],[8,25,-10,0,0,0,[565,860,565,980,615,980]],[3,26,-10,0,0,0,[485,860,535,860]],[3,27,-10,0,0,0,[485,860,485,920,535,920]],[3,28,-10,0,0,0,[485,860,485,980,535,980]],[4,29,-10,0,0,0,[405,860,455,860]],[4,30,-10,0,0,0,[405,860,405,920,455,920]],[4,31,-10,0,0,0,[405,860,405,980,455,980]],[4,32,-10,0,0,0,[405,860,405,1040,455,1040]],[4,33,-10,0,0,0,[405,860,405,1100,455,1100]],[0,34,-10,0,0,0,[5,50,55,50]],[0,35,-10,0,0,0,[5,50,405,50]],[34,36,-10,0,0,0,[45,120,45,430,95,430]],[34,37,-10,0,0,0,[45,120,45,620,95,620]],[34,38,-10,0,0,0,[45,120,215,120]],[34,39,-10,0,0,0,[45,120,45,430,215,430]],[34,40,-10,0,0,0,[45,120,95,120]],[37,41,0,-10,0,0,[130,645,130,660,165,660]],[37,42,0,-10,0,0,[130,645,130,660,205,660]],[38,43,-10,0,0,0,[205,190,255,190]],[38,44,-10,0,0,0,[205,190,205,250,255,250]],[38,45,-10,0,0,0,[205,190,205,310,255,310]],[36,46,-10,0,0,0,[85,500,135,500]],[36,47,-10,0,0,0,[85,500,85,560,135,560]],[36,48,-10,0,0,0,[85,500,175,500]],[36,49,-10,0,0,0,[85,500,85,560,175,560]],[39,50,0,-10,0,0,[250,455,250,470,285,470]],[39,51,0,-10,0,0,[250,455,250,530,285,530]],[39,52,0,-10,0,0,[250,455,250,470,325,470]],[39,53,0,-10,0,0,[250,455,250,530,325,530]],[39,54,0,-10,0,0,[250,455,250,470,365,470]],[39,55,0,-10,0,0,[250,455,250,530,365,530]],[40,56,-10,0,0,0,[85,190,135,190]],[40,57,-10,0,0,0,[85,190,85,250,135,250]],[40,58,-10,0,0,0,[85,190,85,310,135,310]],[40,59,-10,0,0,0,[85,190,85,370,135,370]],[40,60,-10,0,0,0,[85,190,175,190]],[40,61,-10,0,0,0,[85,190,85,250,175,250]],[40,62,-10,0,0,0,[85,190,85,310,175,310]],[35,63,-10,0,0,0,[395,120,395,590,445,590]],[35,64,-10,0,0,0,[395,120,395,490,595,490]],[35,65,-10,0,0,0,[395,120,395,490,445,490]],[35,66,-10,0,0,0,[395,120,445,120]],[35,67,-10,0,0,0,[395,120,525,120]],[35,68,-10,0,0,0,[395,120,605,120]],[35,69,-10,0,0,0,[395,120,395,590,485,590]],[64,70,0,-10,0,0,[630,515,630,530,665,530]],[65,71,0,-10,0,0,[480,515,480,530,515,530]],[65,72,0,-10,0,0,[480,515,480,530,555,530]],[68,73,-10,0,0,0,[595,190,645,190]],[68,74,-10,0,0,0,[595,190,595,250,645,250]],[68,75,-10,0,0,0,[595,190,595,310,645,310]],[66,76,-10,0,0,0,[435,190,485,190]],[66,77,-10,0,0,0,[435,190,435,250,485,250]],[66,78,-10,0,0,0,[435,190,435,310,485,310]],[66,79,-10,0,0,0,[435,190,435,370,485,370]],[66,80,-10,0,0,0,[435,190,435,430,485,430]],[67,81,-10,0,0,0,[515,190,565,190]],[67,82,-10,0,0,0,[515,190,515,250,565,250]],[67,83,-10,0,0,0,[515,190,515,310,565,310]],[67,84,-10,0,0,0,[515,190,515,370,565,370]],[67,85,-10,0,0,0,[515,190,515,430,565,430]]],"vp":[0.0,0.0,680.0,1150.0]}} - *

- *

- * Example layout with an aspect ratio of 0.5 - *

- *

- * Concept - *

- *

- * The layout algorithm starts from the root and recursively assigns coordinates to all tree nodes. In this manner, leaf - * nodes will be placed first, while each parent node is placed centered above its child nodes. - *

- *

- * Features - *

- *

- * The aspect ratio of each subtree can be specified individually. A {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY} - * returns the aspect ratio for each local root node. - *

- *

- * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with - * key {@link yfiles.tree.AspectRatioTreeLayout#SELECTED_ROOT_DP_KEY}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface AspectRatioTreeLayout extends yfiles.layout.MultiStageLayout{} - export class AspectRatioTreeLayout { - /** - * Creates a new {@link yfiles.tree.AspectRatioTreeLayout} instance with default settings. - */ - constructor(); - /** - * Adds bends to the given {@link yfiles.layout.IEdgeLayout}. - *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} for each edge, after the nodes are placed, to - * route the path of the edges. It may be overridden to apply a custom routing style. - *

- * @param edgeLayout the layout of the edge that is routed - * @param localRoot the local root of the subtree - * @param child the child connected to the local root with the given edge - * @param rootPlacement the placement specifier of the local root - * @param routingPolicy the direction specifier for the routing - * @protected - */ - createBends(edgeLayout:yfiles.layout.IEdgeLayout,localRoot:yfiles.algorithms.Node,child:yfiles.algorithms.Node,rootPlacement:yfiles.tree.RootPlacement,routingPolicy:yfiles.tree.SubtreeArrangement):void; - /** - * Retrieves the aspect ratio for the subtree that is rooted at the given node. - *

- * If there is an individual aspect ratio for the subtree provided by a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY}, that ratio will be returned. Otherwise, the {@link yfiles.tree.AspectRatioTreeLayout#aspectRatio default aspect ratio} - * will be returned. - *

- *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} before a subtree is arranged. It may be - * overridden to use another approach to define the aspect ratio for subtrees. - *

- * @param localRoot the root node of the subtree - * @returns the aspect ratio of the subtree rooted at the local root node - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#aspectRatio - * @protected - */ - getAspectRatio(localRoot:yfiles.algorithms.Node):number; - /** - * Retrieves the root placement for the subtree that is rooted at the given node. - *

- * Either an individual root placement for the subtree (defined via a {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY}), or if there is none, the {@link yfiles.tree.AspectRatioTreeLayout#rootPlacement default root placement} is returned. - *

- *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} after a subtree is arranged to align the - * local root node. It may be overridden to use another approach to define the root placement for a subtree. - *

- * @param localRoot the root of the subtree - * @returns the root placement of the subtree - * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#rootPlacement - * @protected - */ - getRootPlacement(localRoot:any):yfiles.tree.RootPlacement; - /** - * Retrieves the routing for the subtree that is rooted at the given node. - *

- * Either an individual routing for the subtree (defined via a {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY}), or if there is none, the {@link yfiles.tree.AspectRatioTreeLayout#subtreeArrangement default routing} is returned. - *

- *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} to determine the direction of the subtrees. - * It may be overridden to use another approach to define the routing for a subtree. - *

- * @param localRoot the root of the subtree - * @returns the routing policy for the subtree - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#subtreeArrangement - * @protected - */ - getSubtreeArrangement(localRoot:any):yfiles.tree.SubtreeArrangement; - /** - * Retrieves all children of the given local root. - *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} to arrange the subtrees below the local - * root. - *

- * @param localRoot the root of a subtree - * @returns all successors of the given node - * @protected - */ - getSuccessors(localRoot:yfiles.algorithms.Node):yfiles.algorithms.INodeCursor; - /** - * Data provider key for specifying a target aspect ratio for each subtree - *

- * The aspect ratio needs to be greater than 0. - *

- *
    - *
  • aspect ratio 1: width and height of the layout should be the same
  • - *
  • aspect ratio between 0 and 1: the height of the layout should be greater than its width
  • - *
  • aspect ratio greater than 1: the width of the layout should be greater than its height
  • - *
- *

- * If no specific ratio is defined for a subtree, the layout algorithm falls back to the default {@link yfiles.tree.AspectRatioTreeLayout#aspectRatio aspect ratio}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SUBTREE_ASPECT_RATIO_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying the placement of each subtree root - *

- * If no root placement is specified for one of the subtree roots, the default {@link yfiles.tree.AspectRatioTreeLayout#rootPlacement root placement} will be used. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ROOT_PLACEMENT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying the routing direction for each subtree root - *

- * The children in a subtree are arranged either horizontally or vertically. The edges are routed to the top of the child - * nodes or at the side, respectively. Directions depend on the {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation} and refer to {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} - * for this description. - *

- *

- * If no specific routing policy is specified for a subtree root, the layout algorithm uses the default {@link yfiles.tree.AspectRatioTreeLayout#subtreeArrangement routing direction}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SUBTREE_ROUTING_POLICY_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking the node that will be used as root node of the tree - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * The input graph this algorithm is handling. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets or sets the horizontal distance between adjacent nodes. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - horizontalDistance:number; - /** - * Gets or sets the vertical distance between adjacent nodes. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - verticalDistance:number; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} that will be used for sorting the {@link yfiles.algorithms.Node#sortOutEdges outgoing edges} of each local root in the tree before they are being - * arranged. - * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the default aspect ratio for this {@link yfiles.tree.AspectRatioTreeLayout}. - *

- * This aspect ratio is used for all subtrees for which there is no specific aspect ratio defined in a {@link yfiles.algorithms.IDataProvider} - * registered with {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY}. - *

- *

- * The aspect ratio needs to have a positive value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified aspect ratio is 0 or negative - * @type {number} - */ - aspectRatio:number; - /** - * Gets or sets the desired placement of the tree's root node. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown placement specifiers is set - * @type {yfiles.tree.RootPlacement} - */ - rootPlacement:yfiles.tree.RootPlacement; - /** - * Gets or sets how the children of a local root are arranged and how the edges between them are routed. - * @throws {Stubs.Exceptions.ArgumentError} if the specified routing policy is unknown - * @type {yfiles.tree.SubtreeArrangement} - */ - subtreeArrangement:yfiles.tree.SubtreeArrangement; - /** - * Gets or sets the preferred distance between any two bends of an edge. - *

- * Additionally, the preferred bend distance governs the distance between the first and last edges and the corresponding - * ports. - *

- *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - bendDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.AspectRatioTreeLayout; - } - /** - * The {@link yfiles.tree.AssistantNodePlacer} places nodes that are marked as assistants left and right of their parents and all - * other nodes below the assistant nodes. - *

- * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[75,0],[100,171],[50,171],[0,171],[150,171],[110,50,1],[40,100,1],[40,50,1]],"e":[[0,1,[90,150.5,115,150.5]],[0,2,[90,150.5,65,150.5]],[0,3,[90,150.5,15,150.5]],[0,4,[90,150.5,165,150.5]],[0,5,[90,65]],[0,6,[90,115]],[0,7,[90,65]]],"vp":[0.0,0.0,180.0,201.0]}} - *

- *

- * Assistants are marked - *

- *

- * Concept This {@link yfiles.tree.INodePlacer} delegates the placement of all assistant nodes to an instance of - * {@link yfiles.tree.LeftRightNodePlacer}. The non-assistant nodes are handled by another {@link yfiles.tree.AssistantNodePlacer#childNodePlacer node placer}. To be able to do this, {@link yfiles.tree.AssistantNodePlacer} - * uses a {@link yfiles.tree.IProcessor} which prepares the graph for node placing. - *

- *

- * A {@link yfiles.algorithms.IDataProvider} that is registered using {@link yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY} returns - * true for assistant nodes and false for all other nodes. - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface AssistantNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class AssistantNodePlacer { - /** - * Creates a new {@link yfiles.tree.AssistantNodePlacer} instance that uses the transformation defined by the given matrix. - * @param modificationMatrix the transformation matrix - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.AssistantNodePlacer} instance with default settings. - */ - constructor(); - /** - * Creates a {@link yfiles.collections.IComparer.} that compares outgoing edges connecting to assistant nodes and edges connecting to non-assistant nodes - * separately. - * @param assistantComparer the {@link } for edges connecting to assistant nodes - * @param childComparer the {@link } for edges connecting to non-assistant nodes - * @returns a {@link } that compares edges to assistant nodes separately from edges to non-assistant nodes - * @static - */ - static createCompoundComparer(assistantComparer:yfiles.collections.IComparer,childComparer:yfiles.collections.IComparer):yfiles.collections.IComparer; - /** - * Data provider key for marking which nodes are placed as assistants - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ASSISTANT_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the spacing between subtrees for the delegate {@link yfiles.tree.INodePlacer}. - *

- * The spacing needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative - * @type {number} - */ - spacing:number; - /** - * Gets or sets the {@link yfiles.tree.INodePlacer} instance that places the non-assistant children. - *

- * These non-assistant child nodes will be placed below the assistant child nodes and are arranged by the given - * {@link yfiles.tree.INodePlacer}. Non-assistant child nodes are the ones that are not marked in the {@link yfiles.algorithms.IDataProvider} - * registered with {@link yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY}. - *

- * @see yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY - * @type {yfiles.tree.INodePlacer} - */ - childNodePlacer:yfiles.tree.INodePlacer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.AssistantNodePlacer; - } - /** - * The {@link yfiles.tree.BusNodePlacer} creates a bus to which all child nodes and the local root node are connected. - *

- * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[40,0],[140,0],[190,0],[50,70],[0,70],[100,70],[150,70],[90,0,1]],"e":[[7,0,[105,50,55,50]],[7,1,[105,50,155,50]],[7,2,[105,50,205,50]],[7,3,[105,50,65,50]],[7,4,[105,50,15,50]],[7,5,[105,50,115,50]],[7,6,[105,50,165,50]]],"vp":[0.0,0.0,220.0,100.0]}} - *

- *

- * The root node is marked - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface BusNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class BusNodePlacer { - /** - * Creates a new {@link yfiles.tree.BusNodePlacer} instance that uses the transformation defined by the given matrix. - * @param modificationMatrix the transformation matrix - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new instance of {@link yfiles.tree.BusNodePlacer} with default settings. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.BusNodePlacer; - } - /** - * This layout algorithm arranges graphs with a tree structure. - *

- * Layout Style {@link yfiles.tree.ClassicTreeLayout} is designed to arrange directed and undirected trees that have a unique root node. All - * children are placed below their parent in relation to the main layout direction. The edges of the graph are routed as - * straight-line segments or in an orthogonal bus-like fashion. - *

- *

- * Tree layout algorithms are commonly used for visualizing relational data and for producing diagrams of high quality that - * are able to reveal possible hierarchic properties of the graph. More precisely, they find applications in dataflow - * analysis, software engineering, bioinformatics and business administration. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[215.62,70],[365.62,0],[706.25,210],[25,140],[331.25,140],[100,280],[512.5,210],[325,280],[762.5,280],[200,210],[150,350],[400,350],[825,350],[350,350],[25,210],[900,420],[700,420],[100,350],[575,280],[575,350],[600,420],[200,280],[150,420],[25,280],[550,420],[300,420],[850,420],[800,420],[400,420],[200,350],[350,420],[50,350],[500,420],[100,420],[750,420],[450,420],[0,420],[50,420],[200,420],[650,280],[250,420],[650,420],[650,350]],"e":[[1,0,0,15,0,-15,[230.62,50]],[1,2,0,15,0,-15,[721.25,50]],[1,3,0,15,0,-15,[40,50]],[0,4,0,15,0,-15,[346.25,120]],[0,5,0,15,0,-15,[115,120]],[4,6,0,15,0,-15,[527.5,190]],[4,7,0,15,0,-15,[340,190]],[2,8,0,15,0,-15,[777.5,260]],[4,9,0,15,0,-15,[215,190]],[4,10,0,15,0,-15,[165,190]],[7,11,0,15,0,-15,[415,330]],[8,12,0,15,0,-15,[840,330]],[7,13,0,15,0,-15,[365,330]],[3,14,0,15,0,-15],[12,15,0,15,0,-15,[915,400]],[8,16,0,15,0,-15,[715,330]],[5,17,0,15,0,-15],[6,18,0,15,0,-15,[590,260]],[18,19,0,15,0,-15],[19,20,0,15,0,-15,[615,400]],[9,21,0,15,0,-15],[10,22,0,15,0,-15],[14,23,0,15,0,-15],[19,24,0,15,0,-15,[565,400]],[7,25,0,15,0,-15,[315,330]],[12,26,0,15,0,-15,[865,400]],[12,27,0,15,0,-15,[815,400]],[11,28,0,15,0,-15],[21,29,0,15,0,-15],[13,30,0,15,0,-15],[23,31,0,15,0,-15,[65,330]],[6,32,0,15,0,-15,[515,260]],[17,33,0,15,0,-15],[12,34,0,15,0,-15,[765,400]],[6,35,0,15,0,-15,[465,260]],[23,36,0,15,0,-15,[15,330]],[31,37,0,15,0,-15],[29,38,0,15,0,-15],[2,39,0,15,0,-15,[665,260]],[7,40,0,15,0,-15,[265,330]],[39,42,0,15,0,-15],[42,41,0,15,0,-15]],"vp":[0.0,0.0,930.0,450.0]}} A Dendrogram {@graph {"ann":{"s":[30,30],"d":1},"n":[[983.12,0],[495,85],[495,170],[151.25,170],[495,240],[42.5,255],[85,325],[0,325],[520,310],[470,310],[520,380],[135,395],[470,380],[85,395],[520,450],[35,395],[185,240,265,270,2],[260,255],[320,325],[405,395],[320,395],[370,465],[320,465],[235,395],[270,465],[200,325],[570,155,560,510,2],[670,170],[1060,240],[670,240],[1060,310],[670,325],[585,240],[1085,380],[670,395],[670,465],[620,325],[1035,380],[720,310,295,340,2],[810,325],[920,395],[835,395],[920,465],[785,395],[835,465],[970,535],[920,535],[735,395],[735,465],[870,535],[920,605],[1150,70,440,495,2],[1471.25,85],[1545,155],[1397.5,155],[1510,240],[1435,240],[1460,310],[1360,240],[1460,380],[1485,450],[1410,310],[1360,310],[1435,450],[1510,310],[1360,380],[1435,520],[1165,225,175,230,2],[1230,240],[1280,310],[1230,310],[1180,310],[1265,380,60,60,2],[1280,395]],"e":[[0,1,[998.12,50,510,50]],[1,2],[1,3,[510,135,166.25,135]],[2,4],[3,5,[166.25,220,57.5,220]],[5,6,[57.5,305,100,305]],[5,7,[57.5,305,15,305]],[4,8,[510,290,535,290]],[4,9,[510,290,485,290]],[8,10],[6,11,[100,375,150,375]],[9,12],[6,13],[10,14],[6,15,[100,375,50,375]],[3,17,[166.25,220,275,220]],[17,18,[275,305,335,305]],[18,19,[335,375,420,375]],[18,20],[20,21,[335,445,385,445]],[20,22],[18,23,[335,375,250,375]],[20,24,[335,445,285,445]],[17,25,[275,305,215,305]],[1,27,[510,135,685,135]],[27,28,[685,220,1075,220]],[27,29],[28,30],[29,31],[27,32,[685,220,600,220]],[30,33,[1075,360,1100,360]],[31,34],[34,35],[29,36,[685,290,635,290]],[30,37,[1075,360,1050,360]],[29,39,[685,290,825,290]],[39,40,[825,375,935,375]],[39,41,[825,375,850,375]],[40,42],[39,43,[825,375,800,375]],[41,44],[42,45,[935,515,985,515]],[42,46],[39,47,[825,375,750,375]],[47,48],[42,49,[935,515,885,515]],[46,50],[0,52,[998.12,50,1486.25,50]],[52,53,[1486.25,135,1560,135]],[52,54,[1486.25,135,1412.5,135]],[54,55,[1412.5,205,1525,205]],[54,56,[1412.5,205,1450,205]],[56,57,[1450,290,1475,290]],[54,58,[1412.5,205,1375,205]],[57,59],[59,60,[1475,430,1500,430]],[56,61,[1450,290,1425,290]],[58,62],[59,63,[1475,430,1450,430]],[55,64],[62,65],[63,66],[54,68,[1412.5,205,1245,205]],[68,69,[1245,290,1295,290]],[68,70],[68,71,[1245,290,1195,290]],[69,73]],"vp":[0.0,0.0,1590.0,665.0]}} A graph containing group nodes {@graph {"ann":{"s":[30,30],"d":1},"n":[[4.33,440.22],[74.33,418.34,73.78,73.78],[188.11,41,48,48],[197.11,417.95],[298,245.33],[298,445.67],[389.89,393.78,73.78,73.78],[411.78,146.89],[298,25],[411.78,243.78],[411.78,293.78],[298,590.56],[503.67,100,73.78,73.78],[197.11,708.56],[188.11,821.45,48,48],[525.56,415.67],[525.56,243.78],[399.84,13.06,53.88,53.88],[276.11,661.67,73.78,73.78],[411.78,343.78],[411.78,497.56],[402.78,547.56,48,48],[402.78,615.56,48,48],[298,755.45],[525.56,472.56],[525.56,293.78],[629.39,243.78],[525.56,0],[525.56,50],[525.56,522.56],[298,805.45],[617.45,485.62,53.88,53.88],[629.39,50],[411.78,755.45],[711.33,38.06,53.88,53.88],[629.39,559.5],[298,75],[411.78,683.56],[525.56,599.56],[411.78,805.45],[723.27,559.5],[629.39,293.78],[525.56,193.78],[723.27,497.56],[298,855.45],[525.56,649.56]],"e":[[0,1],[1,2,[168.11,455.22,168.11,65]],[1,3,[168.11,455.22,168.11,432.95]],[3,4,[256.11,432.95,256.11,260.33]],[3,5,[256.11,432.95,256.11,460.67]],[5,6,[369.89,460.67,369.89,430.67]],[4,7,[369.89,260.33,369.89,161.89]],[2,8,[256.11,65,256.11,40]],[4,9,[369.89,260.33,369.89,258.78]],[4,10,[369.89,260.33,369.89,308.78]],[3,11,[256.11,432.95,256.11,605.56]],[7,12,[483.67,161.89,483.67,136.89]],[1,13,[168.11,455.22,168.11,723.56]],[1,14,[168.11,455.22,168.11,845.45]],[6,15],[9,16],[8,17],[13,18,[256.11,723.56,256.11,698.56]],[4,19,[369.89,260.33,369.89,358.78]],[5,20,[369.89,460.67,369.89,512.56]],[11,21,[369.89,605.56,369.89,571.56]],[11,22,[369.89,605.56,369.89,639.56]],[13,23,[256.11,723.56,256.11,770.45]],[20,24,[483.67,512.56,483.67,487.56]],[10,25],[16,26],[17,27,[483.67,40,483.67,15]],[17,28,[483.67,40,483.67,65]],[20,29,[483.67,512.56,483.67,537.56]],[14,30,[256.11,845.45,256.11,820.45]],[29,31,[597.45,537.56,597.45,512.56]],[28,32],[23,33],[32,34],[29,35,[597.45,537.56,597.45,574.5]],[2,36,[256.11,65,256.11,90]],[18,37],[22,38,[483.67,639.56,483.67,614.56]],[30,39],[35,40],[25,41],[7,42,[483.67,161.89,483.67,208.78]],[31,43],[14,44,[256.11,845.45,256.11,870.45]],[22,45,[483.67,639.56,483.67,664.56]]],"vp":[4.0,0.0,762.0,886.0]}} Left-to-right layout with global layeringConcept - *

- *

- * The layout algorithm starts from the root and recursively assigns coordinates to all tree nodes. In this manner, leaf - * nodes will be placed first, while each parent node is placed centered above its children. - *

- *

- * Features - *

- *

- * The layout algorithm supports custom sorting of sibling nodes by using a specific {@link yfiles.tree.NodeOrderComparer}. Each - * tree node may have an individual {@link yfiles.tree.NodeOrderComparer} that is stored in a {@link yfiles.algorithms.IDataProvider} - * registered with the graph with {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY}. If this {@link yfiles.tree.NodeOrderComparer} - * uses the initial coordinates of the nodes, it allows the incremental insertion of child nodes while keeping the relative - * locations of the other nodes. - *

- *

- * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with - * key {@link yfiles.tree.ClassicTreeLayout#SELECTED_ROOT_DP_KEY}. - *

- *

- * {@link yfiles.tree.ClassicTreeLayout} can be configured to {@link yfiles.tree.ClassicTreeLayout#considerNodeLabels reserve space for node labels}. It can also {@link yfiles.tree.ClassicTreeLayout#integratedEdgeLabeling place edge labels along edges} - * such that the labels won't overlap with other graph elements. Edge labels are placed according to the information stored - * in a {@link yfiles.layout.PreferredPlacementDescriptor} instance. However, the placement along the edge will only affect the - * order of multiple labels at the same edge. The algorithm will always place the labels close to the target node. - *

- *

- * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole - * subtree. Otherwise, the group nodes may overlap with each other or with other nodes. Furthermore, the user may specify - * minimum size constraints for each group node using {@link yfiles.algorithms.IDataProvider} key - * {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. - *

- *

- * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} - * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. After the - * layout calculation, the stage will reinsert the edges that were removed and route them separately. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface ClassicTreeLayout extends yfiles.layout.MultiStageLayout{} - export class ClassicTreeLayout { - /** - * Creates a new {@link yfiles.tree.ClassicTreeLayout} instance with default settings. - */ - constructor(); - /** - * Data provider key for marking the node that will be used as root node of the tree - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets whether or not a global layering is enforced, that is, each node spans exactly one layer. - *

- * If it is enabled, the algorithm ensures that nodes never span more than one layer. Otherwise, nodes with larger size - * might span two or more layers such that a more compact layout is produced. - *

- *

- * This setting can be advantageous, if the hierarchical structure of the tree should be emphasized. - *

- * @see yfiles.tree.ClassicTreeLayout#verticalAlignment - * @see yfiles.tree.ClassicTreeLayout#verticalAlignment - * @type {boolean} - */ - enforceGlobalLayering:boolean; - /** - * Gets or sets the layout policy for leaf nodes. - * @throws {Stubs.Exceptions.ArgumentError} if the specified policy is unknown - * @type {yfiles.tree.LeafPlacement} - */ - leafPlacement:yfiles.tree.LeafPlacement; - /** - * Gets or sets whether or not group nodes are handled by the layout algorithm. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @type {boolean} - */ - groupingSupported:boolean; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} instance that is used for sorting the outgoing edges of each node of the tree. - *

- * This comparator defines the relative order of the child nodes in the layout. - *

- * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the port assignment policy that will be applied. - * @type {yfiles.tree.PortStyle} - */ - portStyle:yfiles.tree.PortStyle; - /** - * Gets or sets the edge routing style used by this layout algorithm. - *

- * If {@link yfiles.tree.EdgeRoutingStyle#PLAIN} is set, the edges will be routed as straight-line segments. If {@link yfiles.tree.EdgeRoutingStyle#ORTHOGONAL} - * is set, all edges will be routed orthogonally in a bus-like fashion. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an invalid layout style is provided - * @type {yfiles.tree.EdgeRoutingStyle} - */ - edgeRoutingStyle:yfiles.tree.EdgeRoutingStyle; - /** - * Gets or sets the minimum horizontal distance between adjacent nodes within the same layer. - * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets the minimum distance between two adjacent layers. - * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - * @type {number} - */ - minimumLayerDistance:number; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels. - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not the layout algorithm reserves space for edge labels and places them. - *

- * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on - * {@link yfiles.layout.IEdgeLabelLayout}. - *

- *

- * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} - * and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to true. - *

- * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets the vertical bus alignment for orthogonally routed edge buses. - *

- * The bus alignment determines the relative position of an edge bus between two subsequent layers. The value of this - * property must lie within the interval [0,1] where: - *

- *
    - *
  • A value of 0 places the bus at the top, directly below the parent node.
  • - *
  • A value of 0.5 places the bus in the middle between parent and child nodes.
  • - *
  • A value of 1 places the bus at the bottom, directly above the child nodes.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if busAlignment is not in [0,1] - * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle - * @see yfiles.tree.ClassicTreeLayout#enforceGlobalLayering - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @type {number} - */ - busAlignment:number; - /** - * Gets or sets the vertical alignment of the nodes within their corresponding layers. - *

- * The value for the vertical alignment is considered as relative to the height of the corresponding layer, which is - * determined by the maximum height of the nodes that belong to the particular layer. - *

- *

- * The value of this property must lie within the interval [0,1], where: - *

- *
    - *
  • A value of 0 corresponds to top-alignment.
  • - *
  • A value of 0.5 corresponds to center-alignment.
  • - *
  • A value of 1 corresponds to bottom-alignment.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if vertical alignment value does not lie within [0,1] - * @see yfiles.tree.ClassicTreeLayout#enforceGlobalLayering - * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets the modification matrix used for rotating / mirroring the layout. - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.ClassicTreeLayout; - } - /** - * {@link yfiles.tree.DefaultNodePlacer} is the default implementation of interface {@link yfiles.tree.INodePlacer}. - *

- * Layout Style The layout style can be customized in several ways. Subtrees sharing the same local root node are either placed above - * or below each other. {@graph {"ann":{"s":[30,30],"d":1},"n":[[135,0],[0,70],[70,70],[120,149],[170,149],[220,149],[270,149],[70,199],[120,278],[170,278],[220,278],[270,278]],"e":[[0,1,0,15,0,0,[150,50,15,50]],[1,2],[2,3,-11.25,15,0,0,[73.75,116,135,133]],[2,4,-3.75,15,0,0,[81.25,116,185,133]],[2,5,3.75,15,0,0,[88.75,116,235,133]],[2,6,11.25,15,0,0,[96.25,116,285,133]],[1,7,[50,85,50,214]],[7,8,-11.25,15,0,0,[73.75,245,135,262]],[7,9,-3.75,15,0,0,[81.25,245,185,262]],[7,10,3.75,15,0,0,[88.75,245,235,262]],[7,11,11.25,15,0,0,[96.25,245,285,262]]],"vp":[0.0,0.0,300.0,308.0]}} - *

- *

- * Each layer in the tree uses different configurations of {@link yfiles.tree.DefaultNodePlacer} - *

- *

- * Features - *

- *

- * {@link yfiles.tree.SubtreeShape}s can be arranged in each main direction specified in - * {@link yfiles.tree.DefaultNodePlacer#childPlacement}. That way, the subtrees of the same graph can have different directions. - *

- *

- * This node placer aligns the local root node according to a chosen {@link yfiles.tree.DefaultNodePlacer#rootAlignment alignment}. - *

- *

- * There are various {@link yfiles.tree.DefaultNodePlacer#routingStyle routing styles} that result in different edge routes. - *

- * @class - * @extends {yfiles.tree.NodePlacerBase} - * @implements {yfiles.tree.IFromSketchNodePlacer} - * @implements {yfiles.lang.ICloneable} - */ - export interface DefaultNodePlacer extends yfiles.tree.NodePlacerBase,yfiles.tree.IFromSketchNodePlacer,yfiles.lang.ICloneable{} - export class DefaultNodePlacer { - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with custom settings. - * @param childPlacement the child placement specifier describing the style of the arrangement - * @param rootAlignment the alignment specifier describing how the root node is aligned with its child nodes - * @param routingStyle the routing style specifier - * @param verticalDistance the vertical distance between the {@link }s - * @param horizontalDistance the horizontal distance between the {@link }s - * @param minFirstSegmentLength the minimum length of the first edge segment (connected to the root node) - * @param minLastSegmentLength the minimum length of the last edge segment (connected to the child node) - * @param minSlope the minimum slope between the root node and the {@link }s - * @param minSlopeHeight the minimum vertical height of sloped edge segments - * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment or the routing style is unknown or if the horizontal/vertical distance - * or the minimum first/last segment length or the minimum slope or the minimum vertical height is negative - * @see yfiles.tree.DefaultNodePlacer#childPlacement - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - * @see yfiles.tree.DefaultNodePlacer#routingStyle - * @see yfiles.tree.DefaultNodePlacer#verticalDistance - * @see yfiles.tree.DefaultNodePlacer#horizontalDistance - * @see yfiles.tree.DefaultNodePlacer#minimumFirstSegmentLength - * @see yfiles.tree.DefaultNodePlacer#minimumLastSegmentLength - * @see yfiles.tree.DefaultNodePlacer#minimumSlope - * @see yfiles.tree.DefaultNodePlacer#minimumSlopeHeight - */ - constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,routingStyle:yfiles.tree.RoutingStyle,verticalDistance:number,horizontalDistance:number,minFirstSegmentLength:number,minLastSegmentLength:number,minSlope:number,minSlopeHeight:number); - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#rootAlignment root alignment}, {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} - * and {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. - * @param childPlacement the child placement specifier describing the style of the arrangement - * @param rootAlignment the alignment specifier describing how the root node is aligned with its child nodes - * @param routingStyle the routing style specifier - * @param verticalDistance the vertical distance between the {@link }s - * @param horizontalDistance the horizontal distance between the {@link }s - * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment or the routing style is unknown or if the horizontal/vertical distance - * is negative - * @see yfiles.tree.DefaultNodePlacer#childPlacement - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - * @see yfiles.tree.DefaultNodePlacer#routingStyle - * @see yfiles.tree.DefaultNodePlacer#verticalDistance - * @see yfiles.tree.DefaultNodePlacer#horizontalDistance - */ - constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,routingStyle:yfiles.tree.RoutingStyle,verticalDistance:number,horizontalDistance:number); - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#rootAlignment root alignment}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} and - * {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. - * @param childPlacement the child placement specifier describing the style of the arrangement - * @param rootAlignment the alignment specifier describing how the root node is aligned with its child nodes - * @param verticalDistance the vertical distance between the {@link }s - * @param horizontalDistance the horizontal distance between the {@link }s - * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment specifier is unknown or if the horizontal/vertical distance is - * negative - * @see yfiles.tree.DefaultNodePlacer#childPlacement - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - * @see yfiles.tree.DefaultNodePlacer#verticalDistance - * @see yfiles.tree.DefaultNodePlacer#horizontalDistance - */ - constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,verticalDistance:number,horizontalDistance:number); - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} and {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. - * @param childPlacement the child placement specifier describing the style of the arrangement - * @param verticalDistance the vertical distance between the {@link }s - * @param horizontalDistance the horizontal distance between the {@link }s - * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier is unknown or if the horizontal/vertical distance is negative - * @see yfiles.tree.DefaultNodePlacer#childPlacement - * @see yfiles.tree.DefaultNodePlacer#verticalDistance - * @see yfiles.tree.DefaultNodePlacer#horizontalDistance - */ - constructor(childPlacement:yfiles.tree.ChildPlacement,verticalDistance:number,horizontalDistance:number); - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with default settings. - */ - constructor(); - /** - * Calculates the bends for the connector to the parent node. - *

- * This implementation adds bends to the connector for edges that route the edges around the child node in case there are - * {@link yfiles.layout.PortConstraint}s that conflict with the direction of the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}. - *

- *

- * This method is called in {@link yfiles.tree.DefaultNodePlacer#placeSubtreeOfNode} to route the edges after the - * {@link yfiles.tree.SubtreeShape}s are arranged. It may be overridden to customize the routing style. - *

- * @param graph the input graph - * @param localRoot the local root node whose connector is calculated and stored in the given subtree shape - * @param rootLayout the {@link } of the root node - * @param subtreeShape the shape of the whole subtree of the local root - * @param parentEdge the incoming edge of the local root node that will be the connector for the given subtree shape - * @param parentEdgeLayout the current {@link } of the connector edge - * @param direction the direction specifier as defined in the {@link } interface which should be used for the connector - * @see yfiles.tree.NodePlacerBase#determineChildConnectors - * @protected - */ - calculateParentConnector(graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,rootLayout:yfiles.layout.INodeLayout,subtreeShape:yfiles.tree.SubtreeShape,parentEdge:yfiles.algorithms.Edge,parentEdgeLayout:yfiles.layout.IEdgeLayout,direction:number):void; - /** - * Calculates the routing of the source side of the edge to the given child node. - *

- * This method delegates to {@link yfiles.tree.DefaultNodePlacer#calculateSourceEdgeLayout} if the {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style} is not - * {@link yfiles.tree.RoutingStyle#FORK}. It may be overridden to implement a custom routing style. - *

- * @param rootLayout the {@link } of the local root node - * @param childShape the {@link } instance of the corresponding child's subtree - * @param edge the edge - * @param rootForkCoordinate the y-coordinate of the first bend of the edge if the placement is horizontal, the x-coordinate otherwise - * @param childForkCoordinate the y-coordinate of the second (= last) bend of the edge if the placement is horizontal, the x-coordinate otherwise - * @protected - */ - calculateSlopedSourceEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge,childForkCoordinate:number,rootForkCoordinate:number):void; - /** - * Calculates the routing of the source side of the edge to the given child node. - *

- * This implementation adds bends to the {@link yfiles.layout.IEdgeLayout} of the given edge according to the specified {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style} - * and {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}. It also updates the target points in the {@link yfiles.tree.SubtreeShape}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultNodePlacer#calculateSlopedSourceEdgeLayout} to route the edges. It may be - * overridden to implement a custom edge routing style. - *

- * @param rootLayout the {@link } of the local root node - * @param childShape the {@link } of the child's subtree that is connected through the given edge - * @param edge the edge - * @protected - */ - calculateSourceEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge):void; - /** - * Calculates the routing of the target side of the edge to the given child node. - *

- * This implementation just resets the current {@link yfiles.layout.IEdgeLayout}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultNodePlacer#placeSubtreeOfNode} after the {@link yfiles.tree.SubtreeShape shapes} of the local root's children - * are placed. It may be overridden to add some {@link yfiles.tree.SubtreeShape#addTargetPoint target points} to the edge. - *

- * @param rootLayout the {@link } of the local root node - * @param childShape the {@link } of the child's subtree that is connected through the given edge - * @param edge the edge - * @protected - */ - calculateTargetEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge):void; - /** - * Creates a {@link yfiles.collections.IComparer.} for outgoing edges which takes the initial coordinates of the edges' targets into account. - *

- * Child nodes are sorted in a way that the layout will resemble the current arrangement of the nodes. This is especially - * useful for interactive or incremental layout calculation. - *

- * @returns a {@link } that considers the initial coordinates of the nodes - */ - createComparer():yfiles.collections.IComparer; - /** - * Delegates to {@link yfiles.tree.DefaultNodePlacer#createComparer}. - * @returns the From Sketch {@link } - * @see yfiles.tree.DefaultNodePlacer#createComparer - */ - createFromSketchComparer():yfiles.collections.IComparer; - /** - * Gets or sets the direction in which the child nodes are placed with respect to their parent node. - *

- * Subtrees can be placed below, above, left or right of their roots. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown placement specifier is set - * @type {yfiles.tree.ChildPlacement} - */ - childPlacement:yfiles.tree.ChildPlacement; - /** - * Gets or sets how the root node is aligned with its children and their {@link yfiles.tree.SubtreeShape}s. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown root alignment specifier is set - * @type {yfiles.tree.RootAlignment} - */ - rootAlignment:yfiles.tree.RootAlignment; - /** - * Gets or sets the relative vertical alignment of nodes with the same parent. - *

- * All values between 0 and 1 result in a valid alignment. - *

- *
    - *
  • 0 - nodes are top-aligned
  • - *
  • 0.5 - nodes are center-aligned
  • - *
  • 1 - nodes are bottom-aligned
  • - *
- *

- * Values outside the interval [0,1] will result in a more compact node placement with unaligned nodes. - *

- * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets the style in which edge paths are routed. - * @throws {Stubs.Exceptions.ArgumentError} if the specified routing style is unknown - * @type {yfiles.tree.RoutingStyle} - */ - routingStyle:yfiles.tree.RoutingStyle; - /** - * Gets or sets the vertical distance between nodes or {@link yfiles.tree.SubtreeShape}s. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - verticalDistance:number; - /** - * Gets or sets the minimum length for the first segment of an edge. - *

- * During layout calculation, the edges of the tree are directed. Hence, the first segment is always the segment that is - * attached to the source, which is the local root node. - *

- *

- * The length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum segment length is negative - * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length for the last segment of an edge. - *

- * During layout calculation, the edges of the tree are directed. Hence, the last segment is always the segment that is - * attached to the target, which is a child node. - *

- *

- * The length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum segment length is negative - * @type {number} - */ - minimumLastSegmentLength:number; - /** - * Gets or sets the minimum slope of the edge segments. - *

- * These sloped segments are between the vertical first and last segment of the edge. - *

- *

- * The segments may become steeper but they will have at least the specified slope. Negative minimum slopes can lead to - * edge routes looking like spider legs. - *

- * @see yfiles.tree.DefaultNodePlacer#minimumSlopeHeight - * @type {number} - */ - minimumSlope:number; - /** - * Gets or sets the minimum height for sloped edge segments. - *

- * These sloped segments are between the vertical first and last segment of the edge. - *

- *

- * The segments may become steeper to reach the specified height. - *

- * @see yfiles.tree.DefaultNodePlacer#minimumSlope - * @type {number} - */ - minimumSlopeHeight:number; - /** - * Gets or sets the horizontal distance between nodes or {@link yfiles.tree.SubtreeShape}s. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - horizontalDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DefaultNodePlacer; - } - /** - * The {@link yfiles.tree.DefaultPortAssignment} provides some simple {@link yfiles.tree.DefaultPortAssignment#mode port assignment styles}. - *

- * Ports are either {@link yfiles.tree.PortAssignmentMode#NONE centered} on the node, distributed at one side of the node or placed considering - * {@link yfiles.layout.PortConstraint}s. - *

- * @class - * @implements {yfiles.tree.IPortAssignment} - */ - export interface DefaultPortAssignment extends yfiles.lang.Object,yfiles.tree.IPortAssignment{} - export class DefaultPortAssignment { - /** - * Creates a new {@link yfiles.tree.DefaultPortAssignment} instance using the given port assignment mode and ratio between the - * border and the ports and the gap between the ports themselves. - * @param mode one of the predefined port assignment specifiers - * @param [ratio=0.5] the ratio of the distance between outer ports and the border to the distance between any two ports - * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified or if the specified ratio is negative - */ - constructor(mode:yfiles.tree.PortAssignmentMode,ratio?:number); - /** - * Creates a new {@link yfiles.tree.DefaultPortAssignment} instance with default settings. - */ - constructor(); - /** - * Assigns relative coordinates to the source port of the outgoing edge to a child of the given node. - *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignPorts} for each outgoing edge of the given node. It may - * be overridden to assign a custom location to the source port of outgoing edges. - *

- * @param graph the input graph - * @param node the node - * @param edge the edge to the child node - * @param index the zero-based index of the child edge - * @see yfiles.layout.IEdgeLayout#sourcePoint - * @protected - */ - assignChildEdgeSourcePort(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,index:number):void; - /** - * Assigns relative coordinates to the target port of the incoming edge from the parent of the given node. - *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignPorts} if the given node has a parent node. It may be - * overridden to assign a custom location to the target port of the incoming edge. - *

- * @param graph the input graph - * @param node the node - * @param edge the edge from the parent node - * @see yfiles.layout.IEdgeLayout#targetPoint - * @protected - */ - assignParentEdgeTargetPort(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):void; - /** - * Places the ports of edges connecting to the given node according to the {@link yfiles.tree.DefaultPortAssignment#mode port assignment mode}. - * @param graph the input graph - * @param node the node whose adjacent edges' ports should be placed - * @see yfiles.tree.DefaultPortAssignment#mode - */ - assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - /** - * Determines the distance between the outer ports and the border of the node. - *

- * This implementation calculates the gap according to the number of edges at one side of the node. It also includes the - * {@link yfiles.tree.DefaultPortAssignment#borderGapToPortGapRatio ratio between border gap and port gap}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} to calculate the location of the - * first port. It may be overridden to implement a different distribution of ports on the node's side. - *

- * @param sideLength the width/height of the side - * @param edgeCount the number of edges that connect to this side - * @returns the absolute gap to be used on both sides of the ports - * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort - * @see yfiles.tree.DefaultPortAssignment#borderGapToPortGapRatio - * @protected - */ - getPortBorderGap(sideLength:number,edgeCount:number):number; - /** - * Determines the distance between two adjacent ports. - *

- * This implementation calculates the gap according to the number of edges at one side of the node. The edges are - * distributed keeping the given gap to the border of the node. - *

- *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} to calculate the distance between - * two ports. It may be overridden to implement a different distribution of ports on the node's side. - *

- * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @param portBorderGap the port border gap (i.e. calculated by {@link #getPortBorderGap}) - * @returns the absolute distance to be used between two adjacent ports - * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort - * @see yfiles.tree.DefaultPortAssignment#getPortBorderGap - * @protected - */ - getPortDistanceDelta(sideLength:number,edgeCount:number,portBorderGap:number):number; - /** - * Retrieves the source {@link yfiles.layout.PortConstraint} for the given edge. - *

- * This implementation accesses the {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} in - * {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}. - *

- * @param graph the input graph - * @param edge the edge - * @param index the index of the child that is the target of the given edge - * @returns the source {@link } or null if no source {@link } is specified - * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort - * @protected - */ - getSourcePortConstraint(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,index:number):yfiles.layout.PortConstraint; - /** - * Retrieves the target {@link yfiles.layout.PortConstraint} for the given edge. - *

- * This implementation accesses the {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignParentEdgeTargetPort} in - * {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}. - *

- * @param graph the input graph - * @param edge the edge - * @returns the target {@link } or null if no target {@link } is specified - * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @see yfiles.tree.DefaultPortAssignment#assignParentEdgeTargetPort - * @protected - */ - getTargetPortConstraint(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; - /** - * Gets or sets the mode that describes how ports are placed. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified - * @type {yfiles.tree.PortAssignmentMode} - */ - mode:yfiles.tree.PortAssignmentMode; - /** - * Gets or sets the ratio of the border gap (distance between the outer ports to the node border) to the port gap (distance between adjacent - * ports). - *

- * The ratio must have a positive value. When the ratio is 0 the ports will be distributed along the whole side of the node - * without a gap between the last port and the corner. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is negative - * @type {number} - */ - borderGapToPortGapRatio:number; - /** - * Gets or sets whether or not the port assignment should reverse the order of the ports. - *

- * The normal order is from left to right and from top to bottom. It will be reversed if this option is enabled. - *

- * @type {boolean} - */ - reversedPortOrder:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DefaultPortAssignment; - } - /** - * {@link yfiles.tree.DelegatingNodePlacer} delegates the arrangement of the children to two different {@link yfiles.tree.INodePlacer}s. - *

- * Layout Style This {@link yfiles.tree.INodePlacer} can, for example, be used for creating mind maps or a playing schedule of a sports - * competition. {@graph {"ann":{"s":[130,30],"d":1},"n":[[662,400,[[669.97,424.35,114.05,18.7]]],[662,175,[[669.97,199.35,114.05,18.7]]],[662,625,[[685.65,649.35,82.7,18.7]]],[812,175,[[829.98,199.35,94.04,18.7]]],[982,275,[[999.98,299.35,94.04,18.7]]],[812,625,[[835.65,649.35,82.7,18.7]]],[512,175,[[519.97,199.35,114.05,18.7]]],[982,725,[[1010.64,749.35,72.71,18.7]]],[1152,775,[[1180.64,799.35,72.71,18.7]]],[1322,800,[[1341.97,824.35,90.05,18.7]]],[982,75,[[1004.32,99.35,85.37,18.7]]],[1152,675,[[1163.65,699.35,106.71,18.7]]],[1152,325,[[1177.32,349.35,79.36,18.7]]],[982,525,[[1005.65,549.35,82.7,18.7]]],[1152,125,[[1190.32,149.35,53.37,18.7]]],[1152,575,[[1175.65,599.35,82.7,18.7]]],[1322,350,[[1347.32,374.35,79.36,18.7]]],[1322,150,[[1343.65,174.35,86.7,18.7]]],[1322,300,[[1347.32,324.35,79.36,18.7]]],[1152,225,[[1169.98,249.35,94.04,18.7]]],[1152,25,[[1174.32,49.35,85.37,18.7]]],[342,75,[[372.66,99.35,68.69,18.7]]],[1152,475,[[1165.65,499.35,102.7,18.7]]],[1322,500,[[1326,524.35,122.06,18.7]]],[1322,250,[[1339.98,274.35,94.04,18.7]]],[1322,600,[[1330.31,624.35,113.38,18.7]]],[172,25,[[188.64,49.35,96.72,18.7]]],[342,275,[[349.97,299.35,114.05,18.7]]],[2,0,[[26.32,24.35,81.36,18.7]]],[1322,550,[[1345.65,574.35,82.7,18.7]]],[172,125,[[202.66,149.35,68.69,18.7]]],[1322,200,[[1344.32,224.35,85.36,18.7]]],[2,100,[[32.32,124.35,69.37,18.7]]],[1322,450,[[1335.65,474.35,102.7,18.7]]],[1322,750,[[1350.64,774.35,72.71,18.7]]],[512,625,[[532.65,649.35,88.69,18.7]]],[172,225,[[179.97,249.35,114.05,18.7]]],[1322,700,[[1329.63,724.35,114.74,18.7]]],[172,325,[[200.98,349.35,72.03,18.7]]],[1322,50,[[1344.32,74.35,85.37,18.7]]],[2,300,[[4.98,324.35,124.05,18.7]]],[2,50,[[18.64,74.35,96.72,18.7]]],[2,150,[[32.66,174.35,68.69,18.7]]],[1322,650,[[1333.65,674.35,106.71,18.7]]],[1322,0,[[1356.66,24.35,60.69,18.7]]],[1322,100,[[1360.32,124.35,53.37,18.7]]],[342,525,[[347.31,549.35,119.39,18.7]]],[172,475,[[171.97,499.35,130.06,18.7]]],[2,350,[[30.98,374.35,72.03,18.7]]],[2,450,[[1.97,474.35,130.06,18.7]]],[342,725,[[362.65,749.35,88.69,18.7]]],[2,200,[[25.31,224.35,83.37,18.7]]],[172,575,[[177.31,599.35,119.39,18.7]]],[172,675,[[197.32,699.35,79.35,18.7]]],[2,500,[[15.98,524.35,102.04,18.7]]],[2,550,[[14.63,574.35,104.73,18.7]]],[2,600,[[7.31,624.35,119.39,18.7]]],[2,250,[[9.97,274.35,114.05,18.7]]],[172,775,[[192.65,799.35,88.69,18.7]]],[2,750,[[22.65,774.35,88.69,18.7]]],[2,800,[[16.64,824.35,100.72,18.7]]],[2,650,[[11.97,674.35,110.07,18.7]]],[2,700,[[27.32,724.35,79.35,18.7]]]],"e":[[0,1],[0,2],[1,3],[3,4,[954,190,954,290]],[2,5],[1,6],[5,7,[954,640,954,740]],[7,8,[1124,740,1124,790]],[8,9,[1294,790,1294,815]],[3,10,[954,190,954,90]],[7,11,[1124,740,1124,690]],[4,12,[1124,290,1124,340]],[5,13,[954,640,954,540]],[10,14,[1124,90,1124,140]],[13,15,[1124,540,1124,590]],[12,16,[1294,340,1294,365]],[14,17,[1294,140,1294,165]],[12,18,[1294,340,1294,315]],[4,19,[1124,290,1124,240]],[10,20,[1124,90,1124,40]],[6,21,[500,190,500,90]],[13,22,[1124,540,1124,490]],[22,23,[1294,490,1294,515]],[19,24,[1294,240,1294,265]],[15,25,[1294,590,1294,615]],[21,26,[330,90,330,40]],[6,27,[500,190,500,290]],[26,28,[160,40,160,15]],[15,29,[1294,590,1294,565]],[21,30,[330,90,330,140]],[19,31,[1294,240,1294,215]],[30,32,[160,140,160,115]],[22,33,[1294,490,1294,465]],[8,34,[1294,790,1294,765]],[2,35],[27,36,[330,290,330,240]],[11,37,[1294,690,1294,715]],[27,38,[330,290,330,340]],[20,39,[1294,40,1294,65]],[38,40,[160,340,160,315]],[26,41,[160,40,160,65]],[30,42,[160,140,160,165]],[11,43,[1294,690,1294,665]],[20,44,[1294,40,1294,15]],[14,45,[1294,140,1294,115]],[35,46,[500,640,500,540]],[46,47,[330,540,330,490]],[38,48,[160,340,160,365]],[47,49,[160,490,160,465]],[35,50,[500,640,500,740]],[36,51,[160,240,160,215]],[46,52,[330,540,330,590]],[50,53,[330,740,330,690]],[47,54,[160,490,160,515]],[52,55,[160,590,160,565]],[52,56,[160,590,160,615]],[36,57,[160,240,160,265]],[50,58,[330,740,330,790]],[58,59,[160,790,160,765]],[58,60,[160,790,160,815]],[53,61,[160,690,160,665]],[53,62,[160,690,160,715]]],"vp":[1.0,0.0,1451.0,830.0]}} - *

- *

- * There are two subtrees that are placed above and below the root; Both subtrees consist of two subtrees that are placed - * left and right of their local root - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface DelegatingNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class DelegatingNodePlacer { - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with default settings using the given modification matrix and the - * given node placers as delegates. - * @param modificationMatrix the transformation matrix - * @param placerUpperLeft the first delegate {@link } which places the left subtrees - * @param placerLowerRight the second delegate {@link } which places the right subtrees - * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,placerUpperLeft:yfiles.tree.INodePlacer,placerLowerRight:yfiles.tree.INodePlacer); - /** - * Returns all upper-left children of the local root node. - *

- * Which children belong to this list is determined using the {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY}. If no such {@link yfiles.algorithms.IDataProvider} is registered, the - * first half of the children is returned. - *

- *

- * These children are placed using the {@link yfiles.tree.INodePlacer} returned by {@link yfiles.tree.DelegatingNodePlacer#primaryPlacer}. - *

- * @param localRoot the local root node - * @param graph the input graph - * @returns the list of upper-left child {@link }s - * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY - */ - primaryChildren(localRoot:yfiles.algorithms.Node,graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; - /** - * Returns all lower-right children of the local root node. - *

- * Which children belong to this list is determined using the {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY}. If no such {@link yfiles.algorithms.IDataProvider} is registered, the - * second half of the children is returned. - *

- *

- * These children are placed using the {@link yfiles.tree.INodePlacer} returned by {@link yfiles.tree.DelegatingNodePlacer#secondaryPlacer}. - *

- * @param localRoot the local root node - * @param graph the input graph - * @returns the list of lower-right child {@link }s - * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY - */ - secondaryChildren(localRoot:yfiles.algorithms.Node,graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; - /** - * Data provider key for dividing the children into two sets - *

- * If there is no {@link yfiles.algorithms.IDataProvider} registered with this key, half of the nodes are placed left of the root - * and the remaining nodes are placed right of the root. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PRIMARY_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets the {@link yfiles.tree.INodePlacer} instance that will arrange the lower-right part of the graph. - * @see yfiles.tree.DelegatingNodePlacer#primaryPlacer - * @see yfiles.tree.DelegatingNodePlacer#secondaryChildren - * @type {yfiles.tree.INodePlacer} - */ - secondaryPlacer:yfiles.tree.INodePlacer; - /** - * Gets the {@link yfiles.tree.INodePlacer} instance that will arrange the upper-left part of the graph. - * @see yfiles.tree.DelegatingNodePlacer#secondaryPlacer - * @see yfiles.tree.DelegatingNodePlacer#primaryChildren - * @type {yfiles.tree.INodePlacer} - */ - primaryPlacer:yfiles.tree.INodePlacer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DelegatingNodePlacer; - } - /** - * The {@link yfiles.tree.DendrogramNodePlacer} arranges subtrees as dendrograms. - *

- * Layout Style This {@link yfiles.tree.INodePlacer} arranges nodes from top to bottom. It arranges subtrees in such a way that all subtrees of - * a single local root are aligned with their bottom border. {@graph {"ann":{"s":[30,30],"d":1},"n":[[212.5,0],[400,70],[450,140],[300,210],[400,210],[450,210],[150,140],[25,70],[200,280],[150,280],[50,210],[450,280],[350,280],[25,140],[100,210],[400,280],[0,280],[300,280],[50,280],[100,280],[250,280]],"e":[[0,1,[227.5,50,415,50]],[1,2,[415,120,465,120]],[0,3,[227.5,50,315,50]],[1,4],[2,5],[0,6,[227.5,50,165,50]],[0,7,[227.5,50,40,50]],[6,8,[165,190,215,190]],[6,9],[5,11],[1,12,[415,120,365,120]],[7,13],[13,10,[40,190,65,190]],[6,14,[165,190,115,190]],[4,15],[13,16,[40,190,15,190]],[3,17],[10,18],[14,19],[0,20,[227.5,50,265,50]]],"vp":[0.0,0.0,480.0,310.0]}} - *

- *

- * Note: This implementation does not support {@link yfiles.layout.PortConstraint}s. - *

- * @class - * @implements {yfiles.tree.IFromSketchNodePlacer} - */ - export interface DendrogramNodePlacer extends yfiles.lang.Object,yfiles.tree.IFromSketchNodePlacer{} - export class DendrogramNodePlacer { - /** - * Creates a new {@link yfiles.tree.DendrogramNodePlacer} instance with default settings. - */ - constructor(); - /** - * Creates a {@link yfiles.collections.IComparer.} that sorts outgoing edges according to the x-coordinate of their target nodes. - *

- * This {@link yfiles.collections.IComparer.} can be used for achieving a From Sketch layout. - *

- * @returns the {@link } - * @see yfiles.tree.DendrogramNodePlacer#createFromSketchComparer - */ - createComparer():yfiles.collections.IComparer; - /** - * Creates a {@link yfiles.collections.IComparer.} for the edges which takes the initial x-coordinates of the nodes into account. - *

- * This implementation delegates to {@link yfiles.tree.DendrogramNodePlacer#createComparer}. - *

- * @returns the {@link } for the edges - * @see yfiles.tree.DendrogramNodePlacer#createComparer - */ - createFromSketchComparer():yfiles.collections.IComparer; - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This implementation returns null. Hence, no pre- or post-processing is done. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns null - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Provides {@link yfiles.tree.ParentConnectorDirection#NORTH} for all children. - *

- * Edges will always connect to the top of the child nodes. - *

- * @param localRoot the local root node - * @param connectorMap the map that is used for storing the direction specifiers of the child nodes - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Arranges the {@link yfiles.tree.SubtreeShape SubtreeShapes} of the local root and its children as a dendrogram. - * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the combined shape of the whole subtree rooted at the given local root node - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - /** - * Gets or sets the minimum distance between the {@link yfiles.tree.SubtreeShape} of a root node and the bus connecting to all of - * its children. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - minimumRootDistance:number; - /** - * Gets or sets the minimum horizontal distance between adjacent {@link yfiles.tree.SubtreeShape SubtreeShapes}. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - minimumSubtreeDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DendrogramNodePlacer; - } - /** - * The {@link yfiles.tree.DoubleLineNodePlacer} arranges the children of a local root alternating in two lines. - *

- * Layout Style This {@link yfiles.tree.INodePlacer} arranges nodes from top to bottom. It places the subtrees in two horizontal lines below - * the root. They are distributed in an alternating fashion, i.e., adjacent subtrees are in different lines. - *

- *

- * This node placer is especially useful for leaves with a large width. - *

- *

- * {@graph {"ann":{"s":[141.67,30],"d":1},"n":[[298.33,0,60,30],[0,60],[85.83,99.9],[171.67,60],[257.5,99.9],[343.33,60],[429.17,99.9],[515,60]],"e":[[0,1,[70.83,15]],[0,2,[156.67,15]],[0,3,[242.5,15]],[0,4],[0,5,[414.17,15]],[0,6,[500,15]],[0,7,[585.83,15]]],"vp":[0.0,0.0,657.0,130.0]}} - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface DoubleLineNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class DoubleLineNodePlacer { - /** - * Creates a new {@link yfiles.tree.DoubleLineNodePlacer} instance whose direction is specified by the given modification matrix. - * @param modificationMatrix the transformation matrix for this {@link } - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.DoubleLineNodePlacer} instance with the default settings. - */ - constructor(); - /** - * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. - * @type {yfiles.tree.RootNodeAlignment} - */ - rootAlignment:yfiles.tree.RootNodeAlignment; - /** - * Gets or sets the ratio of the {@link yfiles.tree.RotatableNodePlacerBase#spacing spacing} between the root and the children in the upper line and the spacing between the - * two lines of subtrees. - * @type {number} - */ - doubleLineSpacingRatio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DoubleLineNodePlacer; - } - /** - * A {@link yfiles.tree.FreeNodePlacer} is a simple pseudo-placer. - *

- * The children of local root nodes are not moved. The {@link yfiles.tree.INodePlacer} just merges their rotated shapes and routes - * the edges. - *

- *

- * This {@link yfiles.tree.INodePlacer} may be useful if a local root node does not have any children or you want to place them - * manually. - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface FreeNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class FreeNodePlacer { - /** - * Creates a new instance of {@link yfiles.tree.FreeNodePlacer} with default settings. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.FreeNodePlacer; - } - /** - * The {@link yfiles.tree.GridNodePlacer} arranges the shapes of the children of a local root in a grid. - *

- * Layout Style The grid consists of a number of rows. The subtrees are assigned to the rows using a {@link yfiles.algorithms.IDataProvider} - * that is registered with the graph with {@link yfiles.tree.GridNodePlacer#ROW_INDEX_DP_KEY}. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[50,140],[50,210],[50,70],[100,140],[100,210],[100,70],[150,140],[150,210],[150,70],[200,140],[200,210],[200,70]],"e":[[0,1,[40,15,40,120,65,120]],[0,2,[40,15,40,190,65,190]],[0,3,[40,15,40,50,65,50]],[0,4,[40,15,40,120,115,120]],[0,5,[40,15,40,190,115,190]],[0,6,[40,15,40,50,115,50]],[0,7,[40,15,40,120,165,120]],[0,8,[40,15,40,190,165,190]],[0,9,[40,15,40,50,165,50]],[0,10,[40,15,40,120,215,120]],[0,11,[40,15,40,190,215,190]],[0,12,[40,15,40,50,215,50]]],"vp":[0.0,0.0,230.0,240.0]}} - *

- *

- * Child nodes placed in a grid using three rows and four columns - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface GridNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class GridNodePlacer { - /** - * Creates a new {@link yfiles.tree.GridNodePlacer} instance with the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} and {@link yfiles.tree.GridNodePlacer#rootAlignment root alignment}. - * @param modificationMatrix the transformation matrix for this {@link } - * @param rootAlignment the alignment of the local root with its subtrees - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,rootAlignment:yfiles.tree.RootNodeAlignment); - /** - * Creates a new {@link yfiles.tree.GridNodePlacer} instance whose direction is specified by the given modification matrix. - * @param modificationMatrix the transformation matrix for this {@link } - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.GridNodePlacer} with default settings. - */ - constructor(); - /** - * Data provider key for assigning nodes to the rows in the grid - *

- * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all nodes will be placed in the same row. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ROW_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. - * @type {yfiles.tree.RootNodeAlignment} - */ - rootAlignment:yfiles.tree.RootNodeAlignment; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.GridNodePlacer; - } - /** - * This {@link yfiles.tree.INodePlacer} places the children of a local root in groups. - *

- * The groups are determined by the grouping of the edges that connect the children to its root. The placement of the - * groups is specified by a {@link yfiles.tree.INodePlacer} which will consider grouped children as one child. The children within - * a group are placed by another {@link yfiles.tree.INodePlacer}. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[70.15,0,91.19,30],[0,91],[111,91],[201.5,91],[0,141],[111,141],[201.5,141]],"e":[[0,1,-30,15,0,0,[85.75,50,50,50,50,106]],[0,2,0,15,0,0,[115.75,50,91,50,91,106]],[0,3,30,15,0,0,[145.75,50,181.5,50,181.5,106]],[0,4,-30,15,0,0,[85.75,50,50,50,50,156]],[0,5,0,15,0,0,[115.75,50,91,50,91,156]],[0,6,30,15,0,0,[145.75,50,181.5,50,181.5,156]]],"vp":[0.0,0.0,232.0,171.0]}} There are three edge groups whose target nodes are placed above each other - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @class - * @implements {yfiles.tree.INodePlacer} - */ - export interface GroupedNodePlacer extends yfiles.lang.Object,yfiles.tree.INodePlacer{} - export class GroupedNodePlacer { - /** - * Creates a new {@link yfiles.tree.GroupedNodePlacer} instance. - * @param groupPlacer the {@link } which places the child groups - * @param childPlacer the {@link } which places the children within their group - */ - constructor(groupPlacer:yfiles.tree.INodePlacer,childPlacer:yfiles.tree.INodePlacer); - /** - * Creates a {@link yfiles.tree.IProcessor} that prepares the graph for edge grouping. - *

- * In a pre-processing step, the {@link yfiles.tree.IProcessor} inserts a dummy node for each edge group and connects it to the - * local root and the edges of the according group. The child node placer is assigned to those dummy nodes and will arrange - * them during the layout calculation. - *

- *

- * The changes to the graph are restored in a post-processing step. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns the {@link } responsible for preparing the graph - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Delegates to the {@link yfiles.tree.INodePlacer} responsible for arranging the nodes in one group. - * @param localRoot the local root node - * @param connectorMap the map used for storing the direction specifiers of the child nodes - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Places the groups of {@link yfiles.tree.SubtreeShape}s according to their group IDs. - * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the merged {@link }s of the local root and its children - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.GroupedNodePlacer; - } - /** - * A {@link yfiles.tree.IFromSketchNodePlacer} arranges the subtrees while taking the initial locations of the nodes into account. - *

- * It provides a {@link yfiles.collections.IComparer.} which sorts the outgoing edges of a node according to the initial coordinates of their target nodes. - * Keeping the original order of nodes, this {@link yfiles.collections.IComparer.} allows to incrementally add new nodes to the graph. - *

- * @interface - * @implements {yfiles.tree.INodePlacer} - */ - export interface IFromSketchNodePlacer extends yfiles.lang.Object,yfiles.tree.INodePlacer{ - /** - * Creates an {@link yfiles.collections.IComparer. edge comparator} which takes the initial coordinates of the nodes into account. - *

- * This {@link yfiles.collections.IComparer.} defines the order of the outgoing edges of a node before the actual placement of the node's subtree is - * calculated. - *

- * @returns the {@link } for the edges - * @abstract - */ - createFromSketchComparer():yfiles.collections.IComparer; - } - var IFromSketchNodePlacer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.tree.IFromSketchNodePlacer; - }; - /** - * A {@link yfiles.tree.INodePlacer} is responsible for the arrangement of a local root node and all of its subtrees. - *

- * Subtrees are represented as {@link yfiles.tree.SubtreeShape SubtreeShape}s with a connecting edge to the root of the subtree. - *

- *

- * Implementations of this interface have to: - *

- *
    - *
  • - * arrange the {@link yfiles.tree.SubtreeShape SubtreeShapes} and the root node (only the relative position matters, shapes can be placed at any absolute - * location, {@link yfiles.tree.TreeLayout} will perform the final alignment). - *
  • - *
  • - * perform the edge routing from the root node to all child nodes with respect to the connector provided by the - * {@link yfiles.tree.SubtreeShape SubtreeShapes} - *
  • - *
  • calculate the union of the {@link yfiles.tree.SubtreeShape SubtreeShapes} and the shape of the root node as well as any added edges
  • - *
  • initialize the connector of the root node with respect to the preferred connection direction
  • - *
  • return the {@link yfiles.tree.SubtreeShape SubtreeShape} for the subtree including the local root
  • - *
- * @interface - */ - export interface INodePlacer extends yfiles.lang.Object{ - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This method is called by {@link yfiles.tree.TreeLayout} before arranging the {@link yfiles.tree.SubtreeShape SubtreeShapes}. If no pre- or post-processing is - * needed, this method may return null. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns a {@link } instance or null - * @abstract - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. - *

- * This method is called by {@link yfiles.tree.TreeLayout} before the {@link yfiles.tree.SubtreeShape SubtreeShapes} for the children of the local root node are - * calculated. The direction specifiers are stored in the given map for all child nodes of the local root. - *

- * @param localRoot the local root node - * @param connectorMap the map that must be used for storing the direction specifiers of the child nodes - * @abstract - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Arranges the {@link yfiles.tree.SubtreeShape SubtreeShapes} of the local root and its children and routes the edges that connect them. - *

- * This method is the main method of the tree layout algorithm. It is called by {@link yfiles.tree.TreeLayout} in each recursion - * step to place the local root in relation to its children. Their shapes will be merged into one - * {@link yfiles.tree.SubtreeShape SubtreeShape}, which is returned by this method. - *

- *

- * The {@link yfiles.tree.SubtreeShape SubtreeShape} for the local root can be obtained from the nodeShapeProvider. subtreeShapeProvider contains the {@link yfiles.tree.SubtreeShape SubtreeShapes} - * assigned to the child nodes. - *

- *

- * Due to the order in which the tree nodes are processed, it is guaranteed that at the time of the invocation of this - * method the {@link yfiles.tree.SubtreeShape SubtreeShape} of every descendant node has already been calculated. - *

- * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the combined shape of the whole subtree - * @abstract - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - } - var INodePlacer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.tree.INodePlacer; - }; - /** - * A {@link yfiles.tree.IPortAssignment} places the ports of edges connecting to the same node. - *

- * Classes implementing this interface are responsible for the assignment of the edges' ports. {@link yfiles.tree.INodePlacer} - * instances need to obey the currently set ports. - *

- * @interface - */ - export interface IPortAssignment extends yfiles.lang.Object{ - /** - * Places the ports of edges connecting to the given node. - *

- * This method is called by {@link yfiles.tree.TreeLayout} before the actual layout calculation takes place. It assigns both the - * single incoming edge's target port as well as all source ports of all outgoing child edges. - *

- * @param graph the graph - * @param node the node whose adjacent edges' ports should be set - * @abstract - */ - assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - } - var IPortAssignment:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.tree.IPortAssignment; - }; - /** - * A {@link yfiles.tree.IProcessor} provides the possibility for each {@link yfiles.tree.INodePlacer} to prepare (and clean up) the graph - * for the children of the local root. - *

- * It is created by {@link yfiles.tree.INodePlacer#createProcessor} and called by the {@link yfiles.tree.TreeLayout} before and after the - * actual arrangement of the nodes. - *

- *

- * A {@link yfiles.tree.IProcessor} may change values within the - * {@link yfiles.algorithms.IDataMap}s for its children. It can also temporarily change the graph by hiding nodes or adding dummy - * nodes. - *

- * @interface - */ - export interface IProcessor extends yfiles.lang.Object{ - /** - * This method is called by the {@link yfiles.tree.TreeLayout} after the layout has finished. - *

- * It can be used for cleanup tasks. - *

- *

- * Changes on the graph structure that have been made in {@link yfiles.tree.IProcessor#preProcess} can be undone here. - *

- * @abstract - */ - postProcess():void; - /** - * Performs preparations for the actual tree layout in a pre-processing step. - *

- * This method is called by {@link yfiles.tree.TreeLayout} before the {@link yfiles.tree.INodePlacer}s are called recursively. A {@link yfiles.tree.IProcessor} - * may change some settings within this method. This can be used for specifying values for the children of the local root, - * manipulate the graph structure or do anything else that needs to be done. - *

- * @param nodePlacerDataProvider the map that stores a {@link } instance for each node - * @param portAssignmentDataProvider The map that stores a {@link } instance for each node - * @param childComparatorProvider the map that stores a {@link } instance for each node - * @abstract - */ - preProcess(nodePlacerDataProvider:yfiles.algorithms.IDataMap,portAssignmentDataProvider:yfiles.algorithms.IDataMap,childComparatorProvider:yfiles.algorithms.IDataMap):void; - } - var IProcessor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.tree.IProcessor; - }; - /** - * A {@link yfiles.tree.LayeredNodePlacer} arranges the nodes of a subtree respecting layers. - *

- * Layout Style Nodes that have the same depth in the tree will be placed in the same horizontal layer. They will be vertically - * {@link yfiles.tree.LayeredNodePlacer#verticalAlignment aligned}. {@graph {"ann":{"s":[30,30],"d":1},"n":[[245.52,0],[69.46,77.5],[7.5,162.5],[181.42,240,45,45],[57.5,155,45,45],[0,240,45,45],[246.42,77.5],[406.58,70,45,45],[181.42,155,45,45],[246.42,155,45,45],[375.88,247.5],[7.5,332.5],[122.5,158.04,38.92,38.92],[409.62,158.04,38.92,38.92],[311.42,162.5],[65,247.5],[443.38,243.04,38.92,38.92],[138.92,332.5],[338.92,325,45,45],[311.42,247.5],[403.92,328.04,38.92,38.92],[188.92,332.5],[238.92,332.5]],"e":[[0,1,[260.52,42,84.46,42]],[1,2,[84.46,127,22.5,127]],[1,4,[84.46,127,80,127]],[2,5],[0,6,[260.52,42,261.42,42]],[0,7,[260.52,42,429.08,42]],[6,8,[261.42,127,203.92,127]],[8,3],[6,9,[261.42,127,268.92,127]],[5,11],[1,12,[84.46,127,141.96,127]],[7,13],[13,10,[429.08,212,390.88,212]],[6,14,[261.42,127,326.42,127]],[4,15],[13,16,[429.08,212,462.83,212]],[3,17,[203.92,297,153.92,297]],[10,18,[390.88,297,361.42,297]],[14,19],[10,20,[390.88,297,423.38,297]],[3,21],[3,22,[203.92,297,253.92,297]]],"vp":[0.0,0.0,483.0,370.0]}} - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface LayeredNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class LayeredNodePlacer { - /** - * Creates a new {@link yfiles.tree.LayeredNodePlacer} instance whose direction is specified by the given modification matrix. - *

- * The given ID identifies different {@link yfiles.tree.LayeredNodePlacer} instances that share the same layer heights. - *

- * @param modificationMatrix the transformation matrix for this {@link } - * @param id the {@link } ID - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,id:any); - /** - * Creates a new {@link yfiles.tree.LayeredNodePlacer} instance with the default settings. - */ - constructor(); - /** - * Gets or sets whether or not the layering is done dendrogram-like. - *

- * When enabled, leaves are placed in the same layer and remaining tree nodes are assigned to a layer as close to their - * children as possible. - *

- * @type {boolean} - */ - dendrogramStyle:boolean; - /** - * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. - * @type {yfiles.tree.RootNodeAlignment} - */ - rootAlignment:yfiles.tree.RootNodeAlignment; - /** - * Gets or sets the relative vertical alignment of nodes within their respective layers. - *

- * A value of 0 means that nodes are top-aligned; a value of 0.5 means that nodes are center-aligned; a value of 1 means - * that nodes are bottom-aligned; - *

- *

- * Values for a valid vertical alignment are in the range [0..1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is outside [0..1] - * @type {number} - */ - verticalAlignment:number; - /** - * Gets the ID of this {@link yfiles.tree.LayeredNodePlacer}. - *

- * The ID is used for identifying - * {@link yfiles.tree.LayeredNodePlacer}s that share information about the layer height. Using different IDs allows aligned layouts - * within different subtrees. - *

- * @type {any} - */ - id:any; - /** - * Gets or sets the distance between two adjacent layers. - *

- * The spacing needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing is negative - * @type {number} - */ - layerSpacing:number; - /** - * Gets or sets the routing style for the edges in the subtree. - * @throws {Stubs.Exceptions.ArgumentError} if the specified routing style specifier is unknown - * @type {yfiles.tree.LayeredRoutingStyle} - */ - routingStyle:yfiles.tree.LayeredRoutingStyle; - /** - * Gets or sets the vertical bus alignment for orthogonally routed edges. - *

- * The bus alignment determines the relative position of an edge bus in between two subsequent layers of nodes. - *

- *

- * Values for a valid vertical alignment are in the range [0..1], such that: - *

- *
    - *
  • A value of 0.0 places the bus at the top, right below the parent node.
  • - *
  • A value of 0.5 places the bus in the middle between parent and child nodes.
  • - *
  • A value of 1.0 places the bus at the bottom, right above the child nodes.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is outside [0..1] - * @type {number} - */ - busAlignment:number; - /** - * Gets or sets whether or not straight edges are extended to avoid label overlaps. - *

- * If enabled, polyline connectors between the parent and its children are added to the according subtree shape. Node or - * edge labels will not be crossed. - *

- * @type {boolean} - */ - polylineLabeling:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.LayeredNodePlacer; - } - /** - * A {@link yfiles.tree.LeafNodePlacer} creates a {@link yfiles.tree.SubtreeShape SubtreeShape} for a leaf node and routes its incoming edge at the target side. - * @class - * @implements {yfiles.tree.INodePlacer} - */ - export interface LeafNodePlacer extends yfiles.lang.Object,yfiles.tree.INodePlacer{} - export class LeafNodePlacer { - /** - * Creates a new {@link yfiles.tree.LeafNodePlacer} instance with default settings. - */ - constructor(); - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This implementation returns null. Hence, no pre- or post-processing is done. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns null - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Does nothing because leaf nodes don't have children so there are no child connectors. - * @param localRoot the local root node - * @param connectorMap the map that must be used for storing the direction specifiers of the child nodes - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Creates a {@link yfiles.tree.SubtreeShape} for the local root node (a leaf node in this case) and adds target points to the - * incoming edge. - *

- * The incoming edge is routed according to possibly assigned {@link yfiles.layout.PortConstraint}s. - *

- * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the {@link } of the leaf node including the connector - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.LeafNodePlacer; - } - /** - * The {@link yfiles.tree.LeftRightNodePlacer} arranges the children in a subtree on the left and the right of a vertical bus. - *

- * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[35,0],[0,50],[70,50],[0,100],[70,100],[0,150],[70,150],[0,200],[70,200],[35,250]],"e":[[0,1,[50,65]],[0,2,[50,65]],[0,3,[50,115]],[0,4,[50,115]],[0,5,[50,165]],[0,6,[50,165]],[0,7,[50,215]],[0,8,[50,215]],[0,9]],"vp":[0.0,0.0,100.0,280.0]}} - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface LeftRightNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class LeftRightNodePlacer { - /** - * Creates a new {@link yfiles.tree.LeftRightNodePlacer} instance using the given modification matrix. - * @param modificationMatrix the transformation matrix for this {@link } - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.LeftRightNodePlacer} instance with default settings. - */ - constructor(); - /** - * Creates a special {@link yfiles.algorithms.IDataProvider} that determines whether a given node is placed left or right of the - * parent node. - *

- * This {@link yfiles.algorithms.IDataProvider} can be registered with the graph with key - * {@link yfiles.tree.LeftRightNodePlacer#LEFT_RIGHT_DP_KEY}. It calculates the side with respect to the initial coordinates of the - * nodes in the graph, considering the orientation of the subtree. - *

- *

- * If a node is assigned to the left side, this {@link yfiles.algorithms.IDataProvider} will return true. For the right side, it - * will return false. - *

- * @param nodePlacerMap a {@link } containing the corresponding {@link }s for the node - * @returns - * @static - */ - static createLeftRightDataProvider(nodePlacerMap:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; - /** - * Data provider key for assigning nodes to the left or the right side of the bus - *

- * If no {@link yfiles.algorithms.IDataProvider} is specified using this key, the nodes will be placed alternating from left to - * right. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LEFT_RIGHT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the horizontal distance between nodes or subtrees. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - horizontalDistance:number; - /** - * Gets or sets the vertical distance between nodes or subtrees. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - verticalDistance:number; - /** - * Sets a uniform horizontal and vertical spacing between subtrees. - *

- * This method sets the given distance value for the {@link yfiles.tree.LeftRightNodePlacer#horizontalDistance horizontal spacing} and for the {@link yfiles.tree.LeftRightNodePlacer#verticalDistance vertical spacing}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing value is negative - * @see yfiles.tree.LeftRightNodePlacer#horizontalDistance - * @see yfiles.tree.LeftRightNodePlacer#verticalDistance - * @type {number} - */ - spacing:number; - /** - * Gets or sets whether or not the last child is placed centered, aligned with the bus and below the other child nodes. - *

- * When enabled, the last child will always be centered independent of the number of siblings. - *

- * @type {boolean} - */ - placeLastOnBottom:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.LeftRightNodePlacer; - } - /** - * The {@link yfiles.tree.MultiParentDescriptor} provides style information for multi-parent structures. - *

- * This class is used by {@link yfiles.tree.TreeLayout} to determine the desired layout of nodes that constitute a multi-parent - * structure. All nodes of such a structure are placed side by side and the incident edges are routed over common points - * for incoming edges and for outgoing edges. - *

- *

- * {@graph {"ann":{"s":[40,40],"d":1},"n":[[411.25,0],[682.5,85],[210,155],[612.5,165],[35,225],[577.5,235],[385,320.5],[682.5,155,40,60],[70,305],[210,85],[0,295,40,60],[0,385],[210,225],[700,320.5],[175,295],[245,295],[315,225],[752.5,165],[420,405.5],[647.5,235],[752.5,235],[770,406],[140,380.5,40,60],[210,390.5],[315,295,40,60],[490,405.5],[175,485.5],[455,320.5],[481.25,0],[700,406],[560,406],[630,406],[560,491],[630,491],[525,320.5],[280,380.5,40,60],[70,390.5]],"e":[[0,1,[431.25,55.5,466.25,55.5,466.25,70,702.5,70]],[1,3,[702.5,140,632.5,140]],[2,4,[230,210,55,210]],[3,5,[632.5,220,597.5,220]],[5,6,[597.5,290,475,290,475,305,405,305]],[1,7],[4,8,[55,280,90,280]],[0,9,[431.25,55.5,466.25,55.5,466.25,70,230,70]],[9,2],[4,10,[55,280,20,280]],[10,11],[2,12],[5,13,[597.5,290,720,290]],[12,14,[230,280,195,280]],[12,15,[230,280,265,280]],[2,16,[230,210,335,210]],[1,17,[702.5,140,772.5,140]],[6,18,[405,376,475,376,475,390.5,440,390.5]],[3,19,[632.5,220,667.5,220]],[17,20],[13,21,[720,375.5,790,375.5]],[14,22,[195,365,160,365]],[14,23,[195,365,230,365]],[16,24],[6,25,[405,376,475,376,475,390.5,510,390.5]],[22,26,[160,456,195,456]],[23,26,[230,456,195,456]],[5,27,[597.5,290,475,290]],[27,18,[475,390.5,440,390.5]],[27,25,[475,390.5,510,390.5]],[28,9,[501.25,55.5,466.25,55.5,466.25,70,230,70]],[28,1,[501.25,55.5,466.25,55.5,466.25,70,702.5,70]],[13,29],[13,30,[720,375.5,615,375.5,615,390.5,580,390.5]],[13,31,[720,375.5,615,375.5,615,390.5,650,390.5]],[30,32,[580,461.5,615,461.5,615,476,580,476]],[31,32,[650,461.5,615,461.5,615,476,580,476]],[30,33,[580,461.5,615,461.5,615,476,650,476]],[31,33,[650,461.5,615,461.5,615,476,650,476]],[5,34,[597.5,290,475,290,475,305,545,305]],[34,18,[545,376,475,376,475,390.5,440,390.5]],[34,25,[545,376,475,376,475,390.5,510,390.5]],[14,35,[195,365,300,365]],[35,26,[300,456,195,456]],[14,36,[195,365,90,365]],[36,26,[90,456,195,456]]],"vp":[0.0,0.0,810.0,531.0]}} - *

- *

- * A tree graph containing multi-parent structures - *

- * @see yfiles.tree.TreeLayout#MULTI_PARENT_DESCRIPTOR_DP_KEY - * @class - */ - export interface MultiParentDescriptor extends yfiles.lang.Object{} - export class MultiParentDescriptor { - /** - * Creates a new {@link yfiles.tree.MultiParentDescriptor} instance with default settings. - */ - constructor(); - /** - * Gets or sets the minimum distance between two nodes belonging to the same multi-parent structure. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given node distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets the minimum distance between the nodes of a multi-parent structure and the bus connecting these nodes. - *

- * In case the edge style is not orthogonal, the bus only consists of a common point. - *

- *

- * The minimum distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given bus distance is negative - * @type {number} - */ - minimumBusDistance:number; - /** - * Gets or sets the relative vertical alignment of nodes belonging to the same multi-parent structure. - *

- * A value of 0 means that nodes are top-aligned; a value of 1 means that nodes are bottom-aligned; a value of 0.5 means - * that nodes are center-aligned. - *

- *

- * Values outside the interval [0,1] will result in a compact node placement with unaligned nodes, especially when labels - * are considered. - *

- * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets the routing style for edges that connect to nodes which constitute a multi-parent structure. - * @throws {Stubs.Exceptions.ArgumentError} if the given routing style is unknown - * @type {yfiles.tree.MultiParentRoutingStyle} - */ - edgeStyle:yfiles.tree.MultiParentRoutingStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.MultiParentDescriptor; - } - /** - * The {@link yfiles.tree.NodeOrderComparer} compares edges according to a specified order. - *

- * It obtains the order from a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY}. - *

- *

- * Various tree layout algorithms can use this {@link yfiles.collections.IComparer.} to influence the resulting layout. To achieve this, use this comparator and - * assign it to the comparator property of the layout algorithm classes. - *

- * @see yfiles.tree.ClassicTreeLayout#comparer - * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer - * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY - * @see yfiles.tree.BalloonLayout#comparer - * @see yfiles.tree.AspectRatioTreeLayout#comparer - * @see yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY - * @class - * @implements {yfiles.collections.IComparer.} - */ - export interface NodeOrderComparer extends yfiles.lang.Object,yfiles.collections.IComparer{} - export class NodeOrderComparer { - /** - * Creates a new {@link yfiles.tree.NodeOrderComparer} instance. - */ - constructor(); - /** - * Compares two edges according to their index in the order specified using a {@link yfiles.algorithms.IDataProvider}. - *

- * Target nodes for which the {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY} - * returns null or an {@link any} that does not implement {@link yfiles.lang.IComparable} are treated as being smaller than other target - * nodes. - *

- * @param edge1 the first edge - * @param edge2 the second edge - * @returns - * @see yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY - */ - compare(edge1:any,edge2:any):number; - /** - * Data provider key for registering an order for each node in the graph - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_ORDER_COMPARABLE_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.NodeOrderComparer; - } - /** - * Abstract base class for implementations of the {@link yfiles.tree.INodePlacer} interface. - *

- * This class provides convenience methods for sub-tasks that are often used during the arrangement of a local root and its - * children. It also offers prepared implementations for the methods of the {@link yfiles.tree.INodePlacer} interface. - *

- *

- * Subclasses just need to override the following two abstract methods: {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} and - * {@link yfiles.tree.NodePlacerBase#determineChildConnectors}. - *

- * @class - * @implements {yfiles.tree.INodePlacer} - * @implements {yfiles.lang.ICloneable} - */ - export interface NodePlacerBase extends yfiles.lang.Object,yfiles.tree.INodePlacer,yfiles.lang.ICloneable{} - export class NodePlacerBase { - /** - * Creates a new instance of {@link yfiles.tree.NodePlacerBase}. - */ - constructor(); - /** - * Returns a clone of this {@link yfiles.tree.INodePlacer} instance. - * @returns an exact copy of this {@link } instance - */ - clone():any; - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This implementation returns null. Hence, no pre- or post-processing will be done. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns null - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Determines a connector direction for the given child node. - *

- * This method is used in {@link yfiles.tree.NodePlacerBase#determineChildConnectors} and must be implemented by subclasses. - *

- * @param child the child node - * @returns a direction specifier as defined in the {@link } interface - * @protected - * @abstract - */ - determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; - /** - * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. - *

- * This implementation uses {@link yfiles.tree.NodePlacerBase#determineChildConnector} to retrieve the direction for the - * connectors. - *

- * @param localRoot the local root node - * @param connectorMap the map that must be used for storing the direction specifiers of the child nodes - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Returns the {@link yfiles.tree.SubtreeShape} for the given node. - *

- * This is a convenience method that retrieves a {@link yfiles.tree.SubtreeShape} for a single node from the corresponding - * {@link yfiles.algorithms.IDataProvider}. - *

- *

- * This method is used in {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} for retrieving the {@link yfiles.tree.SubtreeShape}s for - * the local root nodes. It may be overridden to return a custom implementation of {@link yfiles.tree.SubtreeShape}. - *

- * @param node the node - * @returns the {@link } for the given node - * @protected - */ - getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Returns the {@link yfiles.tree.SubtreeShape} for the subtree rooted at the given node. - *

- * This is a convenience method that retrieves a {@link yfiles.tree.SubtreeShape} of a complete subtree from the corresponding - * {@link yfiles.algorithms.IDataProvider}. - *

- *

- * This method is used in {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} for retrieving the {@link yfiles.tree.SubtreeShape}s for - * the subtrees that are arranged. It may be overridden to return a custom implementation of {@link yfiles.tree.SubtreeShape}. - *

- * @param node the local root node - * @returns the {@link } of the subtree rooted at the given local root node - * @protected - */ - getSubtreeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Initializes the local data structures and then delegates the work to the abstract variant of this method - * ({@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode}) - * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the merged {@link } for the subtree rooted at the local root node - * @see yfiles.tree.NodePlacerBase#placeSubtreeOfNode - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - /** - * Arranges the local root relative to the {@link yfiles.tree.SubtreeShape} of its children. - *

- * This is the main method that must be implemented by subclasses. It is called by - * {@link yfiles.tree.NodePlacerBase#placeSubtree}. - *

- * @param localRoot the local root node - * @param parentConnectorDirection the direction of the connector - * @returns a {@link } instance that describes the shape of the whole subtree rooted at the given local root - * @protected - * @abstract - */ - placeSubtreeOfNode(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - /** - * The graph instance this class is working on. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.NodePlacerBase; - } - /** - * A {@link yfiles.tree.RootNodeAlignment} describes how a local root node is arranged in relation to its children. - *

- * The actual placement depends on the orientation of the subtree rooted at the current local root node. All descriptions - * of the provided alignments refer to the top-to-bottom orientation described by - * {@link yfiles.tree.RotatableNodePlacerMatrix#DEFAULT}. In this case, the subtrees are placed below the local root and the local - * root is aligned horizontally above them. - *

- * @class - */ - export interface RootNodeAlignment extends yfiles.lang.Object{} - export class RootNodeAlignment { - /** - * Calculates the common bounds of the given subtree shapes. - *

- * This method can be used when placing the local root above its subtrees in method - * {@link yfiles.tree.RootNodeAlignment#placeParentHorizontal}. - *

- * @param shapes a list of rotated subtree shapes - * @returns the rectangle describing the bounds containing all given shapes - * @protected - * @static - */ - static getBounds(shapes:yfiles.collections.IList):yfiles.algorithms.Rectangle2D; - /** - * Moves the shape of the local root to a suitable position relative to the children's shapes. - *

- * The movement should only be done on the x-axis (horizontally). - *

- *

- * This method is called by {@link yfiles.tree.RotatableNodePlacerBase}s when they {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode place the subtrees}. - *

- * @param rootShape the shape of the local root node that will be moved - * @param shapes a list of rotated subtree shapes, representing the shapes of the child nodes - * @param shapeBounds accumulated bounds of the shapes of all child nodes - * @param spacing the spacing value that should be used - * @protected - * @abstract - */ - placeParentHorizontal(rootShape:yfiles.tree.RotatedSubtreeShape,shapes:yfiles.collections.IList,shapeBounds:yfiles.algorithms.Rectangle2D,spacing:number):void; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} at the center of the subtrees. - *

- * The root node is placed centered above its whole subgraph. To determine the alignment, only {@link yfiles.layout.INodeLayout}s - * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static CENTER:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} at the median child node. - *

- * The root node is placed above the median of its children. To determine the alignment, only {@link yfiles.layout.INodeLayout}s - * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static MEDIAN:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} left of the children. - *

- * The local root node leaves a distance specified by the given spacing to the leftmost child. To determine the alignment, - * only {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in - * {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static LEADING:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} right of the children. - *

- * The root node leaves a distance specified by the given spacing to the rightmost child. To determine the alignment, only - * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in - * {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static TRAILING:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} at the left side. - *

- * The root node is placed left aligned with its leftmost child. To determine the alignment, only - * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in - * {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static LEFT:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} at the right side. - *

- * The root node is placed right aligned with its rightmost child. To determine the alignment, only - * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in - * {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static RIGHT:yfiles.tree.RootNodeAlignment; - /** - * Horizontal alignment at the center of the children. - *

- * The root node is placed centered over its direct children. To determine the alignment, only {@link yfiles.layout.INodeLayout}s - * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static CENTER_OVER_CHILDREN:yfiles.tree.RootNodeAlignment; - /** - * An array containing all supported {@link yfiles.tree.RootNodeAlignment}s. - * @const - * @static - * @type {Array.} - */ - static ALL:yfiles.tree.RootNodeAlignment[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.RootNodeAlignment; - } - /** - * A matrix describes the rotation of the subtree handled by {@link yfiles.tree.RotatableNodePlacerBase}. - *

- * Subtrees may be rotated or mirrored. Also, matrices offering a combination of rotation and mirroring are provided. - *

- * @class - */ - export interface RotatableNodePlacerMatrix extends yfiles.lang.Object{} - export class RotatableNodePlacerMatrix { - /** - * Compares the values of the current {@link yfiles.tree.RotatableNodePlacerMatrix} with the values of the given - * {@link yfiles.tree.RotatableNodePlacerMatrix}. - * @param other the matrix - * @returns true if this matrix and the given other matrix contain the same values, false otherwise - */ - equalValues(other:yfiles.tree.RotatableNodePlacerMatrix):boolean; - /** - * Multiplies this {@link yfiles.tree.RotatableNodePlacerMatrix} with the given other {@link yfiles.tree.RotatableNodePlacerMatrix}. - * @param other the other matrix - * @returns the product of both matrices - */ - multiply(other:yfiles.tree.RotatableNodePlacerMatrix):yfiles.tree.RotatableNodePlacerMatrix; - /** - * The identity matrix which does not apply any rotation or mirroring. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static DEFAULT:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a counter-clockwise rotation by 90 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static ROT90:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a rotation by 180 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static ROT180:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a counter-clockwise rotation by 270 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static ROT270:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a horizontal mirroring. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static MIR_HOR:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a vertical mirroring. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static MIR_VERT:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a horizontal mirroring and a counter-clockwise rotation by 90 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static MIR_HOR_ROT90:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a vertical mirroring and a counter-clockwise rotation by 90 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static MIR_VERT_ROT90:yfiles.tree.RotatableNodePlacerMatrix; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.RotatableNodePlacerMatrix; - } - /** - * Abstract base class for {@link yfiles.tree.INodePlacer}s that support rotations of the subtrees. - *

- * The direction specified in this {@link yfiles.tree.RotatableNodePlacerBase} (defined by a - * {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix transformation matrix}) rotates the subtree that is placed. This is the final direction of this subtree. Rotations are - * not accumulated. - *

- *

- * {@link yfiles.tree.INodePlacer}s of this type will only implement the default direction (i.e. top-to-bottom). The other - * directions are calculated using the specified modification {@link yfiles.tree.RotatableNodePlacerMatrix}. The direction used by - * the implementing - * {@link yfiles.tree.INodePlacer}s is called the model direction while the actual direction in the graph is the real direction. - *

- *

- * Note that using rotatable {@link yfiles.tree.INodePlacer}s has some pitfalls. Calculations must be aware of the rotations. - * Especially operations on {@link yfiles.algorithms.BorderLine}s should not be called directly (e.g. - * {@link yfiles.algorithms.BorderLine#mergeWithMin}, {@link yfiles.algorithms.BorderLine#mergeWithMax}). The corresponding methods of {@link yfiles.tree.RotatableNodePlacerBase} - * already support the different directions. - *

- *

- * Subclasses just need to override the following two abstract methods: {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} - * and {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors}. - *

- * @class - * @implements {yfiles.tree.IFromSketchNodePlacer} - */ - export interface RotatableNodePlacerBase extends yfiles.lang.Object,yfiles.tree.IFromSketchNodePlacer{} - export class RotatableNodePlacerBase { - /** - * Creates a new instance of {@link yfiles.tree.RotatableNodePlacerBase} whose direction is specified by the given modification - * matrix. - * @param modificationMatrix the transformation matrix for the {@link } - * @protected - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a {@link yfiles.collections.IComparer.} for outgoing edges that takes the rotation into account. - * @returns the {@link } that considers the rotation - */ - createComparer():yfiles.collections.IComparer; - /** - * Delegates to {@link yfiles.tree.RotatableNodePlacerBase#createComparer}. - * @returns the From Sketch {@link } - * @see yfiles.tree.RotatableNodePlacerBase#createComparer - */ - createFromSketchComparer():yfiles.collections.IComparer; - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This implementation returns null. Hence, no pre- or post-processing is done. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns null - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Determines a connector direction for the given child node. - *

- * This method is called by {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors} and must be implemented by - * subclasses. Implementations can assume the default direction (top-to-bottom) for their arrangement. - *

- * @param child the child node - * @returns a direction specifier as defined in the {@link } interface - * @protected - * @abstract - */ - determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; - /** - * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. - *

- * This implementation uses {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnector} and the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} to - * retrieve the direction for the connectors. - *

- * @param localRoot the local root - * @param connectorMap the map that must be used for storing the direction specifiers of the child nodes - * @see yfiles.tree.RotatableNodePlacerBase#determineChildConnector - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Returns the rotated subtree shape for the given node. - *

- * This is a convenience method that retrieves a rotated subtree shape for a single node from the corresponding - * {@link yfiles.algorithms.IDataProvider}. This shape may be modified and returned by - * {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}. - *

- * @param node the node - * @returns the subtree shape for the given node - * @protected - */ - getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.RotatedSubtreeShape; - /** - * Returns the target {@link yfiles.layout.PortConstraint} for the local root's incoming edge. - *

- * This method translates the {@link yfiles.layout.PortConstraint} according to the rotation described by the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. - * It should be used instead of {@link yfiles.layout.PortConstraint#getTPC}. - *

- *

- * This method may be used in {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} to route the edges to the according - * port. It may be overridden to provide constant {@link yfiles.layout.PortConstraint}s for each node. - *

- * @param localRoot the local root - * @returns the {@link } for the incoming edge of the local root or {@link #ANY} if no {@link } - * is assigned for that edge - * @protected - */ - getPortConstraint(localRoot:yfiles.algorithms.Node):yfiles.layout.PortConstraint; - /** - * Returns the absolute source point of the given edge depending on the rotation of this {@link yfiles.tree.INodePlacer}. - *

- * This method translates the source point according to the rotation described by the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. It should be - * used instead of {@link yfiles.layout.LayoutGraph#getSourcePointAbs}. - *

- *

- * It can be used in an implementation of {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}. - *

- * @param edge the edge whose absolute source point should be calculated - * @returns the translated absolute source point for the given edge and current modification matrix - * @protected - */ - getSourcePointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the rotated subtree shape for the subtree rooted at the given node. - *

- * This is a convenience method that retrieves a subtree shape of a complete subtree from the corresponding - * {@link yfiles.algorithms.IDataProvider}. - *

- * @param node the local root node - * @returns the rotated subtree shape of the subtree rooted at the given local root node - * @protected - */ - getSubtreeShape(node:yfiles.algorithms.Node):yfiles.tree.RotatedSubtreeShape; - /** - * Initializes the local data structures and then delegates the work to the abstract variant of this method - * ({@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}). - * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the merged {@link } for the subtree rooted at the local root node - * @see yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - /** - * Arranges the local root relative to the rotated subtree shapes of its children. - *

- * This is the main method that must be implemented by subclasses. For calculations and locations subclasses should use the - * corresponding methods of {@link yfiles.tree.RotatableNodePlacerBase} which already consider the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. - *

- * @param localRoot the local root node - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the merged subtree shape that contains the local root node and all its children - * @protected - * @abstract - */ - placeSubtreeOfNode(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.RotatedSubtreeShape; - /** - * Translates the given real direction of the resulting layout to the model direction of this - * {@link yfiles.tree.RotatableNodePlacerBase}. - *

- * This method is used in {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} to be able to retrieve the model direction - * for the connector - *

- * @param realDirection the real direction - * @returns the model direction - * @throws {Stubs.Exceptions.ArgumentError} if translation for the given real direction is not implemented - * @protected - */ - translateDirectionToModel(realDirection:yfiles.tree.ParentConnectorDirection):number; - /** - * Translates the given model direction to the real direction in the resulting layout. - *

- * This method is used in {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors} to be able to return the real - * connector direction. - *

- * @param modelDirection the model direction - * @returns the real direction - * @throws {Stubs.Exceptions.ArgumentError} if translation for the given model direction is not implemented - * @protected - */ - translateDirectionToReal(modelDirection:yfiles.tree.ParentConnectorDirection):number; - /** - * Translates a point from the real layout direction to the model direction using the given modification matrix. - * @param modificationMatrix the modification matrix to use for the translation - * @param realWorldPoint the point with coordinates from the real world - * @returns the translated point with coordinates from the model - * @static - */ - static translatePoint(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,realWorldPoint:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * The graph instance this {@link yfiles.tree.INodePlacer} is working on. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * The provider of {@link yfiles.tree.SubtreeShape}s for whole subtrees. - * @protected - * @type {yfiles.algorithms.IDataProvider} - */ - subtreeShapeProvider:yfiles.algorithms.IDataProvider; - /** - * The provider of {@link yfiles.tree.SubtreeShape}s for single nodes. - * @protected - * @type {yfiles.algorithms.IDataProvider} - */ - nodeShapeProvider:yfiles.algorithms.IDataProvider; - /** - * The list containing the created children. - * @protected - * @type {yfiles.collections.IList.} - */ - createdChildren:yfiles.collections.IList; - /** - * Gets the modification matrix that defines the direction of the subtree. - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix; - /** - * Gets or sets the spacing between subtrees. - *

- * The spacing needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative - * @type {number} - */ - spacing:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.RotatableNodePlacerBase; - } - /** - * Decorates a SubtreeShape and provides rotated access on it. - * @class - */ - export interface RotatedSubtreeShape extends yfiles.lang.Object{} - export class RotatedSubtreeShape { - /** - * For testing purposes only - * @protected - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.RotatedSubtreeShape; - } - /** - * The {@link yfiles.tree.SimpleNodePlacer} arranges all children of a local root in a single row. - *

- * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[50,50],[235,50],[370,50],[720,50],[100,100],[770,100],[285,100],[420,50],[520,50],[570,100],[670,100],[150,150],[720,150],[470,100],[335,100],[620,150],[820,150],[520,150],[185,100]],"e":[[0,1,[65,15]],[0,2,[250,15]],[0,3,[385,15]],[0,4,[735,15]],[1,5,[115,65]],[4,6,[785,65]],[2,7,[300,65]],[0,8,[435,15]],[0,9,[535,15]],[9,10,[585,65]],[9,11,[685,65]],[5,12,[165,115]],[11,13,[735,115]],[8,14,[485,65]],[2,15,[350,65]],[10,16,[635,115]],[6,17,[835,115]],[14,18,[535,115]],[1,19,[200,65]]],"vp":[0.0,0.0,850.0,180.0]}} - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface SimpleNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class SimpleNodePlacer { - /** - * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance that uses the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} and {@link yfiles.tree.SimpleNodePlacer#rootAlignment root alignment}. - * @param modificationMatrix the transformation matrix for this {@link } - * @param rootAlignment the alignment for the local root in relation to its subtrees - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,rootAlignment:yfiles.tree.RootNodeAlignment); - /** - * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance that uses the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. - * @param modificationMatrix the transformation matrix for this {@link } - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance with default settings. - */ - constructor(); - /** - * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlignment} that defines how the root node is aligned with its children and their shapes. - * @type {yfiles.tree.RootNodeAlignment} - */ - rootAlignment:yfiles.tree.RootNodeAlignment; - /** - * Gets or sets the relative vertical alignment of nodes with the same parent. - *

- * All values between 0 and 1 result in a valid alignment. - *

- *
    - *
  • 0 - nodes are top-aligned
  • - *
  • 0.5 - nodes are center-aligned
  • - *
  • 1 - nodes are bottom-aligned
  • - *
- *

- * Values outside the interval [0,1] may result in a more compact node placement with unaligned nodes, especially when - * labels are considered. - *

- * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets whether or not a bus is created in the space between the parent and its children. - * @type {boolean} - */ - createBus:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.SimpleNodePlacer; - } - /** - * The {@link yfiles.tree.TreeComponentLayout} arranges tree-like subgraph structures in a mixed layout style. - *

- * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[-18.75,231.25],[56.25,231.25],[131.25,231.25],[-18.75,631.25],[631.25,231.25],[631.25,631.25],[131.25,631.25],[-18.75,-18.75],[631.25,-18.75],[631.25,131.25],[631.25,56.25],[131.25,406.25],[131.25,556.25],[447.5,75,1],[560,162.5,1],[497.5,162.5,1],[391.25,343.75,1],[328.75,343.75,1],[247.5,500,1],[247.5,587.5,1],[310,500,1],[310,587.5,1],[266.25,343.75,1],[272.5,75,1],[385,162.5,1],[322.5,162.5,1],[97.5,75,1],[210,162.5,1],[147.5,162.5,1]],"e":[[0,1,18.75,-0,-18.75,-0],[1,2,18.75,-0,-18.75,-0],[0,3,-0,18.75,-0,-18.75],[2,4,18.75,-0,-18.75,-0],[4,5,-0,18.75,-0,-18.75],[5,6,-18.75,-0,18.75,-0],[6,3,-18.75,-0,18.75,-0],[0,7,-0,-18.75,-0,18.75],[7,8,18.75,-0,-18.75,-0],[4,9,-0,-18.75,-0,18.75],[8,10,-0,18.75,-0,-18.75],[10,9,-0,18.75,-0,-18.75],[11,2,-0,-18.75,-0,18.75],[11,12,-0,18.75,-0,-18.75],[6,12,-0,-18.75,-0,18.75],[7,13,18.75,12.5,0,0,[52.5,12.5,52.5,50,466.25,50]],[13,14,-13.75,0,-0,-0,[452.5,137.5,578.75,137.5]],[13,15,-13.75,0,-0,-0,[452.5,137.5,516.25,137.5]],[2,16,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,410,318.75]],[2,17,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,347.5,318.75]],[11,18,18.75,-0,0,0,[202.5,425,202.5,475,266.25,475]],[11,19,18.75,-0,0,0,[202.5,425,202.5,562.5,266.25,562.5]],[11,20,18.75,-0,0,0,[202.5,425,202.5,475,328.75,475]],[11,21,18.75,-0,0,0,[202.5,425,202.5,562.5,328.75,562.5]],[2,22,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,285,318.75]],[7,23,18.75,12.5,0,0,[52.5,12.5,52.5,50,291.25,50]],[23,24,-13.75,0,-0,-0,[277.5,137.5,403.75,137.5]],[23,25,-13.75,0,-0,-0,[277.5,137.5,341.25,137.5]],[7,26,18.75,12.5,0,0,[52.5,12.5,52.5,50,116.25,50]],[26,27,-13.75,0,-0,-0,[102.5,137.5,228.75,137.5]],[26,28,-13.75,0,-0,-0,[102.5,137.5,166.25,137.5]]],"vp":[-19.0,-19.0,688.0,688.0]}} - *

- *

- * The tree components are marked - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface TreeComponentLayout extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class TreeComponentLayout { - /** - * Creates a new {@link yfiles.tree.TreeComponentLayout} instance using the specified layouter for arranging the subtrees. - * @param treeCoreLayouter the layout algorithm used for arranging the tree components - * @throws {Stubs.Exceptions.ArgumentError} if the specified layout algorithm is null - */ - constructor(treeCoreLayouter:yfiles.layout.ILayoutAlgorithm); - /** - * Finds the tree components inside the given graph and applies a {@link yfiles.tree.TreeComponentLayout#treeComponentCoreLayout tree layout} to them. - * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Delegates the layout calculation to the {@link yfiles.tree.TreeComponentLayout#coreLayout core layout algorithm} and handles the dummy nodes. - *

- * The dummy nodes are marked using the given {@link yfiles.algorithms.IDataProvider}. - *

- *

- * This implementation just registers the dummy node {@link yfiles.algorithms.IDataProvider} with the graph with key - * {@link yfiles.tree.TreeComponentLayout#DUMMY_NODE_DP_KEY}, executes the core layout algorithm and finally removes the data - * provider again. - *

- *

- * This method is called by {@link yfiles.tree.TreeComponentLayout#applyLayout} to invoke the core layout algorithm. It may be - * overridden to customize the handling of the dummy nodes. - *

- * @param graph the input graph - * @param dummyDp the {@link } which marks the dummy nodes - * @protected - */ - applyLayoutUsingDummies(graph:yfiles.layout.LayoutGraph,dummyDp:yfiles.algorithms.IDataProvider):void; - /** - * Data provider key for identifying dummy nodes during the layout calculation - *

- * This {@link yfiles.algorithms.IDataProvider} is registered and also removed in - * {@link yfiles.tree.TreeComponentLayout#applyLayoutUsingDummies}. - *

- * @see yfiles.tree.TreeComponentLayout#applyLayoutUsingDummies - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static DUMMY_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the layout algorithm that is applied to tree components. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - treeComponentCoreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets whether or not tree component arrangement is improved by changing the orientation of components. - * @type {boolean} - */ - optimizeOrientation:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeComponentLayout; - } - /** - * A {@link yfiles.tree.SubtreeShape} represents the position and the borders of a subtree. - *

- * {@link yfiles.tree.INodePlacer}s will move {@link yfiles.tree.SubtreeShape}s and use the borders to calculate distances between the - * subtrees. When two subtrees are placed in relation to their common root, their - * {@link yfiles.tree.SubtreeShape}s are merged to represent the new subtree. - *

- *

- * The borders on each side of the {@link yfiles.tree.SubtreeShape} are modeled with - * {@link yfiles.algorithms.BorderLine}s. The resulting area includes the borders of each node and edge in the corresponding - * subtree. It can also contain the bounds of labels belonging to those nodes and edges. - *

- *

- * The {@link yfiles.tree.SubtreeShape} also describes a connector defining the location to which the edge from its parent is - * attached. It is possible to add some bends (target points) at the end of this edge and include them in the - * {@link yfiles.tree.SubtreeShape}. During layout calculation, the last target point is the connection point for the edge. - *

- * @see yfiles.tree.SubtreeShape#getBorderLine - * @see yfiles.tree.SubtreeShape#connectorX - * @see yfiles.tree.SubtreeShape#connectorY - * @see yfiles.tree.SubtreeShape#addBoundsToShape - * @see yfiles.tree.SubtreeShape#addTargetPoint - * @class - * @final - */ - export interface SubtreeShape extends yfiles.lang.Object{} - export class SubtreeShape { - /** - * Extends this {@link yfiles.tree.SubtreeShape} instance by the given rectangle. - *

- * The border lines are updated with this segment. - *

- * @param x the x-coordinate of the upper-left corner of the rectangle - * @param y the y-coordinate of the upper-left corner of the rectangle - * @param width the width of the rectangle - * @param height the height of the rectangle - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - addBoundsToShape(x:number,y:number,width:number,height:number):void; - /** - * Adds all edge segments of the given edge to this {@link yfiles.tree.SubtreeShape} instance. - *

- * The border lines are updated. - *

- * @param graph the input graph - * @param edge the given edge - * @see yfiles.tree.SubtreeShape#getBorderLine - * @see yfiles.tree.SubtreeShape#addLineSegment - */ - addEdgeSegments(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Extends this {@link yfiles.tree.SubtreeShape} instance by the given segment. - *

- * The border lines are updated with this segment. - *

- * @param x1 the x-coordinate of the first point of the segment - * @param y1 the y-coordinate of the first point of the segment - * @param x2 the x-coordinate of the second point of the segment - * @param y2 the y-coordinate of the second point of the segment - * @see yfiles.tree.SubtreeShape#getBorderLine - * @see yfiles.tree.SubtreeShape#addEdgeSegments - * @see yfiles.tree.SubtreeShape#updateConnectorShape - */ - addLineSegment(x1:number,y1:number,x2:number,y2:number):void; - /** - * Adds another point to the connector. - *

- * The points will appear as bend of the incoming edge. Points are added in reverse direction of the edge. Hence, the last - * target point is further away from the target node than the points before. - *

- * @param x the current x-coordinate of the point - * @param y the current y-coordinate of the point - */ - addTargetPoint(x:number,y:number):void; - /** - * Appends all target points that have previously been added to this shape to the given {@link yfiles.layout.IEdgeLayout} - * instance. - *

- * This method is used by {@link yfiles.tree.INodePlacer} instances for the final edge paths. - *

- * @param edgeLayout the {@link } that will be modified - * @see yfiles.tree.SubtreeShape#addTargetPoint - */ - appendTargetPoints(edgeLayout:yfiles.layout.IEdgeLayout):void; - /** - * Copies the state of this {@link yfiles.tree.SubtreeShape} instance to the given shape applying a modification matrix. - * @param toShape the given shape that gets the assigned values - * @param modificationMatrix the matrix that may add geometrical modifications - */ - assignValuesTo(toShape:yfiles.tree.SubtreeShape,modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix):void; - /** - * Creates a clone of this {@link yfiles.tree.SubtreeShape} instance, modifying it using the provided modification matrix. - * @param matrix the matrix that defines the modification for the new instance - * @returns the clone of this {@link } instance - * @see yfiles.tree.RotatableNodePlacerMatrix#DEFAULT - */ - createCopy(matrix:yfiles.tree.RotatableNodePlacerMatrix):yfiles.tree.SubtreeShape; - /** - * Returns the {@link yfiles.algorithms.BorderLine} instance that describes the {@link yfiles.tree.SubtreeShape} at the given side. - * @param index one of the predefined borderline directions - * @returns the {@link } instance for the given side - * @throws {Stubs.Exceptions.ArgumentError} if the given index is invalid - */ - getBorderLine(index:number):yfiles.algorithms.BorderLine; - /** - * Merges the given {@link yfiles.tree.SubtreeShape} instance with this {@link yfiles.tree.SubtreeShape} instance. - *

- * The border lines are updated. - *

- * @param other the {@link } to be merged with this {@link } - */ - mergeWith(other:yfiles.tree.SubtreeShape):void; - /** - * Moves this {@link yfiles.tree.SubtreeShape} instance and its connector by the given offsets. - *

- * Border lines are updated. - *

- * @param dx the delta x-offset by which this shape will be moved - * @param dy the delta y-offset by which this shape will be moved - */ - move(dx:number,dy:number):void; - /** - * Adds the line segments of the connector to the bounds of this {@link yfiles.tree.SubtreeShape} instance. - *

- * The line segments result from the target points. - *

- * @see yfiles.tree.SubtreeShape#addTargetPoint - */ - updateConnectorShape():void; - /** - * Gets the bounds of the {@link yfiles.layout.INodeLayout} of the root node of this {@link yfiles.tree.SubtreeShape} instance. - * @type {yfiles.algorithms.Rectangle2D} - */ - coreBounds:yfiles.algorithms.Rectangle2D; - /** - * Gets the current bounds of this {@link yfiles.tree.SubtreeShape} instance. - * @type {yfiles.algorithms.Rectangle2D} - */ - bounds:yfiles.algorithms.Rectangle2D; - /** - * Gets the current x-coordinate of the connection point to which the layout algorithm connects the ingoing edge. - *

- * The connection point can change when target points are added to the {@link yfiles.tree.SubtreeShape} instance. - *

- * @see yfiles.tree.SubtreeShape#addTargetPoint - * @see yfiles.tree.SubtreeShape#appendTargetPoints - * @type {number} - */ - connectorX:number; - /** - * Gets the current y-coordinate of the connection point to which the layout algorithm connects the ingoing edge. - *

- * The connection point can change when target points are added to the {@link yfiles.tree.SubtreeShape} instance. - *

- * @see yfiles.tree.SubtreeShape#addTargetPoint - * @see yfiles.tree.SubtreeShape#appendTargetPoints - * @type {number} - */ - connectorY:number; - /** - * Gets the direction of the last connector segment. - * @type {yfiles.tree.ConnectorDirection} - */ - connectorDirection:yfiles.tree.ConnectorDirection; - /** - * Gets the current minimum x-coordinate of this {@link yfiles.tree.SubtreeShape} instance. - * @type {number} - */ - minX:number; - /** - * Gets the current minimum y-coordinate of this {@link yfiles.tree.SubtreeShape} instance. - * @type {number} - */ - minY:number; - /** - * Gets the current maximum x-coordinate of this {@link yfiles.tree.SubtreeShape} instance. - * @type {number} - */ - maxX:number; - /** - * Gets the current maximum y-coordinate of this {@link yfiles.tree.SubtreeShape} instance. - * @type {number} - */ - maxY:number; - /** - * Gets the current x-coordinate of the origin of this {@link yfiles.tree.SubtreeShape} instance. - *

- * The origin is defined as the upper left corner of the {@link yfiles.layout.INodeLayout} of the local root of this shape. - *

- * @type {number} - */ - originX:number; - /** - * Gets the current y-coordinate of the origin of this {@link yfiles.tree.SubtreeShape} instance. - *

- * The origin is defined as the upper left corner of the {@link yfiles.layout.INodeLayout} of the local root of this shape. - *

- * @type {number} - */ - originY:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.SubtreeShape; - } - /** - * This layout algorithm arranges graphs with a tree structure. - *

- * Layout Style {@link yfiles.tree.TreeLayout} provides multiple different arrangements of trees and subtrees. It is easy to customize the - * {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY order of edges}, the {@link yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY port assignment} and the {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY arrangement of the nodes} for each subtree. - *

- *

- * Tree layout algorithms are commonly applied to visualize relational data and produce diagrams of high quality that are - * able to reveal possible hierarchic properties of the graph. More precisely, they find applications in dataflow analysis, - * software engineering, bioinformatics and business administration. - *

- *

- * {@graph {"ann": {"s": [37.5,37.5], "d": 1},"n": [[209.96,0], [71.88,77.5], [348.04,77.5], [348.04,155], [202.77,232.5], [172.5,310], [71.88,232.5], [115,387.5], [115,310], [233.04,310], [71.88,155], [348.04,232.5], [319.29,310], [376.79,310], [463.04,232.5], [491.79,310], [434.29,310], [28.75,310], [57.5,387.5], [0,387.5], [376.79,387.5], [261.79,387.5], [204.29,387.5]], "e": [[0,1], [0,2], [2,3], [3,4], [4,5], [6,8], [8,7], [4,9], [1,10], [10,6], [3,11], [11,12], [11,13], [3,14], [14,15], [14,16], [6,17], [17,18], [17,19], [13,20], [9,21], [9,22]], "vp": [0.0,0.0,530.0,425.0]}} Example graph with a layout calculated by {@link yfiles.tree.TreeLayout} using default settings {@graph {"ann": {"s": [60,30], "d": 1},"n": [[1190,0], [0,50], [160,120], [80,120], [240,120], [120,190], [200,190], [280,190], [160,310], [80,310], [240,310], [120,240], [200,240], [280,240], [330,50], [460,256.6], [410,306.6], [510,306.6], [410,356.6], [510,356.6], [460,406.6], [650,441.6], [410,491.6], [490,491.6], [570,491.6], [710,50], [790,100], [870,170], [950,170], [1030,170], [1110,170], [1190,170], [870,240], [950,240], [1030,240], [1110,240], [1190,240], [870,310], [950,310], [1030,310], [1110,310], [1190,310], [870,380], [950,380], [1030,380], [1110,380], [1190,380], [430,120], [500,170], [540,206.6], [580,170], [620,206.6], [660,170], [80,520], [160,430], [160,480], [226.6,405], [226.6,455], [160,380], [790,465], [870,430], [950,430], [950,500], [1030,465], [870,500]], "e": [[0,1,[30,15]], [1,2,[30,100,190,100]], [2,3,[190,170,110,170]], [2,4,[190,170,270,170]], [2,5,[190,170,150,170]], [2,6,[190,170,230,170]], [2,7,[190,170,310,170]], [1,8,[30,360,190,360]], [8,9,[190,290,110,290]], [8,10,[190,290,270,290]], [8,11,[190,290,150,290]], [8,12,[190,290,230,290]], [8,13,[190,290,310,290]], [0,14,[360,15]], [14,15,[360,271.6]], [15,16,[490,321.6]], [15,17,[490,321.6]], [15,18,[490,371.6]], [15,19,[490,371.6]], [15,20], [14,21,[360,456.6]], [21,22,[440,456.6]], [21,23,[520,456.6]], [21,24,[600,456.6]], [0,25,[740,15]], [25,26,[740,115]], [26,27,[860,115,860,150,900,150]], [26,28,[860,115,860,150,980,150]], [26,29,[860,115,860,150,1060,150]], [26,30,[860,115,860,150,1140,150]], [26,31,[860,115,860,150,1220,150]], [26,32,[860,115,860,220,900,220]], [26,33,[860,115,860,220,980,220]], [26,34,[860,115,860,220,1060,220]], [26,35,[860,115,860,220,1140,220]], [26,36,[860,115,860,220,1220,220]], [26,37,[860,115,860,290,900,290]], [26,38,[860,115,860,290,980,290]], [26,39,[860,115,860,290,1060,290]], [26,40,[860,115,860,290,1140,290]], [26,41,[860,115,860,290,1220,290]], [26,42,[860,115,860,360,900,360]], [26,43,[860,115,860,360,980,360]], [26,44,[860,115,860,360,1060,360]], [26,45,[860,115,860,360,1140,360]], [26,46,[860,115,860,360,1220,360]], [14,47,[360,100,410,100,410,135]], [47,48,[530,135]], [47,49,[570,135]], [47,50,[610,135]], [47,51,[650,135]], [47,52,[690,135]], [1,53,[30,535]], [53,54,[110,445]], [53,55,[110,495]], [53,56,[110,420]], [53,57,[110,470]], [53,58,[110,395]], [25,59,[740,480]], [59,60,[900,480]], [59,61,[980,480]], [59,62,[980,480]], [59,63], [59,64,[900,480]]], "vp": [0.0,0.0,1250.0,550.0]}} Tree layout using different - * {@link yfiles.tree.INodePlacer}s and rotationsConcept - *

- *

- * The layout algorithm starts from the leaves and continues with their parents, then with the parents of the parents and - * so on. When a node is processed, the algorithm will use the corresponding {@link yfiles.tree.INodePlacer} instance to move its - * children (along with their subtrees) to a suitable position and to route the outgoing edges of this node. Then, the next - * local root node will be processed. - *

- *

- * To avoid moving all nodes several times and to know the area that the subtrees occupy, the layout algorithm uses - * {@link yfiles.tree.SubtreeShape}s. These {@link yfiles.tree.SubtreeShape}s are moved and merged during layout calculation. - *

- *

- * Features - *

- *

- * Each subtree can have a different style of node placement. {@link yfiles.tree.INodePlacer}s are responsible for arranging - * subtrees and their common root node. They can be specified separately for each local root with a {@link yfiles.algorithms.IDataProvider} - * registered with the graph using key {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY}. - *

- *

- * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with - * key {@link yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY}. - *

- *

- * The layout algorithm can be configured to reserve space for node labels and place the edge labels along edges such that - * the labels won't overlap with other graph elements. Edge labels are placed according to the information stored in a {@link yfiles.layout.PreferredPlacementDescriptor} - * instance. However, the placement along the edge will only affect the order of multiple labels at the same edge. The - * algorithm will always place the labels close to the target node. - *

- *

- * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole - * subtree. Otherwise, the group nodes may overlap with each other or with other nodes. Furthermore, the user may specify - * minimum size constraints for each group node using {@link yfiles.algorithms.IDataProvider} key - * {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. - *

- *

- * {@link yfiles.tree.TreeLayout} supports custom sorting of the outgoing edges of a node. For example, a {@link yfiles.tree.INodePlacer} - * instance that implements {@link yfiles.tree.IFromSketchNodePlacer} provides a comparator that keeps the current order of - * siblings, allowing to extend the graph incrementally. - *

- *

- * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} - * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. After the - * layout calculation, the stage will reinsert the edges that were removed and route them separately. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface TreeLayout extends yfiles.layout.MultiStageLayout{} - export class TreeLayout { - /** - * Creates a new {@link yfiles.tree.TreeLayout} instance with default settings. - */ - constructor(); - /** - * Creates a {@link yfiles.tree.SubtreeShape} for the given node that consists only of the bounds of this particular node. - *

- * It may also include node labels or {@link yfiles.layout.NodeHalo}s. - *

- *

- * This method may be overridden to return a custom {@link yfiles.tree.SubtreeShape} for the given node. - *

- * @param node the given node - * @returns a {@link } instance - */ - createNodeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Returns a list of edges that need to be reversed in order to obtain a valid rooted and directed tree from the input - * graph. - *

- * The root node of the tree is either a node marked by a {@link yfiles.algorithms.IDataProvider} registered with the graph with - * key {@link yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY} or is defined according to {@link yfiles.algorithms.Trees#getRoot}. - *

- *

- * This method is called initially to calculate a rooted tree from the input graph. It may be overridden to apply a custom - * algorithm that determines which edges need to be reversed. - *

- * @returns a list of edges that need to be reversed - * @see yfiles.tree.TreeLayout#reverseEdges - * @protected - */ - directTree():yfiles.algorithms.EdgeList; - /** - * Returns the {@link yfiles.tree.INodePlacer} instance that is used for the placement of the local root node and the - * {@link yfiles.tree.SubtreeShape}s. - *

- * The method may be overridden to return custom {@link yfiles.tree.INodePlacer} instances. It is possible to return a shared - * instance for multiple different nodes because the instances are not used after subsequent calls to this method. - *

- *

- * The current implementation returns the {@link yfiles.tree.INodePlacer} defined by the {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY}. It falls back to the default {@link yfiles.tree.INodePlacer} if there is no - * specific {@link yfiles.tree.INodePlacer} for the given node. - *

- * @param localRoot the root of the local subtree - * @returns the {@link } instance that places the subtree below the given local root node - * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY - * @see yfiles.tree.TreeLayout#defaultNodePlacer - * @protected - */ - getNodePlacer(localRoot:yfiles.algorithms.Node):yfiles.tree.INodePlacer; - /** - * Returns the {@link yfiles.collections.IComparer.} instance that will sort the outgoing edges connecting to the given node. - *

- * The {@link yfiles.collections.IComparer.} can be null in case the initial edge order shall be used. - *

- *

- * The method may be overridden to return custom {@link yfiles.collections.IComparer.} instances. It is possible to return a shared instance for multiple - * different nodes because the instances are not used after subsequent calls to this method. - *

- *

- * The current implementation returns the {@link yfiles.collections.IComparer.} defined in the {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY}. It falls back to the default {@link yfiles.collections.IComparer.} if there is no specific {@link yfiles.collections.IComparer.} for the given - * node. - *

- * @param localRoot the root of the local subtree - * @returns the {@link } or null that sorts the outgoing edges of the given node - * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY - * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer - */ - getOutEdgeComparer(localRoot:yfiles.algorithms.Node):yfiles.collections.IComparer; - /** - * Returns the {@link yfiles.tree.IPortAssignment} instance that places the ports of the connecting edges of the given node. - *

- * The method may be overridden to return customized {@link yfiles.tree.IPortAssignment} instances. It is possible to return a - * shared instance for multiple different nodes because the instances are not used after subsequent calls to this method. - *

- *

- * The current implementation returns the {@link yfiles.tree.IPortAssignment} defined by the {@link yfiles.algorithms.IDataProvider} - * registered with key {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY}. It falls back to the default {@link yfiles.tree.IPortAssignment} - * if there is no specific {@link yfiles.tree.IPortAssignment} for the given node. - *

- * @param localRoot the root of the local subtree - * @returns the {@link } instance that assigns the ports of the edges at the given node - * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY - * @see yfiles.tree.TreeLayout#defaultPortAssignment - * @protected - */ - getPortAssignment(localRoot:yfiles.algorithms.Node):yfiles.tree.IPortAssignment; - /** - * Returns an array of the nodes that will be laid out. - *

- * The given node will be considered as the root of the tree. The order of the elements ensures that no parent is processed - * before one of its successors. - *

- *

- * This method may be overridden to change the order in which the nodes (and their subtrees) are handled. However, it is - * important to keep the parents after the successors. Only siblings can change places. - *

- * @param root the node to be considered as root of the tree - * @returns an array of nodes that will be laid out - * @protected - */ - getRootsArray(root:yfiles.algorithms.Node):yfiles.algorithms.Node[]; - /** - * Provides access to the {@link yfiles.tree.SubtreeShape} for the given node. - *

- * The {@link yfiles.tree.SubtreeShape} contains information about the current extent and location of the subtree rooted at the - * node. It should only be modified during the layout of the parent node. Also, it won't be initialized before the layout - * of the corresponding subtree is calculated. - *

- *

- * This method updates the {@link yfiles.tree.SubtreeShape} in {@link yfiles.tree.TreeLayout#layoutRoot}. - *

- * @param localRoot the root of the subtree - * @returns the {@link } instance if it has already been calculated, null otherwise - * @protected - */ - getSubtreeShape(localRoot:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Calculates the layout for the given root node and its subtrees. - *

- * This method is invoked for each node in the tree exactly once. Thus, children are always handled before their parents. - * In this manner, the subtrees already have a layout and can be arranged with their parent. - *

- *

- * To retrieve the shapes of the subtrees of all children of the local root, this method uses - * {@link yfiles.tree.TreeLayout#getSubtreeShape}. - *

- *

- * The method may be overridden to add configuration code. - *

- * @param localRoot the root of the subtree that whose layout is calculated - * @returns the combined {@link } of the local root node and all of its children and connecting edges - * @protected - */ - layoutRoot(localRoot:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Reverses the direction of given edges. - *

- * This method will be called initially after the {@link yfiles.tree.TreeLayout#directTree} method and finally after the layout has - * been calculated. It may be overridden to additionally reverse data that depends on the direction of the edges. - *

- * @param reversedEdges the edges that will be reversed - * @protected - */ - reverseEdges(reversedEdges:yfiles.algorithms.EdgeList):void; - /** - * Data provider key for specifying a child node placer for each node - * @see yfiles.tree.TreeLayout#defaultNodePlacer - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_PLACER_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning ports to nodes - * @see yfiles.tree.TreeLayout#defaultPortAssignment - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PORT_ASSIGNMENT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying the comparator for the outgoing edges - * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.>} - */ - static OUT_EDGE_COMPARER_DP_KEY:yfiles.algorithms.NodeDpKey>; - /** - * Data provider key for defining the priority of critical edges - *

- * The layout algorithm tries to align each node pair that is connected by a critical edge (integer value > - * 0). This feature can, for example, be used for highlighting different edge paths that are important for a user. - * Conflicts between different critical edges are always resolved in favor of the higher priority. - *

- *

- * Critical edges will always align the centers of source and target node, thus replacing the current root alignment of the - * {@link yfiles.tree.INodePlacer}. - *

- *

- * The critical edge may not be straight if subtrees are rotated or port constraints are assigned. - *

- *

- * This feature is only supported by the following {@link yfiles.tree.INodePlacer}s: - *

- *
    - *
  • {@link yfiles.tree.DefaultNodePlacer}
  • - *
  • {@link yfiles.tree.SimpleNodePlacer}
  • - *
  • {@link yfiles.tree.LayeredNodePlacer}
  • - *
  • {@link yfiles.tree.DoubleLineNodePlacer}
  • - *
  • {@link yfiles.tree.DendrogramNodePlacer}
  • - *
- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static CRITICAL_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for retrieving descriptors for nodes in multi-parent structures - *

- * The returned descriptor affects the layout of the multi-parent structure. - *

- * @see yfiles.tree.TreeLayout#multiParentAllowed - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static MULTI_PARENT_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking the node that will be used as root node of the tree - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * The input graph for which a layout is calculated. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets or sets whether or not group nodes are handled by the layout algorithm. - * @type {boolean} - */ - groupingSupported:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets a {@link yfiles.algorithms.IDataAcceptor} that can overwrite the source {@link yfiles.layout.PortConstraint port contraint} temporarily used during the layout. - *

- * This method sets temporary source {@link yfiles.layout.PortConstraint}s, e.g., after edge reversal. It may be overridden to - * handle those {@link yfiles.layout.PortConstraint}s separately. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.algorithms.IDataAcceptor} - */ - sourcePortConstraintDataAcceptor:yfiles.algorithms.IDataAcceptor; - /** - * Gets a {@link yfiles.algorithms.IDataAcceptor} that can overwrite the target {@link yfiles.layout.PortConstraint port contraint} temporarily used during the layout. - *

- * This method sets temporary target {@link yfiles.layout.PortConstraint}s, e.g., after edge reversal. It may be overridden to - * handle those {@link yfiles.layout.PortConstraint}s separately. - *

- * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @protected - * @type {yfiles.algorithms.IDataAcceptor} - */ - targetPortConstraintDataAcceptor:yfiles.algorithms.IDataAcceptor; - /** - * Gets a {@link yfiles.algorithms.IDataAcceptor} that can be used for temporarily overwriting the source group information used - * during the layout. - *

- * This method may be overridden to handle those edge groups separately. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @protected - * @type {yfiles.algorithms.IDataAcceptor} - */ - sourceGroupDataAcceptor:yfiles.algorithms.IDataAcceptor; - /** - * Gets a {@link yfiles.algorithms.IDataAcceptor} that can be used for temporarily overwriting the target group information used - * during the layout. - *

- * This method may be overridden to handle those edge groups separately. - *

- * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @protected - * @type {yfiles.algorithms.IDataAcceptor} - */ - targetGroupDataAcceptor:yfiles.algorithms.IDataAcceptor; - /** - * Gets or sets the default {@link yfiles.tree.INodePlacer} instance that arranges all subtrees that do not have a specific {@link yfiles.tree.INodePlacer} - * assigned using a {@link yfiles.algorithms.IDataProvider}. - * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.INodePlacer} is set to null - * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY - * @type {yfiles.tree.INodePlacer} - */ - defaultNodePlacer:yfiles.tree.INodePlacer; - /** - * Gets or sets the default {@link yfiles.tree.INodePlacer} instance that places the leaf nodes of the tree. - * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.INodePlacer} is set to null - * @see yfiles.tree.TreeLayout#defaultNodePlacer - * @type {yfiles.tree.INodePlacer} - */ - defaultLeafPlacer:yfiles.tree.INodePlacer; - /** - * Gets or sets the default {@link yfiles.tree.IPortAssignment} instance for all subtrees that do not have a specific {@link yfiles.tree.IPortAssignment} - * assigned using a {@link yfiles.algorithms.IDataProvider}. - * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.IPortAssignment} is set to null - * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY - * @type {yfiles.tree.IPortAssignment} - */ - defaultPortAssignment:yfiles.tree.IPortAssignment; - /** - * Gets or sets the default {@link yfiles.collections.IComparer.} instance that sorts the outgoing edges in all subtrees that do not have a specific {@link yfiles.collections.IComparer.} assigned - * using a {@link yfiles.algorithms.IDataProvider}. - * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY - * @type {yfiles.collections.IComparer.} - */ - defaultOutEdgeComparer:yfiles.collections.IComparer; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels. - *

- * If this feature is enabled, the {@link yfiles.tree.SubtreeShape} of the nodes will also hold the shapes of its labels. - *

- * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not edge labels are placed by the layout algorithm. - *

- * If this is enabled, the {@link yfiles.tree.SubtreeShape}s of the subtrees are extended by the edge labels. - *

- *

- * The layout algorithm uses the information of {@link yfiles.layout.PreferredPlacementDescriptor} for an edge label to determine - * the corresponding placement. However, edge labels are always placed at the target side of the edge. The placement along - * the edge only affects the order of the edge labels at the same edge. - *

- * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets whether or not multi-parent structures are allowed for this tree layout. - *

- * If multi-parent structures are allowed, the directed input graph may contain structures of multiple nodes that share the - * same predecessors as well as the same successors. All nodes belonging to such a structure are placed side by side and - * the incident edges are routed in a bus-style manner. - *

- * @type {boolean} - */ - multiParentAllowed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeLayout; - } - /** - * The {@link yfiles.tree.TreeReductionStage} temporarily reduces general graphs to trees. - *

- * Layout Style - *

- *

- * This stage prepares a non-tree graph such that it can be processed by a tree layout algorithm. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[150,0],[260,70],[210,70],[260,140],[310,210],[335,280],[75,70],[285,280],[25,70],[25,140],[75,140],[150,70],[25,210],[185,280],[175,140],[50,280],[0,280],[210,210],[235,280],[125,140]],"e":[[0,1,[165,50,275,50]],[0,2,[165,50,225,50]],[1,3],[3,4,[275,190,325,190]],[4,5,[325,260,350,260]],[0,6,[165,50,90,50]],[4,7,[325,260,300,260]],[0,8,[165,50,40,50]],[8,9],[6,10],[0,11],[9,12],[11,14,[165,120,190,120]],[12,15,[40,260,65,260]],[12,16,[40,260,15,260]],[3,17,[275,190,225,190]],[17,13,[225,260,200,260]],[17,18,[225,260,250,260]],[11,19,[165,120,140,120]],[2,11,1],[12,13,1],[17,14,1]],"vp":[0.0,0.0,365.0,310.0]}} - *

- *

- * The non-tree edges are marked - *

- *

- * Concept This {@link yfiles.layout.ILayoutStage} works in three steps: - *

- *
    - *
  1. Remove some edges to get a tree or forest from the graph
  2. - *
  3. Invoke the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} which supports tree graph handling
  4. - *
  5. Reinsert all previously removed edges
  6. - *
  7. - * Optionally route these edges using the non-tree edge router and place their labels using the non-tree edge labeling - * algorithm. - *
  8. - *
- *

- * Features - *

- *

- * The routing of the temporarily hidden non-tree edges can be customized by specifying an {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter edge routing algorithm} for those - * edges. Similarly, the placement of edge labels of non-tree edges can be delegated to a custom - * {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm edge labeling algorithm}. As default, both custom algorithms are not specified and, thus, non-tree edges are not routed - * and edge labels not placed. - *

- *

- * This stage is also able to handle multi-parent structures, i.e., structures of multiple nodes that share the same - * predecessors as well as the same successors. More precisely, if the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} supports - * multi-parent structures (see {@link yfiles.tree.TreeLayout#multiParentAllowed}) and option {@link yfiles.tree.TreeReductionStage#multiParentAllowed} is enabled, this stage does not hide such structures, i.e., the multi-parent - * structures are passed to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- *

- * Non-tree edges can also be bundled together such that their common parts are to some degree merged into a bundled part. - * The edge bundling can be specified by means of method {@link yfiles.tree.TreeReductionStage#edgeBundling}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface TreeReductionStage extends yfiles.layout.LayoutStageBase{} - export class TreeReductionStage { - /** - * Creates a new {@link yfiles.tree.TreeReductionStage} instance with the given core layout algorithm and default settings. - * @param core the core layout algorithm - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - /** - * Creates a new {@link yfiles.tree.TreeReductionStage} instance with default settings. - */ - constructor(); - /** - * Creates a routing algorithm that routes edges as a single straight segment. - *

- * The created instance can be used for {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter routing non-tree edges}. - *

- * @returns an edge routing algorithm that produces straight-line edges - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter - */ - createStraightLineRouter():yfiles.layout.ILayoutAlgorithm; - /** - * Routes all edges that do not belong to the chosen spanning tree. - *

- * This method is called by {@link yfiles.tree.TreeReductionStage#applyLayout} after the tree was arranged by the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to apply custom edge routes. - *

- * @param graph the graph containing tree and non-tree edges - * @param nonTreeEdgeMap the {@link } that marks all non-tree edges in the graph - * @protected - */ - routeNonTreeEdges(graph:yfiles.layout.LayoutGraph,nonTreeEdgeMap:yfiles.algorithms.IEdgeMap):void; - /** - * Data provider key for explicitly marking (some) edges that should not be considered for the tree - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static NON_TREE_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets whether or not multi-parent structures (structures of multiple nodes that share the same predecessors as - * well as the same successors) are allowed. - *

- * More precisely, if this option is enabled and the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can handle multi-parent structures - * (see {@link yfiles.tree.TreeLayout#multiParentAllowed}), this stage does not hide such structures, but the multi-parent structures are passed on to the {@link yfiles.layout.LayoutStageBase#coreLayout} core layout - * algorithm}. - *

- * @type {boolean} - */ - multiParentAllowed:boolean; - /** - * Gets or sets the edge routing algorithm that is applied to all non-tree edges. - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeSelectionKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - nonTreeEdgeRouter:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that will be used by the {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter non-tree edge routing algorithm} - * to determine the edges that need to be routed. - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter - * @type {any} - */ - nonTreeEdgeSelectionKey:any; - /** - * Gets or sets the labeling algorithm that is applied to all edge labels that belong to non-tree edges. - *

- * It is required that a suitable {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelSelectionKey edge label selection key} is set. Otherwise, the edge labeling algorithm might also place - * labels of tree edges. - *

- * @see yfiles.tree.TreeReductionStage#nonTreeEdgeLabelSelectionKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - nonTreeEdgeLabelingAlgorithm:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used by the {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm non-tree edge labeling algorithm} - * to determine which edge labels it should place. - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm - * @type {any} - */ - nonTreeEdgeLabelSelectionKey:any; - /** - * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. - *

- * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be - * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. To enable bundling for all non-tree edges, set a {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default bundle descriptor} - * which has {@link yfiles.layout.EdgeBundleDescriptor#bundled bundling} enabled. - *

- *

- * If the graph contains self-loops that belong to the set of non-tree edges, the stage will invoke the router defined for - * the non-tree edges in order to route them. In the case where this is not desired, the user has to hide them from the - * stage and route them afterwards as desired. - *

- * @type {yfiles.layout.EdgeBundling} - */ - edgeBundling:yfiles.layout.EdgeBundling; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeReductionStage; - } - /** - * Specifies custom data for the {@link yfiles.tree.AspectRatioTreeLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface AspectRatioTreeLayoutData extends yfiles.layout.LayoutData{} - export class AspectRatioTreeLayoutData { - constructor(); - /** - * Gets or sets the mapping from nodes to the aspect ratio of their sub tree. - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - subtreeAspectRatios:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes with sub trees to their placements. - * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#getRootPlacement - * @type {yfiles.layout.ItemMapping.} - */ - rootPlacements:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to the routing policies of their sub trees. - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#getSubtreeArrangement - * @type {yfiles.layout.ItemMapping.} - */ - subtreeRoutingPolicies:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.AspectRatioTreeLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.tree.BalloonLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface BalloonLayoutData extends yfiles.layout.LayoutData{} - export class BalloonLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes that should be arranged in an interleaved fashion. - * @see yfiles.tree.BalloonLayout#INTERLEAVED_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - interleavedNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping for marking the node that will be used as root node of the tree. - *

- * The custom root node selection induced by this property is only considered if the {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy} is set to - * {@link yfiles.tree.RootNodePolicy#SELECTED_ROOT}. - *

- * @see yfiles.tree.BalloonLayout#SELECTED_ROOT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - treeRoot:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.BalloonLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.tree.TreeLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface TreeLayoutData extends yfiles.layout.LayoutData{} - export class TreeLayoutData { - constructor(); - /** - * Gets or sets the mapping from nodes to their {@link yfiles.tree.INodePlacer}. - * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePlacers:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.tree.IPortAssignment}. - * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - portAssignments:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to comparison functions used to sort the nodes' outgoing edges. - * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - outEdgeComparers:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets the collection of nodes the {@link yfiles.tree.AssistantNodePlacer} considers as assistants. - *

- * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.AssistantNodePlacer} . - *

- * @see yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - assistantNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the collection of nodes the {@link yfiles.tree.DelegatingNodePlacer} places with its {@link yfiles.tree.DelegatingNodePlacer#primaryPlacer}. - *

- * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.DelegatingNodePlacer} . - *

- * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - delegatingNodePlacersPrimaryNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets a mapping from nodes to a boolean value that specifies whether a node should be placed left of the bus - * (true) or right of the bus (false). - *

- * This mapping is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns a {@link yfiles.tree.LeftRightNodePlacer} . - *

- * @see yfiles.tree.LeftRightNodePlacer#LEFT_RIGHT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - leftRightPlacersLeftNodes:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to the index of the row the {@link yfiles.tree.GridNodePlacer} shall place the node in. - *

- * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.GridNodePlacer} . - *

- * @see yfiles.tree.GridNodePlacer#ROW_INDEX_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - gridNodePlacerRowIndices:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping for marking the node that will be used as root node of the tree. - * @see yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - treeRoot:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.tree.TreeReductionStage}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface TreeReductionStageData extends yfiles.layout.LayoutData{} - export class TreeReductionStageData { - constructor(); - /** - * Gets or sets the collection of edges explicitly marked as not belonging to a tree. - * @see yfiles.tree.TreeReductionStage#NON_TREE_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - nonTreeEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. - *

- * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the - * source and target point, the edges are again clearly split. - *

- *

- * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. - *

- * @see yfiles.layout.EdgeBundleDescriptor - * @see yfiles.tree.TreeReductionStage#edgeBundling - * @type {yfiles.layout.ItemMapping.} - */ - edgeBundleDescriptors:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeReductionStageData; - } - }export namespace genealogy{ - /** - * This layout algorithm arranges genealogical graphs (family trees). - *

- * Layout Style The family trees consist of nodes that represent individuals and nodes that represent families. Individuals are - * connected via these family nodes. The graph is arranged in layers that describe generations. {@graph {"ann":{"s":[122.27,30],"d":1},"styles":{"5":{"c":1}},"n":[[364.55,210,[[405.01,234.35,41.35,18.7,"Mother"]]],[364.55,140,[[406.35,164.35,38.68,18.7,"Father"]]],[182.27,385,[[206.06,409.35,74.7,18.7,"Grandmother"]]],[182.27,315,[[209.39,339.35,68.04,18.7,"Grandfather"]]],[182.27,175,[[206.06,199.35,74.7,18.7,"Grandmother"]]],[182.27,105,[[209.39,129.35,68.04,18.7,"Grandfather"]]],[0,490,[[6.78,514.35,108.71,18.7,"Great-Grandmother"]]],[0,420,[[10.11,444.35,102.04,18.7,"Great-Grandfather"]]],[0,350,[[6.78,374.35,108.71,18.7,"Great-Grandmother"]]],[0,280,[[10.11,304.35,102.04,18.7,"Great-Grandfather"]]],[0,210,[[6.78,234.35,108.71,18.7,"Great-Grandmother"]]],[0,140,[[10.11,164.35,102.04,18.7,"Great-Grandfather"]]],[0,70,[[6.78,94.35,108.71,18.7,"Great-Grandmother"]]],[0,0,[[10.11,24.35,102.04,18.7,"Great-Grandfather"]]],[56.14,45,10,10,5],[56.14,185,10,10,5],[56.14,325,10,10,5],[56.14,465,10,10,5],[238.41,360,10,10,5],[238.41,150,10,10,5],[420.69,185,10,10,5],[556.82,245,[[597.95,269.35,40.02,18.7,"Sibling"]]],[556.82,315,[[597.95,339.35,40.02,18.7,"Sibling"]]],[556.82,175,[[602.29,199.35,31.35,18.7,"Child"]]]],"e":[[12,14],[13,14],[14,5,5,0,-61.14,0,[132.27,50,132.27,120]],[11,15],[10,15],[15,4,5,0,-61.14,0],[8,16],[9,16],[16,3,5,0,-61.14,0],[6,17],[7,17],[17,2,5,0,-61.14,0,[132.27,470,132.27,400]],[2,18],[3,18],[18,0,5,0,-61.14,0,[314.55,365,314.55,225]],[4,19],[5,19],[19,1,5,0,-61.14,0],[0,20],[1,20],[20,21,5,0,-61.14,0,[536.82,190,536.82,260]],[20,22,5,0,-61.14,0,[536.82,190,536.82,330]],[20,23,5,0,-61.14,0]],"vp":[0.0,0.0,680.0,520.0]}} - *

- *

- * Basic Family Tree - *

- *

- * Concept - *

- *

- * In order to determine whether a node represents an individual or a partnership, a {@link yfiles.algorithms.IDataProvider} has to - * be registered with key {@link yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY}. If this {@link yfiles.algorithms.IDataProvider} is - * missing, an {@link yfiles.lang.Exception} will be thrown. - *

- *

- * This {@link yfiles.algorithms.IDataProvider} provides: - *

- *
    - *
  • {@link yfiles.genealogy.FamilyType#MALE} for a node representing a male individual.
  • - *
  • {@link yfiles.genealogy.FamilyType#FEMALE} for a node representing a female individual.
  • - *
  • {@link yfiles.genealogy.FamilyType#FAMILY} for a node representing a family.
  • - *
- *

- * All other values will be interpreted as if the node represents an individual. - *

- *

- * A {@link yfiles.genealogy.FamilyType#FAMILY} node links all members of a family. It can only have two incoming edges from the - * parents. Two nodes of the same type (families or individuals) cannot be directly connected. If the input graph violates - * these specifications, a {@link yfiles.lang.Exception} exception will be thrown. - *

- *

- * The layout is calculated basically in two steps: - *

- *
    - *
  • The families are laid out by the inner layouter in a compact way.
  • - *
  • - * The relations between these "family groups" and their children and other families are laid out by the - * {@link yfiles.genealogy.FamilyTreeLayout#topLayout top layout algorithm}. - *
  • - *
- *

- * Features - *

- *

- * The distances between nodes {@link yfiles.genealogy.FamilyTreeLayout#spacingBetweenFamilyMembers in the same generation} as well as between {@link yfiles.genealogy.FamilyTreeLayout#offsetForFamilyNodes individuals and family nodes} can be adjusted. - *

- *

- * Nodes in the same generation can be {@link yfiles.genealogy.FamilyTreeLayout#alignment aligned} at three different coordinates: top, center, bottom. - *

- *

- * The location of {@link yfiles.genealogy.FamilyType#FAMILY} nodes can be {@link yfiles.genealogy.FamilyTreeLayout#familyNodesAlwaysBelow specified} in relation to the partners. This placement - * can be set independently for {@link yfiles.genealogy.FamilyTreeLayout#partnerlessBelow parents}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface FamilyTreeLayout extends yfiles.layout.MultiStageLayout{} - export class FamilyTreeLayout { - /** - * Creates a new instance of {@link yfiles.genealogy.FamilyTreeLayout} with default settings. - */ - constructor(); - /** - * Data provider key for assigning a node type for each node - *

- * The layout algorithm will handle the nodes according to this type. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FAMILY_TYPE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm layout algorithm} that is responsible for the layout between family groups. - *

- * If the specified layout algorithm is null, fallback algorithm {@link yfiles.hierarchic.HierarchicLayout} is used. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - topLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the spacing between two nodes representing members of the same family in one generation. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative - * @type {number} - */ - spacingBetweenFamilyMembers:number; - /** - * Gets or sets the offset by which a {@link yfiles.genealogy.FamilyType#FAMILY} node is shifted down if its parents are not direct - * neighbors. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given offset is negative - * @type {number} - */ - offsetForFamilyNodes:number; - /** - * Gets or sets whether or not {@link yfiles.genealogy.FamilyType#FAMILY} nodes of individuals that have only children but no - * partners are placed below this individual or next to it. - * @type {boolean} - */ - partnerlessBelow:boolean; - /** - * Gets or sets whether or not {@link yfiles.genealogy.FamilyType#FAMILY} nodes are placed between or below the partners. - * @see yfiles.genealogy.FamilyType#FAMILY - * @type {boolean} - */ - familyNodesAlwaysBelow:boolean; - /** - * Gets or sets the vertical alignment of the individual nodes in the same generation. - * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is unknown - * @type {yfiles.genealogy.VerticalNodeAlignment} - */ - alignment:yfiles.genealogy.VerticalNodeAlignment; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets or sets the order of individuals in the same generation (siblings, partners) based on their sex. - * @throws {Stubs.Exceptions.ArgumentError} if the specified order is unknown - * @type {yfiles.genealogy.FamilyMembersSortingPolicy} - */ - familyMembersSortingPolicy:yfiles.genealogy.FamilyMembersSortingPolicy; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.genealogy.FamilyTreeLayout; - } - export enum FamilyType{ - /** - * Type specifier for nodes that connect partners with each other and their children. - * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY - */ - FAMILY, - /** - * Type specifier for nodes that represent men. - * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY - */ - MALE, - /** - * Type specifier for nodes that represent women. - * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY - */ - FEMALE - } - export enum VerticalNodeAlignment{ - /** - * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their top - * coordinate. - *

- * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. - *

- * @see yfiles.genealogy.FamilyTreeLayout#alignment - */ - TOP, - /** - * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their center - * coordinate. - *

- * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. - *

- * @see yfiles.genealogy.FamilyTreeLayout#alignment - */ - CENTER, - /** - * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their bottom - * coordinate. - *

- * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. - *

- * @see yfiles.genealogy.FamilyTreeLayout#alignment - */ - BOTTOM - } - export enum FamilyMembersSortingPolicy{ - /** - * Order specifier that disables sorting of individuals according to their sex. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - NO_SORTING, - /** - * Order specifier that places female individuals before their male siblings and partners, if possible. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - FEMALE_FIRST, - /** - * Order specifier that places female individuals before their male siblings and partners. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - FEMALE_ALWAYS_FIRST, - /** - * Order specifier that places male individuals before their female siblings and partners, if possible. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - MALE_FIRST, - /** - * Order specifier that places male individuals before their female siblings and partners. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - MALE_ALWAYS_FIRST - } - /** - * Specifies custom data for the {@link yfiles.genealogy.FamilyTreeLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface FamilyTreeLayoutData extends yfiles.layout.LayoutData{} - export class FamilyTreeLayoutData { - constructor(); - /** - * Gets or sets the mapping from nodes to their family type. - * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY - * @see yfiles.genealogy.FamilyType - * @type {yfiles.layout.ItemMapping.} - */ - familyTypes:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.genealogy.FamilyTreeLayoutData; - } - }export namespace multipage{ - /** - * This class is a default implementation of interface {@link yfiles.multipage.IElementFactory}. - * @see yfiles.multipage.IElementFactory - * @class - * @implements {yfiles.multipage.IElementFactory} - */ - export interface DefaultElementFactory extends yfiles.lang.Object,yfiles.multipage.IElementFactory{} - export class DefaultElementFactory { - /** - * Creates a new instance of {@link yfiles.multipage.DefaultElementFactory}. - */ - constructor(); - /** - * - * @param context - * @param connector - * @param opposite - * @param origEdgeId - * @param atTarget - * @returns - */ - createConnectorEdge(context:yfiles.multipage.LayoutContext,connector:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,origEdgeId:any,atTarget:boolean):yfiles.algorithms.Edge; - /** - * - * @param context - * @param edgeIds - * @param representedNodeId - * @returns - */ - createConnectorNode(context:yfiles.multipage.LayoutContext,edgeIds:yfiles.algorithms.YList,representedNodeId:any):yfiles.algorithms.Node; - /** - * - * @param context - * @param proxyNode - * @param opposite - * @param replacingEdgeId - * @param origNodeId - * @returns - */ - createProxyEdge(context:yfiles.multipage.LayoutContext,proxyNode:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,replacingEdgeId:any,origNodeId:any):yfiles.algorithms.Edge; - /** - * - * @param context - * @param origNodeId - * @returns - */ - createProxyNode(context:yfiles.multipage.LayoutContext,origNodeId:any):yfiles.algorithms.Node; - /** - * - * @param context - * @param proxyReference - * @param opposite - * @param referencingCopyId - * @returns - */ - createProxyReferenceEdge(context:yfiles.multipage.LayoutContext,proxyReference:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,referencingCopyId:any):yfiles.algorithms.Edge; - /** - * - * @param context - * @param referringProxyId - * @returns - */ - createProxyReferenceNode(context:yfiles.multipage.LayoutContext,referringProxyId:any):yfiles.algorithms.Node; - /** - * Returns the default size for nodes created by this factory. - *

- * This method is called from {@link yfiles.multipage.DefaultElementFactory#createConnectorNode}, - * {@link yfiles.multipage.DefaultElementFactory#createProxyReferenceNode}, and/or - * {@link yfiles.multipage.DefaultElementFactory#createProxyNode}. It must return a non-null size with positive width and height. - *

- *

- * Subclasses may implement this method to use custom size values. - *

- * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param id the element ID - * @param type the type of the node to be created - * @returns the default size of the new node - * @protected - */ - getDefaultNodeSize(context:yfiles.multipage.LayoutContext,id:any,type:number):yfiles.algorithms.YDimension; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.DefaultElementFactory; - } - export enum EdgeType{ - /** - * An edge type that specifies a normal edge. - *

- * An edge is called normal if it does not belong to any other type. - *

- * @see yfiles.multipage.IEdgeInfo#type - */ - NORMAL, - /** - * An edge type that specifies a connector edge. - *

- * An edge is called connector if it is connected to a connector node (a node of {@link yfiles.multipage.INodeInfo#type type} - * {@link yfiles.multipage.NodeType#CONNECTOR}), i.e., it represents an edge of the input graph whose endpoints lie on different - * pages. - *

- * @see yfiles.multipage.IEdgeInfo#representedEdge - * @see yfiles.multipage.IEdgeInfo#type - * @see yfiles.multipage.NodeType#CONNECTOR - */ - CONNECTOR, - /** - * An edge type that specifies a proxy reference edge. - *

- * An edge is called proxy reference if it is connected to a proxy reference node (a node of {@link yfiles.multipage.INodeInfo#type type} - * {@link yfiles.multipage.NodeType#PROXY_REFERENCE}), i.e., a node that refers to a proxy of an original node lying on another - * page. - *

- * @see yfiles.multipage.IEdgeInfo#type - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - */ - PROXY_REFERENCE, - /** - * An edge type that specifies a proxy edge. - *

- * An edge is called proxy if it is connected to a proxy node (a node of {@link yfiles.multipage.INodeInfo#type type} - * {@link yfiles.multipage.NodeType#PROXY}), i.e., a node that is a proxy of an original node lying on another page. - *

- * @see yfiles.multipage.IEdgeInfo#type - * @see yfiles.multipage.NodeType#PROXY - */ - PROXY - } - export enum GroupingMode{ - /** - * Node grouping specifier used when group nodes should be ignored. - * @see yfiles.multipage.MultiPageLayout#groupingMode - */ - IGNORE, - /** - * Node grouping specifier used when only original nodes should be assigned to group nodes. Hence, connector and proxy - * nodes (see {@link yfiles.multipage.NodeType#CONNECTOR} and - * {@link yfiles.multipage.NodeType#PROXY}) are never assigned to group nodes even though the associated node lies within a group. - * @see yfiles.multipage.MultiPageLayout#groupingMode - */ - ORIGINAL_NODES_ONLY, - /** - * Node grouping specifier used when special nodes like, e.g., connector and proxy nodes (see {@link yfiles.multipage.NodeType#CONNECTOR} - * and {@link yfiles.multipage.NodeType#PROXY}) should be assigned to group nodes, too. - * @see yfiles.multipage.MultiPageLayout#groupingMode - */ - ALL_NODES - } - export enum EdgeBundleModes{ - /** - * Edge bundle mode constant that specifies that all multi-edges (edges with same endpoints) should be distinguished. - * Hence, if such edges connect two nodes on different pages, a separate connector pair (see - * {@link yfiles.multipage.NodeType#CONNECTOR}) is used for each of them. - * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask - */ - DISTINGUISH_MULTI_EDGES, - /** - * Edge bundle mode constant that specifies that multi-edges (edges with same endpoints) should be distinguished if they - * have different directions. Hence, two edges with the same endpoints may share a connector pair (see - * {@link yfiles.multipage.NodeType#CONNECTOR}) if they point in the same direction (i.e., both have the same source and target - * node). - * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask - */ - DISTINGUISH_DIRECTIONS, - /** - * Edge bundle mode constant that specifies that multi-edges (edges with same endpoints) should be distinguished if they - * are of different (user specified) type, see {@link yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY}. Hence, two edges with the - * same endpoints and same type may share a connector pair (see {@link yfiles.multipage.NodeType#CONNECTOR}). - * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask - * @see yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY - */ - DISTINGUISH_TYPES - } - export enum NodeType{ - /** - * A node type that specifies a normal node. - *

- * A node is called normal if it does not belong to any other type. - *

- * @see yfiles.multipage.INodeInfo#type - */ - NORMAL, - /** - * A node type that specifies a group node. - *

- * A group node is a node that may contain other nodes. - *

- * @see yfiles.multipage.INodeInfo#type - */ - GROUP, - /** - * A node type that specifies a proxy node. - *

- * A proxy node is a copy of a {@link yfiles.multipage.NodeType#NORMAL normal node}. It is created by the algorithm if a normal node and its neighbors or associated {@link yfiles.multipage.NodeType#CONNECTOR connectors} - * do not fit onto a single page. Hence, in such cases, the neighbors/connectors associated with a normal node may be - * distributed among different proxy nodes associated with this node. - *

- * @see yfiles.multipage.INodeInfo#type - * @see yfiles.multipage.NodeType#NORMAL - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - */ - PROXY, - /** - * A node type that specifies a proxy reference node. - *

- * For each {@link yfiles.multipage.NodeType#PROXY proxy node} there is exactly one matching proxy reference node. The reference node refers to the proxy and is - * either connected to the {@link yfiles.multipage.NodeType#NORMAL normal node} associated with this proxy or one of its other proxy nodes (a normal node may be - * associated with multiple proxy nodes). Hence, for a node connected to a proxy reference node there always exists a copy - * located on another page. - *

- * @see yfiles.multipage.INodeInfo#type - * @see yfiles.multipage.NodeType#PROXY - */ - PROXY_REFERENCE, - /** - * A node type that specifies a connector node. - *

- * Each edge of the input graph that connects two nodes v and w that are placed on different pages is split by a pair of - * matching connector nodes (one for each of the two pages). One of the connector nodes is connected to v and the other to - * w. Hence, each connector represents a jump mark to the matching connector and guarantees that no information is lost as - * it would be the case if such edges are simply removed. - *

- * @see yfiles.multipage.INodeInfo#type - */ - CONNECTOR - } - /** - * A class that holds all information associated with an edge. - * @interface - */ - export interface IEdgeInfo extends yfiles.lang.Object{ - /** - * Gets the unique ID of the associated edge. - * @see yfiles.multipage.MultiPageLayoutResult#getEdgeInfo - * @see yfiles.multipage.IElementInfoManager#getEdgeInfo - * @abstract - * @type {any} - */ - id:any; - /** - * Gets the type of the associated edge. - * @abstract - * @type {yfiles.multipage.EdgeType} - */ - type:yfiles.multipage.EdgeType; - /** - * Gets the original edge associated with this {@link yfiles.multipage.IEdgeInfo}. - *

- * More precisely, for edges of {@link yfiles.multipage.IEdgeInfo#type type} {@link yfiles.multipage.EdgeType#CONNECTOR}, this method returns the edge of the input graph - * that was split by the connector edge. Otherwise, it returns null. - *

- * @see yfiles.multipage.EdgeType#CONNECTOR - * @abstract - * @type {yfiles.algorithms.Edge} - */ - representedEdge:yfiles.algorithms.Edge; - } - var IEdgeInfo:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.IEdgeInfo; - }; - /** - * A class that holds all information related to an edge label. - * @interface - */ - export interface IEdgeLabelInfo extends yfiles.lang.Object{ - /** - * Gets the unique ID of the associated edge label. - * @see yfiles.multipage.MultiPageLayoutResult#getEdgeLabelInfo - * @see yfiles.multipage.IElementInfoManager#getEdgeLabelInfo - * @abstract - * @type {any} - */ - id:any; - } - var IEdgeLabelInfo:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.IEdgeLabelInfo; - }; - /** - * Factory used by class {@link yfiles.multipage.MultiPageLayout} to create special nodes and edges. - * @interface - */ - export interface IElementFactory extends yfiles.lang.Object{ - /** - * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#CONNECTOR}. - *

- * Such an edge connects the given {@link yfiles.multipage.NodeType#CONNECTOR connector} and opposite node. - *

- * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param connector the endpoint of the edge that represents the connector node - * @param opposite the other endpoint of the edge - * @param origEdgeId the ID of the edge that is split by the connector edge - * @param atTarget true if the connector node is the target of the edge, false otherwise - * @returns the created connector edge - * @see yfiles.multipage.EdgeType#CONNECTOR - * @see yfiles.multipage.NodeType#CONNECTOR - * @see yfiles.multipage.LayoutContext#createEdge - * @abstract - */ - createConnectorEdge(context:yfiles.multipage.LayoutContext,connector:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,origEdgeId:any,atTarget:boolean):yfiles.algorithms.Edge; - /** - * Callback method for creating a node of type {@link yfiles.multipage.NodeType#CONNECTOR}. - * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param edgesIds a {@link list} that contains the IDs of edges that are split by this connector - * @param representedNodeId the ID of the node that is represented by this connector - * @returns the created connector node - * @see yfiles.multipage.NodeType#CONNECTOR - * @see yfiles.multipage.LayoutContext#createNode - * @see yfiles.multipage.INodeInfo#representedNode - * @abstract - */ - createConnectorNode(context:yfiles.multipage.LayoutContext,edgesIds:yfiles.algorithms.YList,representedNodeId:any):yfiles.algorithms.Node; - /** - * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY}. - *

- * Such an edge should connect the given {@link yfiles.multipage.NodeType#PROXY proxy} and opposite node. - *

- * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param proxyNode the endpoint of the edge that represents the proxy node - * @param opposite the other endpoint of the new edge - * @param replacingEdgeId the ID of the related edge that is connected to the original node - * @param origNodeId the ID of the original node to which the proxy node refers - * @returns the created proxy edge - * @see yfiles.multipage.EdgeType#PROXY - * @see yfiles.multipage.NodeType#PROXY - * @see yfiles.multipage.LayoutContext#createEdge - * @abstract - */ - createProxyEdge(context:yfiles.multipage.LayoutContext,proxyNode:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,replacingEdgeId:any,origNodeId:any):yfiles.algorithms.Edge; - /** - * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY}. - * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param origNodeId the ID of the node for which a proxy has to be created - * @returns the created proxy node - * @see yfiles.multipage.LayoutContext#createNode - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - * @see yfiles.multipage.NodeType#PROXY - * @abstract - */ - createProxyNode(context:yfiles.multipage.LayoutContext,origNodeId:any):yfiles.algorithms.Node; - /** - * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY_REFERENCE}. - *

- * Such an (undirected) edge should connect the given {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference} and opposite node. - *

- * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param proxyReference the endpoint of the edge that represents the proxy reference node - * @param opposite the other endpoint of the new edge - * @param referencingCopyId the ID of the proxy node that is referenced by the proxy reference node - * @returns the created proxy reference edge - * @see yfiles.multipage.EdgeType#PROXY_REFERENCE - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - * @see yfiles.multipage.LayoutContext#createEdge - * @abstract - */ - createProxyReferenceEdge(context:yfiles.multipage.LayoutContext,proxyReference:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,referencingCopyId:any):yfiles.algorithms.Edge; - /** - * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY_REFERENCE}. - * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param referringProxyId the ID of the proxy to which the created node refers - * @returns the new proxy reference node - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - * @see yfiles.multipage.LayoutContext#createNode - * @see yfiles.multipage.NodeType#PROXY - * @abstract - */ - createProxyReferenceNode(context:yfiles.multipage.LayoutContext,referringProxyId:any):yfiles.algorithms.Node; - } - var IElementFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.IElementFactory; - }; - /** - * Interface that offers access to the information objects of graph elements. - * @interface - */ - export interface IElementInfoManager extends yfiles.lang.Object{ - /** - * Returns the edge information object of the given edge. - * @param edge the edge for which the information object should be returned - * @returns the edge information object of the given edge - * @abstract - */ - getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; - /** - * Returns the edge label information object of the given edge label layout. - * @param edgeLabelLayout the edge label layout for which the information object should be returned - * @returns the edge label information object of the given edge label layout - * @abstract - */ - getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; - /** - * Returns the node information object of the given node. - * @param node the node for which the information object should be returned - * @returns the node information object of the given node - * @abstract - */ - getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; - /** - * Returns the node label layout information object of the given node label layout. - * @param nodeLabelLayout the node label layout for which the information object should be returned - * @returns the node label information object of the given node label layout - * @abstract - */ - getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; - } - var IElementInfoManager:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.IElementInfoManager; - }; - /** - * Callback that is invoked when a {@link yfiles.multipage.MultiPageLayout} has calculated a new multi-page layout. - * @interface - */ - export interface ILayoutCallback extends yfiles.lang.Object{ - /** - * Invoked from {@link yfiles.multipage.MultiPageLayout#applyLayout} when a new multi-page layout has been calculated. - * @param result the result of the layout calculation - * @see yfiles.multipage.MultiPageLayout#applyLayout - * @abstract - */ - layoutDone(result:yfiles.multipage.MultiPageLayoutResult):void; - } - var ILayoutCallback:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.ILayoutCallback; - }; - /** - * This interface offers access to information associated with a node. - *

- * The information can be either obtained from {@link yfiles.multipage.MultiPageLayoutResult#getNodeInfo} or - * {@link yfiles.multipage.LayoutContext#getNodeInfo}. - *

- * @interface - */ - export interface INodeInfo extends yfiles.lang.Object{ - /** - * Gets the node of the input graph that is represented by the node associated with this {@link yfiles.multipage.INodeInfo info object}. - *

- * Note that, for the special nodes inserted to guarantee that no information is lost, there are no corresponding nodes in - * the input graph. Hence, special nodes are mapped to common nodes in the following way: - *

- *
    - *
  • A {@link yfiles.multipage.NodeType#CONNECTOR connector node} is mapped to the common node connected to the matching connector.
  • - *
  • A {@link yfiles.multipage.NodeType#PROXY proxy node} is mapped to the associated common node (i.e., the proxy is a copy of that node).
  • - *
  • A {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node} is not mapped to any node, and, thus this method returns null for such nodes.
  • - *
- * @abstract - * @type {yfiles.algorithms.Node} - */ - representedNode:yfiles.algorithms.Node; - /** - * Gets the page number of the {@link yfiles.multipage.MultiPageLayoutResult#getPage page graph} that contains the node associated with this {@link yfiles.multipage.INodeInfo info object}. - * @abstract - * @type {number} - */ - pageNo:number; - /** - * Gets the type of the node associated with this {@link yfiles.multipage.INodeInfo info object}. - * @abstract - * @type {yfiles.multipage.NodeType} - */ - type:yfiles.multipage.NodeType; - /** - * Gets the unique ID of the node associated with this {@link yfiles.multipage.INodeInfo info object}. - * @see yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY - * @abstract - * @type {any} - */ - id:any; - /** - * Gets the node that refers to the one associated with this {@link yfiles.multipage.INodeInfo info object}. - *

- * More precisely, if the node associated with this info object - *

- *
    - *
  • is a {@link yfiles.multipage.NodeType#CONNECTOR connector node}, this method returns the matching connector node,
  • - *
  • is a {@link yfiles.multipage.NodeType#PROXY proxy node}, it returns the corresponding {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node},
  • - *
  • is a {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node}, it returns the corresponding {@link yfiles.multipage.NodeType#PROXY proxy node},
  • - *
  • or otherwise, it returns null.
  • - *
- * @see yfiles.multipage.NodeType#CONNECTOR - * @see yfiles.multipage.NodeType#PROXY - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - * @abstract - * @type {yfiles.algorithms.Node} - */ - referencingNode:yfiles.algorithms.Node; - } - var INodeInfo:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.INodeInfo; - }; - /** - * A class that holds all information related to a node label. - * @interface - */ - export interface INodeLabelInfo extends yfiles.lang.Object{ - /** - * Gets the unique ID of the associated node label. - * @see yfiles.multipage.MultiPageLayoutResult#getNodeLabelInfo - * @see yfiles.multipage.IElementInfoManager#getNodeLabelInfo - * @abstract - * @type {any} - */ - id:any; - } - var INodeLabelInfo:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.INodeLabelInfo; - }; - /** - * This class represents the layout context. - *

- * It provides several methods to access data as well as adding and removing elements. - *

- * @class - * @implements {yfiles.multipage.IElementInfoManager} - */ - export interface LayoutContext extends yfiles.lang.Object,yfiles.multipage.IElementInfoManager{} - export class LayoutContext { - /** - * Adds a label to a given edge. - * @param label the label that should be added to the given edge - * @param labeledElement the edge to which the label should be added - */ - addEdgeLabel(label:yfiles.layout.IEdgeLabelLayout,labeledElement:yfiles.algorithms.Edge):void; - /** - * Adds a label to a given node. - * @param label the label that should be added to the given node - * @param labeledElement the node to which the label should be added - */ - addNodeLabel(label:yfiles.layout.INodeLabelLayout,labeledElement:yfiles.algorithms.Node):void; - /** - * All methods of the {@link yfiles.multipage.IElementFactory} have to use this method to create an edge. - * @param source the source of the edge - * @param target the target of the edge - * @param sameDataElementId the ID of the edge whose data should be copied to the created edge (or null if no data should be copied) - * @returns the created edge - * @see yfiles.multipage.IElementFactory - */ - createEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,sameDataElementId:any):yfiles.algorithms.Edge; - /** - * All methods of the {@link yfiles.multipage.IElementFactory} have to use this method to create a node. - * @param sameDataElementId the ID of the node whose data should be copied to the created node (or null if no data should be copied) - * @returns the created node - * @see yfiles.multipage.IElementFactory - */ - createNode(sameDataElementId:any):yfiles.algorithms.Node; - /** - * - * @param edge - * @returns - */ - getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; - /** - * - * @param edgeLabelLayout - * @returns - */ - getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; - /** - * - * @param node - * @returns - */ - getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; - /** - * - * @param nodeLabelLayout - * @returns - */ - getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; - /** - * Returns the edge of the input graph with the given ID or null if there is no such edge. - * @param id the ID of the edge that should be returned - * @returns the edge of the input graph with the given ID or null if there is no such edge - */ - getOriginalEdge(id:any):yfiles.algorithms.Edge; - /** - * Returns the node of the input graph with the given ID or null if there is no such node. - * @param id the ID of the node that should be returned - * @returns the node of the input graph with the given ID or null if there is no such node - */ - getOriginalNode(id:any):yfiles.algorithms.Node; - /** - * Returns the edge of a page graph (a graph that represents the result of the multi-page layout) with the given ID or null - * if there is no such edge. - * @param id the ID of the edge that should be returned - * @returns the edge of a page graph with the given ID or null if there is no such edge - */ - getPageEdge(id:any):yfiles.algorithms.Edge; - /** - * Returns the node of a page graph (a graph that represents the result of the multi-page layout) with the given ID or null - * if there is no such node. - * @param id the ID of the node that should be returned - * @returns the node of a page graph with the given ID or null if there is no such node - */ - getPageNode(id:any):yfiles.algorithms.Node; - /** - * Removes a label from a given edge. - * @param label the label that should be removed - * @param labeledElement the edge owning the label - * @returns - */ - removeEdgeLabel(label:yfiles.layout.IEdgeLabelLayout,labeledElement:yfiles.algorithms.Edge):boolean; - /** - * Removes a label from a given node. - * @param label the label that should be removed - * @param labeledElement the node owning the label - * @returns - */ - removeNodeLabel(label:yfiles.layout.INodeLabelLayout,labeledElement:yfiles.algorithms.Node):boolean; - /** - * Gets the relevant graph. - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets the layouter object that belongs to this layout context. - * @type {yfiles.multipage.MultiPageLayout} - */ - layout:yfiles.multipage.MultiPageLayout; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.LayoutContext; - } - /** - * This layout algorithm subdivides the input graph into several {@link yfiles.layout.LayoutGraph}s (called page graphs) such that - * the layout (calculated by the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}) of each graph fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. - *

- * The algorithm adds special nodes to guarantee that no information is lost when splitting edges that connect nodes placed - * on different pages (for more details take a look at the concept described below). {@graph {"ann":{"s":[45,30],"d":1},"n":[[165,210,60,30,[[187.94,234.96,14.11,19.93,"G"]]],[271.88,210,30,30,[[280.18,234.96,13.39,19.93,"H"]]],[148.12,450,60,30,[[171.79,474.96,12.67,19.93,"V"]]],[166.88,375,[[183.04,399.96,12.67,19.93,"P"]]],[391.88,510,60,30,[[415.9,534.96,11.94,19.93,"Z"]]],[23.12,510,[[39.29,534.96,12.67,19.93,"Y"]]],[436.88,375,[[453.4,399.96,11.94,19.93,"T"]]],[376.88,375,30,30,[[385.54,399.96,12.67,19.93,"S"]]],[455.62,210,30,30,[[466.82,234.96,7.61,19.93,"I"]]],[30,450,60,30,[[53.31,474.96,13.39,19.93,"U"]]],[436.88,450,[[453.04,474.96,12.67,19.93,"X"]]],[15,375,30,30,[[23.31,399.96,13.39,19.93,"N"]]],[455.62,285,30,30,[[463.21,309.96,14.83,19.93,"M"]]],[350.62,285,75,30,[[382.51,309.96,11.23,19.93,"L"]]],[165,285,[[182.25,309.96,10.5,19.93,"J"]]],[166.88,135,75,30,[[198.04,159.96,12.67,19.93,"E"]]],[241.88,375,30,30,[[249.82,399.96,14.11,19.93,"Q"]]],[75,375,30,30,[[82.94,399.96,14.11,19.93,"O"]]],[120,60,60,30,[[143.31,84.96,13.39,19.93,"C"]]],[33.75,0,[[49.91,24.96,12.67,19.93,"A"]]],[358.12,450,[[372.49,474.96,16.27,19.93,"W"]]],[75,135,[[90.81,159.96,13.39,19.93,"D"]]],[256.88,285,60,30,[[280.54,309.96,12.67,19.93,"K"]]],[301.88,375,[[317.68,399.96,13.39,19.93,"R"]]],[45,60,[[61.16,84.96,12.67,19.93,"B"]]],[271.88,135,30,30,[[280.9,159.96,11.94,19.93,"F"]]]],"e":[[11,9,0,15,-20,-15,[30,420,40,420]],[13,6,25,15,-11.25,-15,[413.12,330,448.12,330]],[7,20,0,15,11.25,-15],[25,1,0,15,0,-15],[13,23,-25,15,11.25,-15,[363.12,330,335.62,330]],[10,4,0,15,20,-15,[459.38,495,441.88,495]],[1,22,0,15,0,-15],[22,16,-20,15,0,-15,[266.88,330,256.88,330]],[14,3,11.25,15,-11.25,-15,[198.75,345,178.12,345]],[0,14,0,15,11.25,-15,[195,255,198.75,255]],[17,9,0,15,20,-15,[90,420,80,420]],[3,2,-11.25,15,0,-15],[24,9,-11.25,15,0,-15,[56.25,105,60,105]],[3,20,11.25,15,-11.25,-15,[200.62,420,369.38,420]],[18,15,20,15,0,-15,[170,105,204.38,105]],[15,0,-9.38,15,0,-15],[9,5,0,15,11.25,-15,[60,495,56.88,495]],[15,2,-28.12,15,-20,-15,[176.25,180,150,180,150,420,158.12,420]],[12,6,0,15,11.25,-15],[0,13,20,15,-18.75,-15,[215,255,369.38,255]],[14,17,-11.25,15,0,-15,[176.25,330,90,330]],[15,3,9.38,15,11.25,-15,[213.75,195,240,195,240,360,200.62,360]],[24,21,11.25,15,-11.25,-15,[78.75,105,86.25,105]],[19,11,-11.25,15,0,-15,[45,45,30,45]],[15,13,28.12,15,18.75,-15,[232.5,180,406.88,180]],[22,23,20,15,-11.25,-15,[306.88,330,313.12,330]],[19,24,11.25,15,0,-15],[0,5,-20,15,-11.25,-15,[175,255,0,255,0,495,34.38,495]],[8,12,0,15,0,-15],[18,21,-20,15,11.25,-15,[130,105,108.75,105]],[18,14,0,15,-11.25,-15,[150,120,135,120,135,270,176.25,270]],[20,4,0,15,-20,-15,[380.62,495,401.88,495]],[13,4,0,15,0,-15,[388.12,345,421.88,345]],[22,2,0,15,20,-15,[286.88,435,198.12,435]]],"vp":[0.0,0.0,486.0,540.0]}} - *

- *

- * The input graph. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"1":{"c": 1}},"n":[[523.12,293.69,500,500,2,[[523.12,316.06,500,22.38,"Page 2"]]],[-80.94,293.69,500,500,2,[[-80.94,316.06,500,22.38,"Page 1"]]],[261.56,588.69,45,30,[[277.73,613.65,12.67,19.93,"X"]]],[239.06,528.69,[[247.73,553.65,12.67,19.93,"S"]]],[186.56,588.69,45,30,[[200.93,613.65,16.27,19.93,"W"]]],[164.06,528.69,45,30,[[180.23,553.65,12.67,19.93,"P"]]],[15.94,458.69,75,30,[[47.1,483.65,12.67,19.93,"E"]]],[99.06,528.69,1,[[107.4,553.04,13.33,18.7,"G"]]],[29.06,528.69,1,[[38.73,553.04,10.67,18.7,"L"]]],[38.44,398.69,1,[[47.1,423.04,12.67,18.7,"C"]]],[322.81,458.69,45,30,[[340.06,483.65,10.5,19.93,"J"]]],[271.56,398.69,1,[[279.9,423.04,13.33,18.7,"G"]]],[341.56,398.69,1,[[350.23,423.04,12.67,18.7,"C"]]],[179.06,648.69,60,30,[[203.09,673.65,11.94,19.93,"Z"]]],[121.56,588.69,1,[[131.23,613.04,10.67,18.7,"L"]]],[341.56,528.69,[[349.51,553.65,14.11,19.93,"O"]]],[341.56,588.69,1,[[350.23,613.04,12.67,18.7,"U"]]],[-40.94,528.69,1,[[-31.94,553.04,12,18.7,"K"]]],[-20.94,588.69,60,30,[[2.73,613.65,12.67,19.93,"V"]]],[961.88,408.69,[[973.07,433.65,7.61,19.93,"I"]]],[961.88,468.69,[[969.46,493.65,14.83,19.93,"M"]]],[943.12,528.69,45,30,[[959.65,553.65,11.94,19.93,"T"]]],[855.62,468.69,75,30,[[887.51,493.65,11.23,19.93,"L"]]],[878.12,528.69,1,[[887.46,553.04,11.33,18.7,"Z"]]],[896.88,408.69,1,[[905.87,433.04,12,18.7,"E"]]],[775.62,408.69,60,30,[[798.57,433.65,14.11,19.93,"G"]]],[790.62,468.69,1,[[800.62,493.04,10,18.7,"J"]]],[790.62,358.69,1,[[799.62,383.04,12,18.7,"E"]]],[798.12,528.69,45,30,[[813.93,553.65,13.39,19.93,"R"]]],[620.62,468.69,60,30,[[644.29,493.65,12.67,19.93,"K"]]],[570.62,528.69,1,[[579.62,553.04,12,18.7,"V"]]],[710.62,468.69,45,30,[[726.79,493.65,12.67,19.93,"Y"]]],[635.62,408.69,[[643.93,433.65,13.39,19.93,"H"]]],[635.62,528.69,[[643.57,553.65,14.11,19.93,"Q"]]],[635.62,358.69,[[644.65,383.65,11.94,19.93,"F"]]],[615.62,728.69,60,30,[[638.93,753.65,13.39,19.93,"U"]]],[630.62,668.69,1,[[638.96,693.04,13.33,18.7,"O"]]],[695.62,668.69,45,30,[[711.79,693.65,12.67,19.93,"B"]]],[565.62,668.69,[[573.93,693.65,13.39,19.93,"N"]]],[718.12,728.69,45,30,[[733.93,753.65,13.39,19.93,"D"]]],[783.12,668.69,60,30,[[806.43,693.65,13.39,19.93,"C"]]],[798.12,728.69,1,[[807.12,753.04,12,18.7,"E"]]],[868.12,728.69,1,[[878.12,753.04,10,18.7,"J"]]],[569.38,608.69,45,30,[[585.54,633.65,12.67,19.93,"A"]]]],"e":[[9,6,0,15,0,-15],[4,13,0,15,0,-15],[15,16,0,15,0,-15],[3,4,0,15,11.25,-15,[254.06,568.69,220.31,568.69]],[12,10,0,15,11.25,-15],[6,7,9.38,15,0,-15,[62.81,508.69,114.06,508.69]],[10,15,11.25,15,0,-15],[5,4,11.25,15,-11.25,-15],[11,10,0,15,-11.25,-15,[286.56,438.69,334.06,438.69]],[17,18,0,15,-20,-15,[-25.94,568.69,-10.94,568.69]],[6,8,-9.38,15,0,-15],[14,13,0,15,-20,-15,[136.56,628.69,189.06,628.69]],[2,13,0,15,20,-15,[284.06,628.69,229.06,628.69]],[6,5,28.12,15,-11.25,-15,[81.56,498.69,175.31,498.69]],[5,18,-11.25,15,20,-15,[175.31,568.69,29.06,568.69]],[10,5,-11.25,15,11.25,-15,[334.06,498.69,197.81,498.69]],[6,18,-28.12,15,0,-15,[25.31,498.69,9.06,498.69]],[27,25,0,15,0,-15],[34,32,0,15,0,-15],[19,20,0,15,0,-15],[22,23,0,15,0,-15],[25,26,0,15,0,-15],[32,29,0,15,0,-15],[29,33,0,15,0,-15],[36,35,0,15,0,-15],[40,41,0,15,0,-15],[20,21,0,15,11.25,-15],[43,38,-11.25,15,0,-15],[24,22,0,15,18.75,-15],[37,39,11.25,15,-11.25,-15],[29,30,-20,15,0,-15,[630.62,508.69,585.62,508.69]],[38,35,0,15,-20,-15,[580.62,708.69,625.62,708.69]],[40,42,20,15,0,-15,[833.12,708.69,883.12,708.69]],[22,21,25,15,-11.25,-15,[918.12,508.69,954.38,508.69]],[22,28,-25,15,11.25,-15,[868.12,508.69,831.88,508.69]],[25,31,-20,15,11.25,-15,[785.62,448.69,744.38,448.69]],[37,35,-11.25,15,20,-15,[706.88,708.69,665.62,708.69]],[40,39,-20,15,11.25,-15,[793.12,708.69,751.88,708.69]],[25,22,20,15,-18.75,-15,[825.62,448.69,874.38,448.69]],[43,37,11.25,15,0,-15,[603.12,648.69,718.12,648.69]],[29,28,20,15,-11.25,-15,[670.62,508.69,809.38,508.69]],[35,31,-30,0,-14.5,-15,[555.62,743.69,555.62,348.69,718.62,348.69]]],"vp":[-81.0,293.0,1105.0,501.0]}} - *

- *

- * The input graph is subdivided into two pages with size 500x500. Circular nodes denote the so-called {@link yfiles.multipage.NodeType#CONNECTOR connectors} that - * split edges to nodes placed on other pages. The label of a connector corresponds to that of the opposite node of the - * split edge. - *

- *

- * Layout Style - *

- *

- * This multi-page layout algorithm subdivides the input graph into several smaller ones and applies existing layout - * algorithms to each of them. Hence, its layout style heavily depends on the selected {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} used for each - * single page. Furthermore, the algorithm uses several refinement steps to produce more compact results. - *

- *

- * Features - *

- *

- * Similar to the layout style, the supported feature set mainly depends on the features supported by the specified - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. Note that due to the underlying approach of the {@link yfiles.multipage.MultiPageLayout} it doesn't - * support {@link yfiles.layout.PartitionGrid}s. Furthermore, while the {@link yfiles.multipage.MultiPageLayout} is able to support groups - * (see {@link yfiles.multipage.MultiPageLayout#groupingMode}), it doesn't support edges incident to group nodes. - *

- *

- * Concept - *

- *

- * To guarantee that no information is lost, this layout algorithm replaces edges between nodes on different pages by - * so-called {@link yfiles.multipage.NodeType#CONNECTOR connector nodes}. Furthermore, it may replicate nodes (the clones are called {@link yfiles.multipage.NodeType#PROXY proxy nodes}) and insert special - * nodes to refer to such nodes (so-called {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference nodes}). - *

- *

- * Unlike other yFiles layout algorithms, {@link yfiles.multipage.MultiPageLayout} does not modify its input graph but returns its - * result as a {@link yfiles.multipage.MultiPageLayoutResult}. To be able to profit as much as possible from existing layout - * support, this layout algorithm implements the {@link yfiles.layout.ILayoutAlgorithm} interface, although method {@link yfiles.layout.ILayoutAlgorithm#applyLayout doLayout} does - * not specify a return value. Therefore, client code has to {@link yfiles.multipage.MultiPageLayout#layoutCallback register} a {@link yfiles.multipage.ILayoutCallback} that is invoked - * when the algorithm has calculated a new multi-page result. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface MultiPageLayout extends yfiles.layout.LayoutStageBase{} - export class MultiPageLayout { - /** - * Creates a new {@link yfiles.multipage.MultiPageLayout} instance. - * @param core the layout algorithm used for a single page - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - /** - * This method is called to further improve the layout results. - *

- * The marked nodes have to be placed without changing the coordinates of the fixed (non-marked) elements and without - * exceeding the specified maximum page size. Furthermore, the basic layout properties should be maintained. - *

- *

- * Subclasses may implement a custom layout strategy for this step. - *

- * @param graph the input graph - * @param incrementalNodesDP a {@link } that returns a boolean value indicating whether or not a node is marked; the positions - * of the non-marked nodes are not allowed to change - * @param context the current layout context - * @see yfiles.multipage.LayoutContext - * @protected - */ - applyIncrementalLayout(graph:yfiles.layout.LayoutGraph,incrementalNodesDP:yfiles.algorithms.IDataProvider,context:yfiles.multipage.LayoutContext):void; - /** - * Calculates a new multi-page layout for the specified graph. - *

- * Unlike method {@link yfiles.multipage.MultiPageLayout#applyLayout}, this method ignores the registered {@link yfiles.multipage.MultiPageLayout#layoutCallback layout callback} and - * directly returns the calculated {@link yfiles.multipage.MultiPageLayoutResult}. - *

- * @param graph the input graph - * @returns an instance of {@link } that represents the result of the layout run - * @throws {Stubs.Exceptions.ArgumentError} if for one of the keys {@link yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY}, {@link yfiles.multipage.MultiPageLayout#EDGE_ID_DP_KEY}, - * {@link yfiles.multipage.MultiPageLayout#NODE_LABEL_ID_DP_KEY} and {@link yfiles.multipage.MultiPageLayout#EDGE_LABEL_ID_DP_KEY} no {@link yfiles.algorithms.IDataProvider} - * is registered with the given graph - * @see yfiles.multipage.MultiPageLayoutResult - */ - calculateLayout(graph:yfiles.layout.LayoutGraph):yfiles.multipage.MultiPageLayoutResult; - /** - * This method creates the {@link yfiles.multipage.IElementFactory element factory} for multi-page layouts. - *

- * It is called once from {@link yfiles.multipage.MultiPageLayout#elementFactory} if no factory has been explicitly set using {@link yfiles.multipage.MultiPageLayout#elementFactory}. By default, this method returns an instance of - * {@link yfiles.multipage.DefaultElementFactory}. - *

- *

- * Subclasses may create a custom implementation of the element factory. - *

- * @returns the created element factory - * @see yfiles.multipage.MultiPageLayout#elementFactory - * @see yfiles.multipage.MultiPageLayout#elementFactory - * @see yfiles.multipage.IElementFactory - * @protected - */ - createElementFactory():yfiles.multipage.IElementFactory; - /** - * This method is called during a postprocessing step that reduces the number of connectors. - *

- * A pair of connectors can be removed if both connector nodes are placed on the same page. The method removes both - * connector nodes and restores the original edges by calling {@link yfiles.multipage.MultiPageLayout#routeRestoredEdges}. - *

- *

- * Subclasses may implement a custom remove/restore strategy. - *

- * @param connector1 the first connector of the connector pair - * @param connector2 the second connector of the connector pair - * @param originalEdgeIds the IDs of the original edges that have to be restored - * @param context the current layout context - * @returns true if the removal of the connector pair was successful, false otherwise - * @see yfiles.multipage.MultiPageLayout#routeRestoredEdges - * @protected - */ - removeConnectorPair(connector1:yfiles.algorithms.Node,connector2:yfiles.algorithms.Node,originalEdgeIds:yfiles.algorithms.YList,context:yfiles.multipage.LayoutContext):boolean; - /** - * This method is called whenever some single edges have to be routed without changing the position of nodes (e.g., by {@link yfiles.multipage.MultiPageLayout#removeConnectorPair} - * to route the restored edges). - *

- * It has to guarantee that the routes are fully contained within the given bounding rectangle. - *

- *

- * Subclasses may implement a custom routing strategy for the restored edges. - *

- * @param graph the relevant graph - * @param selectedEdgesDP a {@link } that returns a boolean value indicating whether or not an edge should be rerouted - * @param boundingRectangle the edge routes should be fully contained within this rectangle - * @see yfiles.multipage.MultiPageLayout#removeConnectorPair - * @protected - */ - routeRestoredEdges(graph:yfiles.layout.LayoutGraph,selectedEdgesDP:yfiles.algorithms.IDataProvider,boundingRectangle:yfiles.algorithms.YRectangle):void; - /** - * Data provider key for assigning a cluster ID to common (non-group) nodes - * @see yfiles.multipage.MultiPageLayout#strictClusterSeparation - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_CLUSTER_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for mapping each node of the input graph to a unique ID - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for mapping each edge of the input graph to a unique ID - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for mapping each edge label of the input graph to a unique ID - * @const - * @static - * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} - */ - static EDGE_LABEL_ID_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; - /** - * Data provider key for mapping each node label of the input graph to a unique ID - * @const - * @static - * @type {yfiles.algorithms.INodeLabelLayoutDpKey.} - */ - static NODE_LABEL_ID_DP_KEY:yfiles.algorithms.INodeLabelLayoutDpKey; - /** - * Data provider key for specifying the type of multi-edges - *

- * If {@link yfiles.multipage.MultiPageLayout#edgeBundleModeMask} & {@link yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES} == 1, multi-edges (edges with same endpoints) associated with - * different types (objects) are distinguished, i.e., they are split by different connector pairs (see - * {@link yfiles.multipage.NodeType#CONNECTOR}). - *

- * @see yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES - * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_TYPE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets whether or not the algorithm should separate nodes with different {@link yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY cluster IDs}. - *

- * More precisely, if this option is enabled, the algorithm doesn't place nodes with different cluster IDs onto the same - * page. Otherwise, such a placement is possible. - *

- * @see yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY - * @type {boolean} - */ - strictClusterSeparation:boolean; - /** - * Gets or sets whether or not the given {@link yfiles.multipage.MultiPageLayout#labeling labeling algorithm} places the labels of the input graph. - *

- * If this option is disabled, the labels are either ignored or placed by the integrated labeling approach of the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * @see yfiles.multipage.MultiPageLayout#labeling - * @type {boolean} - */ - labelingEnabled:boolean; - /** - * Gets or sets the {@link yfiles.multipage.IElementFactory element factory} for creating special nodes and edges in a multi-page layout. - *

- * If no element factory is set explicitly (see method {@link yfiles.multipage.MultiPageLayout#elementFactory}), a new instance is created and set by method {@link yfiles.multipage.MultiPageLayout#createElementFactory} - * during the first layout run. - *

- * @see yfiles.multipage.MultiPageLayout#createElementFactory - * @see yfiles.multipage.IElementFactory - * @type {yfiles.multipage.IElementFactory} - */ - elementFactory:yfiles.multipage.IElementFactory; - /** - * Gets or sets the {@link yfiles.multipage.ILayoutCallback callback} that is notified upon completion of multi-page layout calculation runs. - * @see yfiles.multipage.ILayoutCallback - * @type {yfiles.multipage.ILayoutCallback} - */ - layoutCallback:yfiles.multipage.ILayoutCallback; - /** - * Gets or sets the bit mask for defining edge bundles. - *

- * All multi-edges (edges with same endpoints) belonging to the same edge bundle are split by the same connector pair (see - * {@link yfiles.multipage.NodeType#CONNECTOR}). - *

- * @see yfiles.multipage.NodeType#CONNECTOR - * @type {yfiles.multipage.EdgeBundleModes} - */ - edgeBundleModeMask:yfiles.multipage.EdgeBundleModes; - /** - * Gets or sets how to handle special nodes (like connector and proxy nodes) with respect to groups. - * @throws {Stubs.Exceptions.ArgumentError} if the specified group mode is unknown - * @see yfiles.multipage.NodeType#CONNECTOR - * @see yfiles.multipage.NodeType#PROXY - * @type {yfiles.multipage.GroupingMode} - */ - groupingMode:yfiles.multipage.GroupingMode; - /** - * Gets or sets the preferred time limit (in milliseconds) for the layout algorithm. - *

- * The specified value has to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the preferred time limit is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that places the labels of the input graph. - * @see yfiles.multipage.MultiPageLayout#labelingEnabled - * @see yfiles.labeling.GenericLabeling - * @type {yfiles.layout.ILayoutStage} - */ - labeling:yfiles.layout.ILayoutStage; - /** - * Gets or sets the maximum size of a single page. - *

- * The layout algorithm subdivides the input graph such that each part is placed on a different page that fits the - * specified maximum size. - *

- *

- * Both the specified width and height have to be positive. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is not positive - * @see yfiles.multipage.MultiPageLayout#maximumDuration - * @type {yfiles.algorithms.YDimension} - */ - maximumPageSize:yfiles.algorithms.YDimension; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.MultiPageLayout; - } - /** - * This class represents the result of a layout run of {@link yfiles.multipage.MultiPageLayout}. - *

- * A layout run subdivides the input graph into several {@link yfiles.layout.LayoutGraph}s (called page graphs) such that the - * layout of each graph fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. This class provides access to the different page graphs (see - * method {@link yfiles.multipage.MultiPageLayoutResult#getPage}). - *

- *

- * An instance of this class can be either obtained by calling {@link yfiles.multipage.MultiPageLayout#calculateLayout} or - * {@link yfiles.multipage.MultiPageLayout#applyLayout}. In the latter case, a {@link yfiles.multipage.ILayoutCallback} has to be {@link yfiles.multipage.MultiPageLayout#layoutCallback set} - * before starting the layout run. - *

- * @class - * @implements {yfiles.multipage.IElementInfoManager} - */ - export interface MultiPageLayoutResult extends yfiles.lang.Object,yfiles.multipage.IElementInfoManager{} - export class MultiPageLayoutResult { - /** - * - * @param edge - * @returns - */ - getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; - /** - * - * @param edgeLabelLayout - * @returns - */ - getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; - /** - * - * @param node - * @returns - */ - getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; - /** - * - * @param nodeLabelLayout - * @returns - */ - getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; - /** - * Returns the page graph associated with the given page number. - *

- * A page graph is a subgraph of the input graph whose layout fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. - *

- * @param pageNo the given page number - * @returns the page graph associated with the given page number - * @throws {Stubs.Exceptions.IndexOutOfRangeError} if pageNo >= pageCount or pageNo < 0 - * @see yfiles.multipage.MultiPageLayoutResult#pageCount - */ - getPage(pageNo:number):yfiles.layout.LayoutGraph; - /** - * Returns the number of pages available in this {@link yfiles.multipage.MultiPageLayoutResult}. - *

- * Each page contains a {@link yfiles.multipage.MultiPageLayoutResult#getPage page graph} whose layout fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. - *

- * @returns the number of available pages - * @see yfiles.multipage.MultiPageLayoutResult#getPage - */ - pageCount():number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.MultiPageLayoutResult; - } - /** - * Specifies custom data for the {@link yfiles.multipage.MultiPageLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface MultiPageLayoutData extends yfiles.layout.LayoutData{} - export class MultiPageLayoutData { - constructor(); - /** - * Gets or sets the mapping from nodes to their unique IDs. - * @see yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their unique IDs. - * @see yfiles.multipage.MultiPageLayout#EDGE_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from node labels to their unique IDs. - * @see yfiles.multipage.MultiPageLayout#NODE_LABEL_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeLabelIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edge labels to their unique IDs. - * @see yfiles.multipage.MultiPageLayout#EDGE_LABEL_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their cluster id. - *

- * Nodes with the same cluster id should preferably be placed on the same page. - *

- * @see yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeClusterIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their type. - *

- * Multi-edges (edges with same endpoints) of different kind are distinguished if {@link yfiles.multipage.MultiPageLayout#edgeBundleModeMask} & {@link yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES} - * == 1. - *

- * @see yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeTypes:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.MultiPageLayoutData; - } - }export namespace circular{ - /** - * This layout algorithm arranges graphs in a circular fashion. - *

- * Layout Style The nodes are arranged in circles and stars which emphasize group and tree structures inside a graph. Circular layout - * algorithms find applications in many areas such as social networking, network management, WWW visualization, eCommerce, - * telecommunications. {@graph {"ann": {"s": [30,30], "d": 0, "c": 1},"n": [[558.09,362.1], [95.35,12.18], [0,148.17], [441.83,243.3], [540.68,299.26], [142.21,0], [298.88,449.09], [347.79,497.99], [232.08,466.99], [143.67,101.87], [100.64,154.2], [137.11,211.3], [206.74,126.62], [202.69,194.26], [263.08,582.7], [329.89,564.8], [214.18,533.79], [453.2,487.29], [528.46,21.5], [587.42,54.88], [478.49,67.27], [573.89,121.27], [506.57,128.93], [603.52,281.85], [620.93,344.69], [285.81,262.6], [259.33,689.12], [213.12,676.73], [311.63,331.4], [358.3,274.64]], "e": [[4,0], [4,3], [6,7], [6,8], [8,7], [1,9], [9,5], [9,10], [10,2], [10,11], [12,9], [11,13], [13,12], [15,14], [15,7], [14,16], [16,8], [16,7], [7,17], [18,19], [20,18], [19,21], [21,20], [20,22], [22,21], [22,3], [4,23], [0,24], [24,23], [25,13], [14,26], [14,27], [25,28], [28,6], [28,29], [29,25], [29,3]], "vp": [0.0,0.0,651.0,720.0]}} Circular layout with default settings {@graph {"ann": {"s": [30,30], "d": 0, "c" : 1},"n": [[452.67,672.8], [684.06,272.02], [661.72,203.26], [518.72,643.4], [29.9,484.57], [238.95,672.8], [661.72,484.57], [238.95,15.03], [0,343.92], [309.66,0], [114.42,600.9], [29.9,203.26], [452.67,15.03], [7.56,415.81], [114.42,86.93], [309.66,687.83], [381.96,0], [625.58,140.65], [172.91,643.4], [577.2,86.93], [381.96,687.83], [691.62,343.92], [7.56,272.02], [577.2,600.9], [625.58,547.18], [66.04,140.65], [684.06,415.81], [66.04,547.18], [518.72,44.44], [172.91,44.44]], "e": [[1,0], [1,2], [3,0], [1,5], [5,4], [4,6], [8,4], [9,7], [1,12], [13,4], [4,15], [5,15], [10,18], [18,7], [18,5], [18,1], [17,19], [19,2], [15,20], [20,0], [4,21], [8,21], [21,6], [11,22], [22,8], [20,23], [23,3], [23,13], [23,4], [23,24], [6,24], [14,25], [25,11], [25,22], [22,26], [2,26], [17,26], [26,24], [26,21], [1,27], [27,10], [27,18], [12,28], [28,2], [28,19], [7,29], [12,29], [29,14], [29,16], [29,18]], "vp": [0.0,0.0,722.0,718.0]}} Circular layout with {@link yfiles.circular.LayoutStyle#SINGLE_CYCLE} - * layout style ConceptThe layout algorithm performs three steps when calculating a circular arrangement for a graph: - *

- *
    - *
  1. - * It searches for partitions in the input graph depending on connectivity and on the given - * {@link yfiles.circular.CircularLayout#layoutStyle layout style}. Considering each partition as a node, the resulting graph has a tree-like structure. - *
  2. - *
  3. The partitions are laid out as circles using the selected {@link yfiles.circular.CircularLayout#partitionStyle partition style}.
  4. - *
  5. - * The algorithm delegates the layout calculation for the underlying tree (in which each node corresponds to a partition) - * to a specialized layout algorithm accessible by {@link yfiles.circular.CircularLayout#singleCycleLayout} or {@link yfiles.circular.CircularLayout#balloonLayout}. The partitions are moved to their final location. - *
  6. - *
- *

- * Features - *

- *

- * The layout algorithm places the nodes in circles that represent a partition. There are several ways to find partitions - * in the input graph. Which one is applied is defined using {@link yfiles.circular.CircularLayout#layoutStyle}. - *

- *

- * The nodes in a partition can either lie on or in the interior of a circle. The placement of the nodes affects the - * compactness of the layout and can be specified using {@link yfiles.circular.CircularLayout#partitionStyle}. - *

- *

- * Since edges are routed as straight lines, they may overlap with nodes or node labels. To resolve these overlaps, an edge - * routing algorithm (e.g. {@link yfiles.router.EdgeRouter} or {@link yfiles.router.OrganicEdgeRouter}) can be appended. - *

- *

- * This layout algorithm supports {@link yfiles.circular.CircularLayout#edgeBundling edge bundling}. In order to bundle the edges, the nodes of the graph are clustered in - * groups. Edge bundling is supported only if {@link yfiles.circular.CircularLayout#partitionStyle partition layout style} is set to {@link yfiles.circular.PartitionStyle#CYCLE} and {@link yfiles.circular.CircularLayout#layoutStyle layout style} - * is other than {@link yfiles.circular.LayoutStyle#BCC_ISOLATED}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface CircularLayout extends yfiles.layout.MultiStageLayout{} - export class CircularLayout { - /** - * Creates a new {@link yfiles.circular.CircularLayout} instance with the default settings. - */ - constructor(); - /** - * Data acceptor key for publishing the final circle information - *

- * For each node, the ID of the circle on which it was placed will be stored. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static CIRCLE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining custom node partitions - *

- * The {@link yfiles.algorithms.IDataProvider} needs to provide a mapping from {@link yfiles.algorithms.Node}s to unique {@link any} IDs for each - * group of nodes. These groups will form the circles in the layout. - *

- * @see yfiles.circular.LayoutStyle#CUSTOM_GROUPS - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static CUSTOM_GROUPS_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels preventing possible overlaps. - *

- * Nodes get temporarily enlarged such that they contain their labels. - *

- *

- * This might result in layouts that need much space. - *

- * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not, in the underlying tree, the children of a tree node are placed on a common radius. - *

- * Disabling this feature may produce more compact layout results. - *

- * @type {boolean} - */ - placeChildrenOnCommonRadius:boolean; - /** - * Gets or sets whether or not to take the coordinates of the input diagram into account when arranging the nodes of the - * partitions and the partitions themselves. - *

- * If enabled: - *

- *
    - *
  • - * For complex partitions (those consisting of more than one node), the layout algorithm tries to keep peripheral nodes and - * maintain their circular order around the center of the disk/circle. Other partitions that connect to this node are moved - * accordingly, if possible. - *
  • - *
  • - * For multiple partitions that connect to the same node, the layout algorithm tries to keep their circular order around - * this node. This only works as expected for {@link yfiles.circular.LayoutStyle#BCC_COMPACT} as layout style, since otherwise the - * underlying tree structure is not well defined. - *
  • - *
- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Gets or sets the maximum deviation angle allowed for an edge. - *

- * The deviation angle for an edge is the difference between its optimal angle away from the parent cycle and its actual - * angle. - *

- * @type {number} - */ - maximumDeviationAngle:number; - /** - * Gets or sets the global layout style for this layout algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown layout style is set - * @type {yfiles.circular.LayoutStyle} - */ - layoutStyle:yfiles.circular.LayoutStyle; - /** - * Gets the {@link yfiles.circular.SingleCycleLayout} instance used for laying out nodes on a single cycle. - *

- * Configuring this layout algorithm only affects layouts with only one partition. - *

- * @see yfiles.circular.CircularLayout#layoutStyle - * @type {yfiles.circular.SingleCycleLayout} - */ - singleCycleLayout:yfiles.circular.SingleCycleLayout; - /** - * Gets the {@link yfiles.tree.BalloonLayout} instance used for arranging multiple partitions. - *

- * Configuring this layout algorithm affects the arrangement of the partitions within the overall layout. - *

- * @see yfiles.circular.CircularLayout#layoutStyle - * @type {yfiles.tree.BalloonLayout} - */ - balloonLayout:yfiles.tree.BalloonLayout; - /** - * Gets or sets the style for the arrangement of each partition. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown style is given - * @type {yfiles.circular.PartitionStyle} - */ - partitionStyle:yfiles.circular.PartitionStyle; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. - *

- * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be - * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. - *

- * @type {yfiles.layout.EdgeBundling} - */ - edgeBundling:yfiles.layout.EdgeBundling; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.circular.CircularLayout; - } - export enum LayoutStyle{ - /** - * The specifier for a layout style where the nodes within a biconnected component of the input graph are treated as - * separate partitions. - *

- * If a node belongs to more than one biconnected component, it will be assigned to the one that seems to be more - * suitable. - *

- * @see yfiles.circular.CircularLayout#layoutStyle - */ - BCC_COMPACT, - /** - * The specifier for a layout style where the nodes within a biconnected component of the input graph are treated as - * separate partitions. - *

- * If a node belongs to more than one biconnected component, it will form an isolated partition and will be laid out in - * between of all its biconnected component cycles. - *

- * @see yfiles.circular.CircularLayout#layoutStyle - */ - BCC_ISOLATED, - /** - * The specifier for a layout style where the user can specify groups that will form separate partitions. To define the - * groups, a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.circular.CircularLayout#CUSTOM_GROUPS_DP_KEY} must be - * registered. - * @see yfiles.circular.CircularLayout#layoutStyle - */ - CUSTOM_GROUPS, - /** - * The specifier for a layout style where all nodes of the input graph will be placed on or in the interior of a single - * cycle. - * @see yfiles.circular.CircularLayout#layoutStyle - */ - SINGLE_CYCLE - } - export enum PartitionStyle{ - /** - * Specifier for a partition layout style where all nodes of a partition are placed on the boundary of a circle. - * @see yfiles.circular.CircularLayout#partitionStyle - */ - CYCLE, - /** - * Specifier for a partition style with a semi-compact layout for each partition. - *

- * This style places nodes in the interior and on the border of a circle and arranges them in an organic manner, leading to - * a more compact layout. Only nodes with connections to other partitions are guaranteed to lie on the boundary of the - * resulting disk. - *

- * @see yfiles.circular.CircularLayout#partitionStyle - */ - DISK, - /** - * Specifier for a partition style with a compact layout for each partition. - *

- * This style creates an organic circular layout for each partition. Even nodes that connect to different partitions may be - * placed in the interior of the resulting disk. - *

- * @see yfiles.circular.CircularLayout#partitionStyle - */ - ORGANIC - } - /** - * This layout algorithm places all nodes of a graph on a single cycle. - *

- * Layout Style - *

- *

- * All nodes of a graph are placed on one common circle, generating circular layouts. The edges are drawn as simple, straight lines. The - * resulting layouts look like a ring. Edges connecting nodes which are not next to each other on the ring are routed inside of the - * circle. If a graph contains many edges, the number of edge crossings inside the circle may be quite high. - *

- *

- * Single-cycle circular layouts are suitable for the visualization of networks such as ring networks or smaller social - * networks. They are also useful to layout cyclic subgraphs of a larger graph. - *

- *

- * {@graph {"ann":{"s":[40,40],"d":1,"c":1},"n":[[39.45,439.2],[459.2,19.45],[336.26,-5],[39.45,193.32],[109.09,543.42],[563.42,89.09],[633.06,193.32],[15,316.26],[213.32,613.06],[563.42,543.42],[336.26,637.52],[459.2,613.06],[633.06,439.2],[657.52,316.26],[213.32,19.45],[109.09,89.09]],"e":[[2,1,0,-4.59,0,-4.59],[4,0,-6.01,0,-6.01,0],[0,4,4.16,-2.78,4.16,-2.78],[1,5],[5,6],[1,2,-0.88,4.41,-0.88,4.41],[11,9],[10,11],[9,12,-4.16,-2.78,-4.16,-2.78],[13,12],[12,9,6.01,0,6.01,0],[14,15],[15,13,0,-4.87,0,-4.87],[7,12,0.88,-4.41,0.88,-4.41],[6,8],[8,14,-5,0,-5,0],[14,8,5,0,5,0],[7,3],[3,15,-4.16,-2.78,-4.16,-2.78],[15,3,6.01,0,6.01,0],[12,7,0,4.59,0,4.59],[0,7],[10,8],[6,13],[4,8]],"vp":[15.0,-5.0,683.0,683.0]}} An example of a single cycle layoutConceptFirst, the nodes are sorted by applying either a custom or some default - * {@link yfiles.algorithms.INodeSequencer}. Then, all nodes are placed on a circle with an appropriate radius according to the - * calculated order. Features - *

- *

- * The order in which the nodes are placed on the circle is a crucial aspect of this algorithm. By specifying a {@link yfiles.algorithms.INodeSequencer} - * instance via {@link yfiles.circular.SingleCycleLayout#nodeSequencer}, the order can be customized. - *

- *

- * There are two options to determine the radius of the circle on which nodes are placed: - *

- *
    - *
  1. The radius can be determined automatically. A specified {@link yfiles.circular.SingleCycleLayout#minimumRadius minimum radius} will be obeyed when choosing the radius.
  2. - *
  3. The radius can be chosen manually. To do so, disable the {@link yfiles.circular.SingleCycleLayout#automaticRadius automatic radius selection} and specify the custom radius via {@link yfiles.circular.SingleCycleLayout#fixedRadius}.
  4. - *
- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface SingleCycleLayout extends yfiles.layout.MultiStageLayout{} - export class SingleCycleLayout { - /** - * Creates a new {@link yfiles.circular.SingleCycleLayout} instance with default settings. - */ - constructor(); - /** - * Gets or sets the angle that describes the location on the circle of the first node. - *

- * The angle is measured in radians and world coordinates, e.g., 0 means east, Pi/2 means south. - *

- * @type {number} - */ - initialAngle:number; - /** - * Gets or sets whether or not to consider the coordinates of the input diagram when arranging the graph. - *

- * If this feature is enabled, the original circular order of peripheral nodes around an estimated circle center will be - * preserved. - *

- * @type {boolean} - */ - fromSketchModeEnabled:boolean; - /** - * Gets or sets the minimum distance between nodes that are next to each other on the circle. - * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets a fixed radius for the circle on which the nodes will be placed. - * @throws {Stubs.Exceptions.ArgumentError} if the given radius is negative - * @see yfiles.circular.SingleCycleLayout#minimumRadius - * @see yfiles.circular.SingleCycleLayout#automaticRadius - * @type {number} - */ - fixedRadius:number; - /** - * Gets or sets the minimum radius for the circle on which the nodes are placed. - * @throws {Stubs.Exceptions.ArgumentError} if the given minimum radius is negative - * @see yfiles.circular.SingleCycleLayout#fixedRadius - * @see yfiles.circular.SingleCycleLayout#automaticRadius - * @type {number} - */ - minimumRadius:number; - /** - * Gets or sets whether or not the radius of the circle should be determined automatically. - *

- * If enabled, the radius will be chosen such that the distance between nodes which are next to each other on the circle is - * approximately the same as the {@link yfiles.circular.SingleCycleLayout#minimumNodeDistance minimum node distance}. - *

- *

- * If this feature is disabled, the radius specified via {@link yfiles.circular.SingleCycleLayout#fixedRadius} will be applied. - *

- * @see yfiles.circular.SingleCycleLayout#minimumRadius - * @see yfiles.circular.SingleCycleLayout#fixedRadius - * @type {boolean} - */ - automaticRadius:boolean; - /** - * Gets or sets the custom {@link yfiles.algorithms.INodeSequencer} that will be used for determining the order of the nodes for - * the circle placement. - * @type {yfiles.algorithms.INodeSequencer} - */ - nodeSequencer:yfiles.algorithms.INodeSequencer; - /** - * Gets the radius that was applied to the last layout calculated by this algorithm. - *

- * This method is useful if one wants to know the actual radius of a layout calculated by this algorithm. - *

- * @type {number} - */ - lastAppliedRadius:number; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.circular.SingleCycleLayout; - } - /** - * Specifies custom data for the {@link yfiles.circular.CircularLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface CircularLayoutData extends yfiles.layout.LayoutData{} - export class CircularLayoutData { - constructor(); - /** - * Gets or sets the mapper from nodes to their circle id. - *

- * If this property is set, the mapper is filled by the layout with the circle information. - *

- * @see yfiles.circular.CircularLayout#CIRCLE_ID_DP_KEY - * @type {yfiles.collections.IMapper.} - */ - circleIds:yfiles.collections.IMapper; - /** - * Gets or sets the mapping from nodes to their custom group object. - *

- * The custom groups are only considered if {@link yfiles.circular.CircularLayout#layoutStyle} is set to {@link yfiles.circular.LayoutStyle#CUSTOM_GROUPS} - *

- * @see yfiles.circular.CircularLayout#CUSTOM_GROUPS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - customGroups:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. - *

- * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the - * source and target point, the edges are again clearly split. - *

- *

- * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. - *

- * @see yfiles.layout.EdgeBundleDescriptor - * @see yfiles.circular.CircularLayout#edgeBundling - * @type {yfiles.layout.ItemMapping.} - */ - edgeBundleDescriptors:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.circular.CircularLayoutData; - } - }export namespace orthogonal{ - /** - * This class provides layout information for the edges of the graph. - *

- * {@link yfiles.orthogonal.EdgeLayoutDescriptor} is used by {@link yfiles.orthogonal.OrthogonalLayout} to determine the routing details - * for the edges (e.g. the segment length). - *

- *

- * An {@link yfiles.orthogonal.EdgeLayoutDescriptor} can be specified individually for each edge by using a {@link yfiles.algorithms.IDataProvider} - * which maps from an {@link yfiles.algorithms.Edge} to an {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance. The {@link yfiles.algorithms.IDataProvider} - * is registered with the graph with key {@link yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @class - */ - export interface EdgeLayoutDescriptor extends yfiles.lang.Object{} - export class EdgeLayoutDescriptor { - /** - * Creates a new instance of {@link yfiles.orthogonal.EdgeLayoutDescriptor} with the default settings. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance. - * @returns a copy of this {@link } instance - */ - createCopy():yfiles.orthogonal.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum length of the first segment of the edge path (at the source node). - *

- * The minimum length must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative - * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length of the last segment of the edge path (at the target node). - *

- * The minimum length must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the last segment is negative - * @type {number} - */ - minimumLastSegmentLength:number; - /** - * Gets or sets the minimum segment length of an edge. - *

- * The minimum length must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative - * @type {number} - */ - minimumSegmentLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.orthogonal.EdgeLayoutDescriptor; - } - export enum LayoutStyle{ - /** - * A layout style that produces orthogonal edges while maintaining the original node size. - * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - NORMAL, - /** - * A layout style that produces orthogonal edges and nodes of uniform size. - *

- * Before calculating the layout, all nodes will be assigned equal sizes. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - UNIFORM, - /** - * A layout style that modifies the size of nodes to minimize the overall number of bends. - *

- * The layout algorithm will enlarge nodes based on the number and position of their neighbors in order to minimize the - * number of required bends. The segments of all edges are either horizontal or vertical. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - BOX, - /** - * A layout style that produces non-orthogonal edges and resizes the nodes to a small uniform size. - *

- * This layout style resembles {@link yfiles.orthogonal.LayoutStyle#BOX}, but it resizes all nodes to equal size. - *

- *

- * It introduces additional bends into some edges and routes the last edge segment of these edges non-orthogonally to their - * adjacent nodes. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - MIXED, - /** - * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#NORMAL} that is best-suited for tree-like structures. - *

- * Larger subtrees are processed using a specialized tree layout algorithm which arranges all directed subtree structures - * in an optimized way. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - NORMAL_TREE, - /** - * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#MIXED} that maintains the original node size. - *

- * This style introduces additional bends into some edges and routes the last edge segment of these edges non-orthogonally - * to their adjacent nodes. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - FIXED_MIXED, - /** - * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#BOX} that maintains the original node size. - *

- * Nodes will be placed at the same positions as with - * {@link yfiles.orthogonal.LayoutStyle#FIXED_MIXED}, but edges will be routed strictly orthogonally. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - FIXED_BOX - } - /** - * This layout algorithm arranges graphs in an orthogonal fashion. - *

- * Layout Style - *

- *

- * This layout algorithm arranges the nodes of a given graph such that each edge is drawn as an alternating sequence of - * horizontal and vertical segments. - *

- *

- * It produces compact drawings with no overlapping nodes, few crossings and few bends and is well suited for small and - * medium-sized sparse graphs. - *

- *

- * Orthogonal drawings are common in engineering applications since they are able to provide clear representations of - * complex networks that can also be optimal with respect to diverse objective functions such as bend minimization or area - * minimization. Application domains of orthogonal drawings include software engineering, database schema representation, - * system management, knowledge representation, VLSI circuits and floor planning applications. - *

- *

- * {@graph {"ann": {"s": [30,30], "d": 0},"n": [[135,160], [210,385], [210,60], [285,160], [360,60], [435,285], [60,110], [135,385], [60,435], [210,160], [-15,110], [285,335], [360,235], [360,160], [435,385]], "e": [[3,4,0,-15,-15,10,[300,85]], [0,4,0,-15,0,-15,[150,25,375,25]], [2,4,15,0,-15,0], [3,5,5,15,-15,0,[305,300]], [4,5,15,0,0,-15,[450,75]], [0,6,-15,0,10,15,[85,175]], [5,6,15,0,0,-15,[500,300,500,0,75,0]], [7,1,15,0,-15,0], [7,0,0,-15,0,15], [1,8,0,15,15,0,[225,450]], [8,6,0,-15,0,15], [0,9,15,0,-15,0], [9,6,-10,-15,15,0,[215,125]], [9,3,15,0,-15,0], [9,2,0,-15,0,15], [9,1,0,15,0,-15], [10,8,0,15,-15,0,[0,450]], [10,6,15,0,-15,0], [3,11,0,15,0,-15], [11,1,0,15,15,-10,[300,390]], [12,5,15,0,-10,-15,[440,250]], [12,3,-15,0,10,15,[310,250]], [4,13,0,15,0,-15], [13,12,0,15,0,-15], [13,3,-15,0,15,0], [14,5,0,-15,0,15], [14,1,-15,0,15,0]], "vp": [-15.0,0.0,515.0,465.0]}} Orthogonal layout with default settings - *

- *

- * This algorithm also optionally supports {@link yfiles.orthogonal.OrthogonalLayout#DIRECTED_EDGE_DP_KEY directed edge drawings} (although not in combination with hierarchically nested - * graphs or the non-default - * {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle layout styles}). Application domains of directed orthogonal drawings include, for example, software engineering, database - * schema and system management. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[165,-15],[205,305],[45,345],[45,65],[205,145],[105,105],[45,405],[-15,405],[285,-15],[205,225],[125,185]],"e":[[5,0,15,-0,-5,15,[175,120]],[5,4,0,15,-15,-0,[120,160]],[5,2,-15,-0,10,-15,[70,120]],[6,4,15,-0,15,-0,[280,420,280,160]],[6,2,0,-15,0,15],[6,7,-15,-0,15,-0],[7,3,0,-15,-15,-0,[0,80]],[8,0,-15,-0,15,-0],[8,7,0,15,0,15,[300,460,0,460]],[2,9,15,-0,15,-0,[260,360,260,240]],[4,10,-10,15,15,-0,[210,200]],[10,1,0,15,-15,-0,[140,320]],[0,1,0,15,-10,-15,1,[180,280,210,280]],[0,3,-10,15,0,-15,1,[170,40,60,40]],[3,2,0,15,0,-15,1],[0,4,10,15,0,-15,1,[190,120,220,120]],[4,9,0,15,0,-15,1],[9,1,0,15,0,-15,1]],"vp":[-15.0,-15.0,330.0,475.0]}} Sample output of {@link yfiles.orthogonal.OrthogonalLayout} with default settings. Marked edges are considered as directed and - * the layout orientation is top-to-bottom. {@graph {"ann":{"s":[30,30],"d":1},"n":[[85,45],[265,105],[185,-15],[-15,165],[485,165],[265,225],[365,165],[85,225]],"e":[[0,1,15,-0,-15,-0,[160,60,160,120]],[0,2,15,-0,-15,-0,[160,60,160,0]],[2,1,15,10,-15,-10,[240,10,240,110]],[3,0,15,-0,-15,-0,[60,180,60,60]],[2,4,15,-0,-15,-0,[440,0,440,180]],[5,4,15,10,-15,-0,[340,250,340,280,440,280,440,180]],[1,6,15,-0,-15,-0,[320,120,320,180]],[5,6,15,-0,-15,-0,[320,240,320,180]],[6,4,15,-0,-15,-0],[3,7,15,-0,-15,-0,[60,180,60,240]],[7,5,15,-0,-15,-0]],"vp":[-15.0,-15.0,530.0,295.0]}} Sample output of {@link yfiles.orthogonal.OrthogonalLayout} with edge grouping. All - * edges are considered directed and the layout orientation is left-to-right. - *

- *

- * Also this algorithm supports hierarchically nested graphs (although not in combination with the directed edge drawings, - * the {@link yfiles.orthogonal.OrthogonalLayout#fromSketchMode from sketch} option, or the non-default {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle layout styles}) feature: - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[165,585],[0,220,240,340,2,[[0,242.38,240,22.38,"Group 2"]]],[165,385],[165,485],[45,485],[45,385],[105,385],[260,200,200,260,2,[[260,222.38,200,22.38,"Group 3"]]],[305,325],[305,265],[365,325],[305,385],[0,0,240,200,2,[[0,22.38,240,22.38,"Group 1"]]],[165,125],[105,125],[45,125],[45,65],[165,65],[265,485]],"e":[[3,2,0,-15,0,15],[3,0,0,15,0,-15],[4,3,15,0,-15,0],[5,4,0,15,0,-15],[2,6,-15,0,15,0],[6,5,-15,0,15,0],[8,9,0,-15,0,15],[2,9,0,-15,-15,0,[180,280]],[8,10,15,0,-15,0],[10,9,0,-15,15,10,[380,290]],[9,11,15,0,15,0,[420,280,420,400]],[8,11,0,15,0,-15],[2,11,15,0,-15,0],[11,10,15,-10,0,15,[380,390]],[6,14,0,-15,0,15],[14,13,15,0,-15,0],[5,15,0,-15,0,15],[15,14,15,0,-15,0],[16,15,0,15,0,-15],[13,17,0,-15,0,15],[17,16,-15,0,15,0],[3,18,15,0,-15,0]],"vp":[0.0,0.0,460.0,615.0]}} Orthogonal layout of a grouped graph with default settings {@graph {"ann":{"s":[30,30],"d":1},"n":[[-15,-17.38,670,794.75,2,[[-15,5,670,22.38,"Group 6"]]],[0,20,620,680,2,[[0,42.38,620,22.38,"Group 5"]]],[40,460,240,200,2,[[40,482.38,240,22.38,"Group 2"]]],[205,585,[[214.66,609.35,10.67,18.7,"9"]]],[205,525,[[211.33,549.35,17.35,18.7,"10"]]],[85,525,[[91.33,549.35,17.35,18.7,"11"]]],[85,585,[[91.33,609.35,17.35,18.7,"10"]]],[120,80,460,360,2,[[120,102.38,460,22.38,"Group 4"]]],[160,140,180,260,2,[[160,162.38,180,22.38,"Group 1"]]],[265,325,[[274.66,349.35,10.67,18.7,"1"]]],[205,325,[[214.66,349.35,10.67,18.7,"2"]]],[205,205,[[214.66,229.35,10.67,18.7,"3"]]],[265,205,[[274.66,229.35,10.67,18.7,"4"]]],[265,265,[[274.66,289.35,10.67,18.7,"5"]]],[360,160,180,240,2,[[360,182.38,180,22.38,"Group 3"]]],[405,325,[[411.33,349.35,17.35,18.7,"12"]]],[405,265,[[411.33,289.35,17.35,18.7,"13"]]],[465,265,[[471.33,289.35,17.35,18.7,"14"]]],[85,725,[[91.33,749.35,17.35,18.7,"19"]]],[205,725,[[211.33,749.35,17.35,18.7,"18"]]]],"e":[[4,3,0,15,0,-15],[4,5,-15,0,15,0],[3,6,-15,0,15,0],[6,5,0,-15,0,15],[9,10,-15,0,15,0],[10,5,-15,0,0,-15,[100,340]],[10,4,0,15,0,-15],[10,11,0,-15,0,15],[11,12,15,0,-15,0],[12,13,0,15,0,-15],[13,9,0,15,0,-15],[15,16,0,-15,0,15],[16,13,-15,0,15,0],[16,12,0,-15,15,0,[420,220]],[16,17,15,0,-15,0],[6,18,0,15,0,-15],[3,19,0,15,0,-15]],"vp":[-15.0,-18.0,670.0,796.0]}} Orthogonal layout of a graph with nested - * groupsConceptThe orthogonal layout algorithm is based on the topology-shape-metrics approach and runs in three phases: - *

- *
    - *
  • Planarization – A planar embedding is computed.
  • - *
  • Orthogonalization – The bends and the angles are computed.
  • - *
  • Compaction – The coordinates for the nodes and edges are determined.
  • - *
- *

- * Features - *

- *

- * There exist several different layout styles that the orthogonal layout algorithm supports depending on whether or not - * the edges should be routed completely orthogonal, or whether or not the original size of the nodes should be maintained. - * Such layout styles are {@link yfiles.orthogonal.LayoutStyle#NORMAL}, {@link yfiles.orthogonal.LayoutStyle#UNIFORM}, - * {@link yfiles.orthogonal.LayoutStyle#BOX}, {@link yfiles.orthogonal.LayoutStyle#NORMAL_TREE}, {@link yfiles.orthogonal.LayoutStyle#MIXED}, - * {@link yfiles.orthogonal.LayoutStyle#FIXED_BOX}, {@link yfiles.orthogonal.LayoutStyle#FIXED_MIXED} and can be applied using {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle}. - *

- *

- * {@link yfiles.orthogonal.OrthogonalLayout} is able to consider edge label data when arranging a graph. This means that the - * layout algorithm will determine the positions of the nodes and edges such that the edge labels do not overlap with the - * rest of the layout. Integrated edge labeling can be activated using method {@link yfiles.orthogonal.OrthogonalLayout#integratedEdgeLabeling}. - *

- *

- * {@link yfiles.orthogonal.EdgeLayoutDescriptor} instances can be used for specifying individual information (e.g. distances) for - * each edge in the graph. The descriptors are bound to the graph using {@link yfiles.algorithms.IDataProvider}s registered with - * key {@link yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If there is no descriptor assigned to some edges, - * a default descriptor will be used. To set default descriptors, use {@link yfiles.orthogonal.OrthogonalLayout#edgeLayoutDescriptor}. - *

- *

- * {@link yfiles.orthogonal.OrthogonalLayout} tries to optimize diverse objective functions such as bend minimization, number of - * edge crossings, edge length minimization or face maximization. These settings can be enabled using the corresponding - * methods {@link yfiles.orthogonal.OrthogonalLayout#optimizePerceivedBends}, {@link yfiles.orthogonal.OrthogonalLayout#crossingReduction}, {@link yfiles.orthogonal.OrthogonalLayout#edgeLengthReduction}, and - * {@link yfiles.orthogonal.OrthogonalLayout#faceMaximization}, respectively. The drawback when these settings are enabled is that the running time of the algorithm may be - * drastically increased. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface OrthogonalLayout extends yfiles.layout.MultiStageLayout{} - export class OrthogonalLayout { - /** - * Creates a new {@link yfiles.orthogonal.OrthogonalLayout} instance with default settings. - */ - constructor(); - /** - * Returns a new {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance that will be used during the various phases of the layout - * algorithm to determine the drawing details of the edges of the graph. - *

- * This method may be overridden to create a new {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance with different - * configuration settings. - *

- * @returns a new {@link } instance - * @protected - */ - createEdgeLayoutDescriptor():yfiles.orthogonal.EdgeLayoutDescriptor; - /** - * Data provider key for providing layout information for each edge - *

- * If no edge layout descriptor is mapped for an edge, a default edge layout descriptor will be obtained using method - * {@link yfiles.orthogonal.OrthogonalLayout#createEdgeLayoutDescriptor}. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for marking edges which should be routed such that they point to the main layout orientation - *

- * The main layout orientation can be set using method {@link yfiles.layout.MultiStageLayout#layoutOrientation}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DIRECTED_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific - * layout descriptor assigned. - *

- * By default, this method will return an {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance created with - * {@link yfiles.orthogonal.OrthogonalLayout#createEdgeLayoutDescriptor}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.orthogonal.EdgeLayoutDescriptor} is null - * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.orthogonal.EdgeLayoutDescriptor} - */ - edgeLayoutDescriptor:yfiles.orthogonal.EdgeLayoutDescriptor; - /** - * Gets or sets whether or not the layout algorithm considers node labels when calculating node positions to avoid - * overlaps. - *

- * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} - * and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to true. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though this property was enabled - * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not the layout algorithm preserves space and places edge labels. - *

- * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on - * {@link yfiles.layout.IEdgeLabelLayout}. - *

- *

- * This method also assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to - * true. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though integrated labeling was enabled - * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). - * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets whether or not a randomization strategy should be performed. - *

- * The randomization will increase the overall layout quality with high probability. The drawback is that the running time - * of the layout algorithm may increase. - *

- * @type {boolean} - */ - randomization:boolean; - /** - * Gets or sets whether or not degree-one nodes that have the same neighbor should be aligned. - * @type {boolean} - */ - alignDegreeOneNodes:boolean; - /** - * Gets or sets whether or not one face of the embedding of the graph should be maximized. - *

- * An embedding of a graph is uniquely specified by the cyclic order of edges incident to the same node in a graph - * drawing. - *

- *

- * In any planar drawing of a planar graph, the edges divide the plane into different regions called faces. If one of these - * faces (the outer face) gets maximized, all other faces will be more compact. - *

- * @see yfiles.orthogonal.OrthogonalLayout#randomization - * @type {boolean} - */ - faceMaximization:boolean; - /** - * Gets or sets whether or not the number of edge crossings should be reduced. - *

- * The layout algorithm will try to significantly reduce the number of crossings in a post-processing step. - *

- * @type {boolean} - */ - crossingReduction:boolean; - /** - * Gets or sets whether or not the number of perceived bends should be minimized. - *

- * A perceived bend is not an actual bend but it is created when a helical arrangement of chains of nodes occurs. - *

- * @type {boolean} - */ - optimizePerceivedBends:boolean; - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * Each node will be placed on a grid point. Edges will be routed such that all segments but the first and last one lie on - * grid lines. (The first and last segments of an edge may or may not lie on grid lines.) Edges consisting of a single - * segment always lie on grid lines. - *

- *

- * The grid spacing has to be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the grid spacing is negative - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets the layout style for this layout algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown layout style is given - * @type {yfiles.orthogonal.LayoutStyle} - */ - layoutStyle:yfiles.orthogonal.LayoutStyle; - /** - * Gets or sets whether or not the overall edge length should be optimized. - *

- * The algorithm will try to significantly reduce the length of some edges. - *

- * @type {boolean} - */ - edgeLengthReduction:boolean; - /** - * Gets or sets whether or not the existing drawing should be used as a sketch of the resulting orthogonal layout. - *

- * The layout algorithm will try to orthogonalize the given sketch without making too many modifications with respect to - * the original drawing. - *

- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.orthogonal.OrthogonalLayout; - } - /** - * This layout algorithm arranges a graph in a compact, orthogonal fashion. - *

- * Layout Style - *

- *

- * This layout algorithm is a variant of {@link yfiles.orthogonal.OrthogonalLayout} that tries to arrange nodes in a more compact - * way. It allows to specify a desired aspect ratio for the bounds of the calculated layout. Nodes of a given graph are - * arranged such that each edge is drawn as an alternating sequence of horizontal and vertical segments. - *

- *

- * {@link yfiles.orthogonal.CompactOrthogonalLayout} is well suited for small and medium-sized sparse graphs and produces compact - * drawings with no overlapping nodes, few crossings and few bends. It is also especially suitable for printing the diagram - * on a paper of predefined size. As a disadvantage, this algorithm will usually produce less elegant edge routes than the - * ones of {@link yfiles.orthogonal.OrthogonalLayout}. - *

- *

- * Application domains of orthogonal drawings are software engineering, project management, function call graphs and - * object-oriented class diagrams. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[165,65],[285,405],[285,125],[225,285],[25,285],[225,365],[105,365],[285,205],[105,285],[165,205],[165,-15],[365,205]],"e":[[0,2,15,0,-5,-15,[295,80]],[4,1,-5,15,-15,0,[35,420]],[5,3,0,-15,0,15],[5,6,-15,5,15,5],[6,4,-15,0,5,15,[45,380]],[1,7,0,-15,0,15],[3,7,5,-15,-15,5,[245,225]],[2,7,0,15,0,-15],[4,8,15,0,-15,0],[3,8,-15,0,15,0],[6,8,0,-15,0,15],[4,9,-0,-15,-15,-5,[40,215]],[0,9,-5,15,-5,-15],[3,9,-5,-15,5,15,[235,261,185,261]],[8,9,-0,-15,-15,5,[120,225]],[9,5,-5,15,-15,-5,[175,375]],[9,7,15,-5,-15,-5],[9,2,5,-15,-15,0,[185,140]],[0,10,0,-15,0,15],[4,10,-15,0,-15,0,[23,300,23,0]],[10,3,15,-5,15,0,[397,-5,397,300]],[10,2,15,5,5,-15,[305,5]],[2,11,15,0,0,-15,[380,140]],[11,5,0,15,15,0,[380,380]],[11,7,-15,0,15,0]],"vp":[23.0,-15.0,374.0,450.0]}} Sample output of the layout algorithm with aspect ratio 1.0Concept - *

- *

- * This algorithm is implemented as a {@link yfiles.layout.PartitionLayout} and applies the following steps: - *

- *
    - *
  • - * Divides the graph into smaller partitions using the partition finder instance created by - * {@link yfiles.layout.PartitionLayout#createEdgeBetweennessPartitionFinder}. - *
  • - *
  • Arranges the nodes of each graph partition using {@link yfiles.orthogonal.OrthogonalLayout}.
  • - *
  • - * Arranges the partitions themselves in a compact manner using the partition placer instance created by - * {@link yfiles.layout.PartitionLayout#createComponentPartitionPlacer}. - *
  • - *
  • Routes the edges between partitions (inter-edges) using the router instance created by CreateChannelInterEdgeRouter.
  • - *
- *

- * Each of these steps can be individually configured and/or replaced. To do so, use methods {@link yfiles.layout.PartitionLayout#partitionFinder}, {@link yfiles.layout.LayoutStageBase#coreLayout}, {@link yfiles.layout.PartitionLayout#partitionPlacer} and {@link yfiles.layout.PartitionLayout#interEdgeRouter}, respectively. - *

- *

- * Features - *

- *

- * The aspect ratio of the resulting layout bounds, i.e., the ratio of width/height of the layout, can be configured using - * {@link yfiles.orthogonal.CompactOrthogonalLayout#aspectRatio}. {@link yfiles.orthogonal.CompactOrthogonalLayout} tries to reach this preferred value. However, depending on the actual graph - * structure, this may not always be possible. - *

- *

- * Octilinear routing of edges can be supported by appending {@link yfiles.router.PolylineLayoutStage}. - *

- * @class - * @extends {yfiles.layout.PartitionLayout} - */ - export interface CompactOrthogonalLayout extends yfiles.layout.PartitionLayout{} - export class CompactOrthogonalLayout { - /** - * Creates a new {@link yfiles.orthogonal.CompactOrthogonalLayout} instance with default settings. - */ - constructor(); - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * Each node will be placed on a grid point. Edges will be routed such that their segments lie on grid lines, if the - * endpoints of the edges allow to place the ports accordingly. - *

- *

- * The grid spacing has to be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the grid spacing is negative or zero - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets the desired aspect ratio (i.e. - *

- * the quotient width/height) of the resulting layout bounds. - *

- *

- * The aspect ratio needs to be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is less than or equal to zero - * @see yfiles.layout.PartitionLayout#partitionPlacer - * @see yfiles.layout.PartitionLayout.T1 - * @type {number} - */ - aspectRatio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.orthogonal.CompactOrthogonalLayout; - } - /** - * Specifies custom data for the {@link yfiles.orthogonal.OrthogonalLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface OrthogonalLayoutData extends yfiles.layout.LayoutData{} - export class OrthogonalLayoutData { - constructor(); - /** - * Gets or sets the mapping from edges to their {@link yfiles.orthogonal.EdgeLayoutDescriptor}. - * @see yfiles.orthogonal.EdgeLayoutDescriptor - * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets the collection of edges that should be routed in a way that point in the main layout direction. - * @see yfiles.orthogonal.OrthogonalLayout#DIRECTED_EDGE_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - directedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.orthogonal.OrthogonalLayoutData; - } - }export namespace radial{ - export enum CenterNodesPolicy{ - /** - * Specifier for a center nodes policy which chooses all nodes with in-degree equal to 0 as center nodes. If no node with - * this property is present, an arbitrary node will be selected. - * @see yfiles.radial.RadialLayout#centerNodesPolicy - * @see yfiles.algorithms.Trees#getRoot - */ - DIRECTED, - /** - * Specifier for a center nodes policy which chooses the node with the highest centrality as center node. - * @see yfiles.radial.RadialLayout#centerNodesPolicy - * @see yfiles.algorithms.Trees#getCenterRoot - */ - CENTRALITY, - /** - * Specifier for a center nodes policy which chooses the node with the highest weighted centrality as center node. - * @see yfiles.radial.RadialLayout#centerNodesPolicy - * @see yfiles.algorithms.Trees#getWeightedCenterNode - */ - WEIGHTED_CENTRALITY, - /** - * Specifier for a center nodes policy which uses center nodes specified by the user. The center nodes have to be specified - * using a {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.radial.RadialLayout#centerNodesDpKey according key}. The {@link yfiles.algorithms.IDataProvider} returns true - * for nodes that should be placed in the center. - *

- * If there exists more than one center node, they will be placed on the innermost circle while the center position stays - * empty. - *

- * @see yfiles.radial.RadialLayout#centerNodesPolicy - * @see yfiles.radial.RadialLayout#centerNodesDpKey - */ - CUSTOM - } - export enum LayeringStrategy{ - /** - * Specifier for a layering strategy that uses breadth first search (BFS) to determine a layering for the graph. All edges - * will span at most one layer in the resulting drawing. Edges between nodes that belong to the same layer are possible. - * @see yfiles.radial.RadialLayout#layeringStrategy - */ - BFS, - /** - * Specifier for a layering strategy that uses an optimal hierarchical layering strategy. The layer distance of an edge is - * the absolute difference between the layer numbers of its source and target node. Layer assignment will be done such that - * the overall sum of the layer distances of all edges in the layout is minimal. - * @see yfiles.radial.RadialLayout#layeringStrategy - */ - HIERARCHICAL - } - export enum EdgeRoutingStrategy{ - /** - * Specifier for an edge routing strategy that will route edges with polyline segments from source to target with one bend - * on each spanned circle. - * @see yfiles.radial.RadialLayout#edgeRoutingStrategy - */ - POLYLINE, - /** - * Specifier for an edge routing strategy that will route edges as arcs. The source and target of an edge as well as one - * bend on each spanned circle are used as main control points. An easing function is applied in order to calculate - * additional control points between the polar coordinates of the main control points. - * @see yfiles.radial.RadialLayout#edgeRoutingStrategy - */ - ARC - } - /** - * Info object used for retrieving information about each node from the layout algorithm. - *

- * The information can be retrieved by registering with the graph a {@link yfiles.algorithms.IDataProvider} (which should also - * implement the {@link yfiles.algorithms.IDataAcceptor} interface) using key {@link yfiles.radial.RadialLayout#NODE_INFO_DP_KEY}. The - * layout algorithm will return a {@link yfiles.radial.RadialLayoutNodeInfo} object with appropriately filled fields for each {@link yfiles.algorithms.Node} - * when the layout is calculated. - *

- * @class - */ - export interface RadialLayoutNodeInfo extends yfiles.lang.Object{} - export class RadialLayoutNodeInfo { - /** - * Creates a new {@link yfiles.radial.RadialLayoutNodeInfo} instance. - */ - constructor(); - /** - * Gets the index of the circle the node is placed on. - *

- * The circles used by the {@link yfiles.radial.RadialLayout} are indexed from the innermost to the outermost circle. Index 0 - * represents the center, i.e. the circle with radius 0. - *

- * @type {number} - */ - circleIndex:number; - /** - * Gets the radius of the circle the node is placed on. - * @type {number} - */ - radius:number; - /** - * Gets the offset from the center of the circle, the node is placed on, to the center of the node. - * @type {yfiles.algorithms.YPoint} - */ - centerOffset:yfiles.algorithms.YPoint; - /** - * Gets the start angle in degrees of the sector the node is placed in. - *

- * The angle refers to a counter-clockwise rotation starting at the 3 o'clock position. - *

- * @see yfiles.radial.RadialLayoutNodeInfo#sectorSize - * @type {number} - */ - sectorStart:number; - /** - * Gets the size in degrees of the sector the node is placed in. - * @see yfiles.radial.RadialLayoutNodeInfo#sectorStart - * @type {number} - */ - sectorSize:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.radial.RadialLayoutNodeInfo; - } - /** - * This layout algorithm arranges graphs in a radial fashion. - *

- * Layout Style The nodes are distributed into circles (layers) around a common center based on predefined {@link yfiles.radial.RadialLayout#layeringStrategy layering strategies}. Some - * potential applications include visualization of social networks, data clustering and bioinformatics. {@graph {"ann":{"s":[30,30],"d":1, "c":1, "bg": 0}, "styles" : {"6" : {"a" : 0.5,"c" : 1,"bg" : 1,"f" : null}},"n":[[-15,-15,1],[13.93,106.61],[65.6,80.55],[109.84,-8.76],[64.87,-111.16],[-81.77,-120.67],[-13.62,-139.99],[-133.34,-55.24],[-132.35,28.06],[-74.13,95.13],[-51.74,-262.29],[27.21,-261.41],[144.74,-207.31],[217.89,-105.89],[279.81,-246.76],[224.61,-303.47],[158.73,-347.33],[207.67,98.65],[230.47,32.36],[233.97,-37.66],[-114.67,214.27],[-185.45,167.88],[-53,232.09],[-295.24,234.18],[-243.87,282.06],[-220.04,-158.04],[-251.69,-95.49],[-264.73,-26.61],[-375,-381.52,750,750,6],[-255.95,-247.77,500,500,6],[-120,-120,240.76,240,6]],"e":[[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7],[0,8],[0,9],[9,8,[-70.52,125.91,-86.2,136.85,-105.19,140.56,-124.87,135.74,-141.6,122.91,-151.95,104.54,-153.96,84.38,-147.61,66.1,-134.58,52.11]],[6,10,[-1.65,-142.85,-15.61,-195.81,-28.91,-230.34]],[6,11,[4.82,-142.78,19.94,-195.41,34,-229.64]],[4,11,[82.38,-111.82,83.32,-128.06,82.62,-144.75,80.23,-161.75,76.13,-178.92,70.29,-196.12,62.69,-213.2,53.33,-230.01]],[4,12],[4,13,[94.6,-101.69,110.18,-105.84,126.49,-108.53,143.41,-109.7,160.83,-109.28,178.62,-107.22,214.79,-98.06]],[3,13,[138.89,0.42,165.98,-15.1,191.14,-35.68,213.67,-61.05,223.74,-75.44]],[12,14,[175.06,-199.78,223.92,-217.98,276.56,-229.49]],[12,15],[12,16,[164.26,-208.75,173.19,-260.12,174.85,-313.97]],[3,17,[138.24,13.42,163.65,31.57,186.64,54.55,206.52,82.04,215.1,97.36]],[3,18,[142.51,9.99,211.87,32.11,228.78,39.39]],[3,19,[142.79,4.26,214.01,-10.83,231.56,-16.39]],[9,20,[-67.21,129.42,-94.25,208.89]],[9,21,[-72.16,123.29,-101.29,147.07,-134.19,167.07,-151.93,175.53]],[21,7,[-170.54,166.68,-181.84,45.73,-180.63,25.53,-175.63,6.64,-167.31,-9.76,-156.5,-22.85,-144.15,-32.21,-131.17,-37.89]],[9,22,[-61.2,126.61,-61.38,160.54,-56.17,195.2,-45.44,229.93]],[21,23,[-185.24,193.48,-263.69,240.87]],[21,24,[-179.99,198.37,-221.74,279.97]],[7,25,[-131.46,-49.93,-155.99,-72.16,-177.9,-98.03,-196.82,-127.26]],[7,26],[7,27,[-134.65,-40.57,-167.65,-37.89,-200.78,-30.75,-233.59,-19.11]]],"vp":[-375.0,-382.0,750.0,751.0]}} Sample output of - * the layout algorithm with default settings and one center node {@graph {"ann":{"s":[30,30],"d":1, "c":1, "bg": 0}, "styles" : {"6" : {"a" : 0.5,"c" : 1,"bg" : 1,"f" : null}},"n":[[-168.28,-179.72],[-227.35,-89.37],[195.73,63.85],[208.34,-42.28],[-239.94,-9.73],[-217.86,82.33],[154.4,133.08],[-136.84,174.15],[96.65,-210.34],[-286.03,-236.46],[-80.8,-230.16],[-216.41,-301.24],[-345.33,-130.69],[-330.56,136.4],[-204.53,279.24],[-48.25,207.53],[170.9,-141.76],[-0.72,-239.55],[59.22,197.41],[153.75,291.63],[64.99,325.74],[93.56,447.43],[158.68,-318.87],[-415.1,241.02],[-465.07,136.87],[-272.22,384.33],[332.42,-57.43],[0.83,-113.74,1],[49.15,61.71,1],[80.56,-44.46,1],[-89.99,51.16,1],[-97,-72.24,1],[-465.42,-448.52,920,920,6],[-355.1,-344.73,700,700,6],[-226.03,-218.04,445,445,6],[-97,-100.15,194,194,6]],"e":[[0,9],[0,10],[0,11],[1,12],[1,13],[13,5],[7,14],[19,18],[20,18],[20,21],[8,22],[13,23],[23,14],[13,24],[14,25],[3,26],[10,27],[16,27],[27,17],[27,8],[28,18],[28,6],[28,2],[29,28],[29,16],[29,27],[29,3],[7,30],[30,28],[30,15],[30,4],[30,5],[31,27],[31,0],[31,1],[31,30]],"vp":[-466.0,-449.0,921.0,927.0]}} Sample output of the layout algorithm with straight-line - * edges and five center nodes using {@link yfiles.radial.CenterNodesPolicy#CUSTOM} policyConcept The layout algorithm creates a virtual - * tree structure for the input graph whose root node is placed in the center of the circles. All children of a tree node - * are placed on a higher layer (i.e. on a circle of larger radius) than their parent. A sector is calculated for each node - * such that the sector of each child node in the virtual tree is a sub-sector of its parent's sector. The radii of the - * circles are calculated based on the sizes of the sectors required to accommodate each whole subtree. Features - *

- *

- * There are different {@link yfiles.radial.RadialLayout#centerNodesPolicy center nodes policies} that can be applied in order to determine the nodes that will be placed in the - * center (single center node) or on the innermost circle (more than one center node). The distribution of the nodes to the - * circles is specified by a {@link yfiles.radial.RadialLayout#layeringStrategy layering strategy}. - *

- *

- * The edges are routed based on the - * {@link yfiles.radial.RadialLayout#edgeRoutingStrategy edge routing strategy}. Note that the edge routing cannot always prevent node-edge overlaps. - *

- *

- * The minimum distance between nodes of the same circle is specified using - * {@link yfiles.radial.RadialLayout#minimumNodeToNodeDistance}. If there are too many nodes assigned to a circle, the radius of the particular circle will be increased until all - * nodes fit onto it. - *

- *

- * The distance between consecutive layers is specified using {@link yfiles.radial.RadialLayout#layerSpacing}. The radii of the circles are a multiple of this spacing - * value. If the layer spacing is 0, the radii are chosen such that all nodes fit on their corresponding circles. A minimum - * layer distance is specified by {@link yfiles.radial.RadialLayout#minimumLayerDistance}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface RadialLayout extends yfiles.layout.MultiStageLayout{} - export class RadialLayout { - /** - * Creates a new {@link yfiles.radial.RadialLayout} instance with the default settings. - */ - constructor(); - /** - * Data acceptor key for publishing the circle ID and sector data - *

- * For each node, the ID of the circle and data regarding the circular sector on which it was placed will be stored. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_INFO_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the minimum distance between two neighboring nodes of the same circle. - * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @type {number} - */ - minimumNodeToNodeDistance:number; - /** - * Gets or sets the spacing between two consecutive circles (layers). - *

- * The spacing is a non-negative value, where 0 means that no spacing is considered. - *

- *

- * The radius of each circle will be a multiple of this value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the spacing value is negative - * @type {number} - */ - layerSpacing:number; - /** - * Gets or sets the minimum distance between two circles. - * @throws {Stubs.Exceptions.ArgumentError} if the minimum layer distance is negative - * @type {number} - */ - minimumLayerDistance:number; - /** - * Gets or sets the maximum sector angle around a node within which the node's children will be placed. - *

- * Based on the location of a given node, the sector of its children that lie on the next outer layer is described by this - * angle. The vertex of the angle is located in the center of the node while its sides point away from the inner circles. - * The child nodes are placed inside this angle. If there is not enough space, the radius of the child circle is - * increased. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the sector angle is negative or greater than 360 degrees - * @type {number} - */ - maximumChildSectorAngle:number; - /** - * Gets or sets the minimum bend angle (in degrees) between two adjacent edge segments. - *

- * The minimum bend angle is defined to be a value between 0 and 90 degrees. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum bend angle is negative or greater than 90 - * @type {number} - */ - minimumBendAngle:number; - /** - * Gets or sets the policy that determines which nodes are selected as roots of the (virtual) tree for the layout process - * and are set in the center of the circles. - * @throws {Stubs.Exceptions.ArgumentError} if an invalid center node policy is given - * @type {yfiles.radial.CenterNodesPolicy} - */ - centerNodesPolicy:yfiles.radial.CenterNodesPolicy; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected nodes that should be placed in the - * center. - * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - centerNodesDpKey:any; - /** - * Gets or sets the layering strategy that determines how nodes are distributed into different layers. - *

- * All nodes of a given layer will be placed on the same circle. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an invalid layering strategy is set - * @type {yfiles.radial.LayeringStrategy} - */ - layeringStrategy:yfiles.radial.LayeringStrategy; - /** - * Gets or sets the edge routing strategy. - * @throws {Stubs.Exceptions.ArgumentError} if an invalid edge routing strategy is set - * @type {yfiles.radial.EdgeRoutingStrategy} - */ - edgeRoutingStrategy:yfiles.radial.EdgeRoutingStrategy; - /** - * Gets or sets whether or not node labels are taken into account when calculating node positions. - *

- * Thereby, possible node/node label or node label/node label overlaps are prevented. - *

- * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. - *

- * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be - * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. - *

- * @type {yfiles.layout.EdgeBundling} - */ - edgeBundling:yfiles.layout.EdgeBundling; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.radial.RadialLayout; - } - /** - * Specifies custom data for the {@link yfiles.radial.RadialLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface RadialLayoutData extends yfiles.layout.LayoutData{} - export class RadialLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes that shall be placed in the center with {@link yfiles.radial.RadialLayout#centerNodesPolicy center node policy} set to {@link yfiles.radial.CenterNodesPolicy#CUSTOM} - * . - * @see yfiles.radial.RadialLayout#centerNodesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - centerNodes:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the mapping from nodes to a {@link yfiles.radial.RadialLayoutNodeInfo} describing on which circle and in which - * sector the node is placed. - *

- * If the mapper contains a {@link yfiles.radial.RadialLayoutNodeInfo} for a node, the layout will update its property during the - * layout. - *

- * @see yfiles.radial.RadialLayout#NODE_INFO_DP_KEY - * @type {yfiles.collections.IMapper.} - */ - nodeInfos:yfiles.collections.IMapper; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroups:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroups:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. - *

- * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the - * source and target point, the edges are again clearly split. - *

- *

- * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. - *

- * @see yfiles.layout.EdgeBundleDescriptor - * @see yfiles.radial.RadialLayout#edgeBundling - * @type {yfiles.layout.ItemMapping.} - */ - edgeBundleDescriptors:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.radial.RadialLayoutData; - } - }export namespace seriesparallel{ - /** - * {@link yfiles.seriesparallel.DefaultOutEdgeComparer} is the default implementation for the out-edge comparator used in - * {@link yfiles.seriesparallel.SeriesParallelLayout}. - *

- * It keeps the order of the edges in the graph for edges without {@link yfiles.layout.PortConstraint}s and considers the - * {@link yfiles.layout.PortConstraint}s such that the order of the target nodes of the outgoing edges is similar to the port - * location at the source node. Note that this won't work for all cases because the target nodes may not be completely - * independent. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer - * @class - * @implements {yfiles.collections.IComparer.} - */ - export interface DefaultOutEdgeComparer extends yfiles.lang.Object,yfiles.collections.IComparer{} - export class DefaultOutEdgeComparer { - /** - * Creates a {@link yfiles.seriesparallel.DefaultOutEdgeComparer} instance with default settings. - */ - constructor(); - /** - * Compares the two given edges considering their {@link yfiles.layout.PortConstraint}s. - *

- * The order of edges is kept unless there are - * {@link yfiles.layout.PortConstraint}s assigned. Then the edges will be sorted to avoid edge crossings. - *

- * @param o1 the first edge - * @param o2 the second edge - * @returns the order of the given two edges - */ - compare(o1:any,o2:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.DefaultOutEdgeComparer; - } - /** - * {@link yfiles.seriesparallel.DefaultPortAssignment} implements the default port assignment strategy. - *

- * Ports are either placed at the {@link yfiles.seriesparallel.PortAssignmentMode#CENTER center} or get {@link yfiles.seriesparallel.PortAssignmentMode#DISTRIBUTED distributed} at the sides of the node. - *

- *

- * If {@link yfiles.layout.PortConstraint}s are specified, the strong {@link yfiles.layout.PortConstraint}s are handled separately and keep - * their initial location relative to the node while weak - * {@link yfiles.layout.PortConstraint}s just influence on which side of the node the port is placed. - *

- *

- * If there are edge groups specified, the edges which belong to the same group get the same port locations. - *

- * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @class - * @implements {yfiles.seriesparallel.IPortAssignment} - */ - export interface DefaultPortAssignment extends yfiles.lang.Object,yfiles.seriesparallel.IPortAssignment{} - export class DefaultPortAssignment { - /** - * Creates a new {@link yfiles.seriesparallel.DefaultPortAssignment} instance using the given {@link yfiles.seriesparallel.DefaultPortAssignment#mode mode} and a given value for the {@link yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio ratio} - * of the gap between the border and the ports to the gap between the ports themselves. - * @param mode one of the predefined port assignment modes - * @param [ratio=0.5] the ratio of the distance between outer ports and the border to the distance between any two ports - * @throws {Stubs.Exceptions.ArgumentError} if the given mode is unknown or the given ratio is negative - */ - constructor(mode:yfiles.seriesparallel.PortAssignmentMode,ratio?:number); - /** - * Creates a new {@link yfiles.seriesparallel.DefaultPortAssignment} with default settings. - */ - constructor(); - /** - * Places the ports of edges connecting to the given node according to the {@link yfiles.seriesparallel.DefaultPortAssignment#mode port assignment mode}. - * @param graph the input graph - * @param node the node whose adjacent edges' ports should be placed - * @see yfiles.seriesparallel.DefaultPortAssignment#mode - */ - assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - /** - * Determines the distance between the outer ports and the border of the node. - *

- * This implementation calculates the gap according to the number of edges at one side of the node. It also includes the - * {@link yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio ratio between border gap and port gap}. - *

- *

- * This method is called by {@link yfiles.seriesparallel.DefaultPortAssignment#assignPorts} to calculate the location of the first - * port. It may be overridden to implement a different distribution of ports on the node's side. - *

- * @param sideLength the width/height of the side - * @param edgeCount the number of edges that connect to this side - * @returns the absolute gap to be used on both sides of the ports - * @see yfiles.seriesparallel.DefaultPortAssignment#assignPorts - * @see yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio - * @protected - */ - getPortBorderGap(sideLength:number,edgeCount:number):number; - /** - * Determines the distance between two adjacent ports. - *

- * This implementation calculates the gap according to the number of edges at one side of the node. The edges are - * distributed keeping the given gap to the border of the node. - *

- *

- * This method is called by {@link yfiles.seriesparallel.DefaultPortAssignment#assignPorts} to calculate the distance between two - * ports. It may be overridden to implement a different distribution of ports on the node's side. - *

- * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @param portBorderGap the port border gap (i.e. calculated by {@link #getPortBorderGap}) - * @returns the absolute distance to be used between two adjacent ports - * @see yfiles.seriesparallel.DefaultPortAssignment#assignPorts - * @see yfiles.seriesparallel.DefaultPortAssignment#getPortBorderGap - * @protected - */ - getPortDistanceDelta(sideLength:number,edgeCount:number,portBorderGap:number):number; - /** - * Gets or sets the mode that describes how ports are placed. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified - * @type {yfiles.seriesparallel.PortAssignmentMode} - */ - mode:yfiles.seriesparallel.PortAssignmentMode; - /** - * Gets or sets the ratio of the border gap (distance between the outer ports and the node border) to the port gap (distance between adjacent - * ports). - *

- * The ratio must have a positive value. If the ratio is - * 0, the ports will be distributed along the whole side of the node without a gap between the last port and the corner. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is negative - * @type {number} - */ - borderGapToPortGapRatio:number; - /** - * Gets or sets the fork style which influences the port assignment. - *

- * If the fork style is set to - * {@link yfiles.seriesparallel.ForkStyle#OUTSIDE_NODE}, edges without port constraints will be assigned in flow direction. - *

- *

- * If the fork style is set to - * {@link yfiles.seriesparallel.ForkStyle#AT_NODE}, the ports of edges in flow direction also get distributed to the sides unless - * they are without bends. Due to large minimum first/last segment lengths edges may overlap. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified fork style is unknown - * @type {yfiles.seriesparallel.ForkStyle} - */ - forkStyle:yfiles.seriesparallel.ForkStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.DefaultPortAssignment; - } - /** - * An {@link yfiles.seriesparallel.EdgeLayoutDescriptor} provides routing details for an edge that are considered by - * {@link yfiles.seriesparallel.SeriesParallelLayout}. - *

- * Such an {@link yfiles.seriesparallel.EdgeLayoutDescriptor} can either be specified for a single edge or shared by several edges. - * It is assigned by registering a {@link yfiles.algorithms.IDataProvider} with key - * {@link yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If no {@link yfiles.algorithms.IDataProvider} is - * registered with this key, {@link yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor a default descriptor} is used. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @see yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor - * @class - */ - export interface EdgeLayoutDescriptor extends yfiles.lang.Object{} - export class EdgeLayoutDescriptor { - /** - * Creates a new instance of {@link yfiles.seriesparallel.EdgeLayoutDescriptor} with default settings. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.seriesparallel.EdgeLayoutDescriptor} instance. - * @returns a copy of this {@link } instance - */ - createCopy():yfiles.seriesparallel.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum length for the associated edge. - *

- * The minimum length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} for negative edge lengths - * @type {number} - */ - minimumLength:number; - /** - * Gets or sets the minimum length for the first segment of the associated edge. - *

- * The minimum first segment length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} for negative minimum segment lengths - * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length for the last segment of the associated edge. - *

- * The minimum last segment length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} for negative minimum segment lengths - * @type {number} - */ - minimumLastSegmentLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.EdgeLayoutDescriptor; - } - export enum PortAssignmentMode{ - /** - * A port assignment specifier which defines that all ports are reset to the center of their nodes. - * @see yfiles.layout.PortConstraint - */ - CENTER, - /** - * A port assignment specifier which defines that the ports of incoming and outgoing edges are distributed evenly at the - * side of their nodes. - *

- * The source ports of edges without {@link yfiles.layout.PortConstraint}s will be distributed at the sides of their source and - * target nodes. Edges with weak {@link yfiles.layout.PortConstraint}s are distributed at the side of the nodes which is specified - * in the {@link yfiles.layout.PortConstraint}. - *

- *

- * Grouped edges will get the same port location. - *

- * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED - } - export enum ForkStyle{ - /** - * Fork style specifier that defines that the edges will fork outside a node. Edges leave/enter the nodes south/north and - * bend between their source and target. - */ - OUTSIDE_NODE, - /** - * Fork style specifier that defines that the edges will fork on a node. Edges leave/enter the nodes south/north if they - * are straight (no bends) or east and west of the node. - */ - AT_NODE - } - export enum RoutingStyle{ - /** - * Style constant describing an orthogonal edge style. If this style is used, edges will contain only horizontal and - * vertical segments. - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - */ - ORTHOGONAL, - /** - * Style constant describing an octilinear edge style. If this style is used, edges will contain horizontal, vertical and - * 45-degree sloped segments. - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - */ - OCTILINEAR, - /** - * Style constant describing a polyline edge style. If this style is used, edges will contain vertical and other sloped - * segments. - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - */ - POLYLINE - } - /** - * A {@link yfiles.seriesparallel.IPortAssignment} is used by {@link yfiles.seriesparallel.SeriesParallelLayout} for determining the - * locations of the edges' ports at their incident nodes. - * @interface - */ - export interface IPortAssignment extends yfiles.lang.Object{ - /** - * Assigns both the incoming edges' target ports as well as all source ports for the outgoing edges. - *

- * Outgoing edges are sorted according to the specified out-edge comparator from left to right and incoming edges are in - * the order of the subgraphs they are coming from. - *

- *

- * This method is called by {@link yfiles.seriesparallel.SeriesParallelLayout} before the actual layout of the graph takes place. - *

- * @param graph the graph instance the node is part of - * @param node the node whose incident edges' ports are assigned - * @see yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY - * @see yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer - * @abstract - */ - assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - } - var IPortAssignment:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.seriesparallel.IPortAssignment; - }; - /** - * This layout algorithm arranges series-parallel graphs. - *

- * Layout Style Series-parallel graphs are directed graphs with a single source (node without incoming edges) and a single sink (node - * without outgoing edges). The layout algorithm highlights the main layout direction (from source to sink). It also - * emphasizes the paths through the graph because edges are routed with few bends. - *

- *

- * {@link yfiles.seriesparallel.SeriesParallelLayout} is suitable for the visualization of circuits, call trees or flowcharts. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[226,0],[226,480],[278,60],[278,420],[0,270],[360,300],[300,300],[240,300],[240,180],[60,240],[0,330],[180,120],[120,240],[0,150],[180,270],[180,210],[338,180],[300,240],[436,240],[0,210],[240,240],[180,360],[360,240]],"e":[[0,1,[241,45,481.5,45,481.5,465,241,465]],[0,2,[241,45,293,45]],[3,1,[293,465,241,465]],[5,3,[375,405,293,405]],[6,3,[315,405,293,405]],[0,9,[241,45,75,45]],[9,1,[75,465,241,465]],[4,10],[10,1,[15,465,241,465]],[2,11,[293,105,195,105]],[11,8,[195,165,255,165]],[11,12,[195,165,135,165]],[0,13,[241,45,15,45]],[11,15],[15,14],[2,16,[293,105,353,105]],[16,3,[353,225,405.5,225,405.5,405,293,405]],[16,17,[353,225,315,225]],[17,6],[2,18,[293,105,451,105]],[18,3,[451,405,293,405]],[13,19],[19,4],[8,20],[20,7],[7,21,[255,345,195,345]],[14,21],[12,21,[135,345,195,345]],[21,3,[195,405,293,405]],[16,22,[353,225,375,225]],[22,5]],"vp":[0.0,0.0,482.0,510.0]}}Concept Series-parallel graphs are directed graphs with a single source (node without incoming edges) and a single sink (node - * without outgoing edges) that are built using only the following two rules: - *

- *
    - *
  1. Series composition: The source of a subgraph is merged with the sink of a second subgraph.
  2. - *
  3. Parallel composition: The sources and sinks of two subgraphs are merged.
  4. - *
- *

- * From the recursive structure of series-parallel graphs, the layout algorithm retrieves a decomposition tree where each - * node represents one of the decomposition types. Then, this tree is traversed recursively from bottom to top, aligning - * subgraphs above (series) or next to (parallel) each other until the whole graph is arranged. The edges are routed when - * both end nodes are placed. Different {@link yfiles.seriesparallel.SeriesParallelLayout#routingStyle routing styles} can be used. - *

- *

- * To avoid moving all nodes several times and to be aware of the area that the subtrees occupy, the layout algorithm keeps - * track of the shape of the subtrees. These shapes are moved and merged during the layout calculation. The layout - * algorithm also stores the connections between nodes and nodes that haven't already been placed in these shapes. - *

- *

- * Features - *

- *

- * {@link yfiles.seriesparallel.SeriesParallelLayout} can take strong - * {@link yfiles.layout.PortConstraint}s into account. It will connect the edges to the specified locations, the directions, - * however, will be ignored. - *

- *

- * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole - * series-parallel subgraph. Otherwise, the group nodes may overlap with each other or with other nodes. Edges which are - * connected to non-empty group nodes are not allowed. Furthermore, the user may specify minimum size constraints for each - * group node using {@link yfiles.algorithms.IDataProvider} key {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. - *

- *

- * The layout algorithm can be configured to reserve space for node labels and to place the edge labels along the edge such - * that the labels won't overlap with other graph elements. Edge labels are placed according to the information stored in a - * {@link yfiles.layout.PreferredPlacementDescriptor} instance. However, labels that should be centered between source and target - * are placed close to the target node, unless this edge connects to the local source and sink of a subgraph. - *

- *

- * Parallel subgraphs can be aligned in different ways. Depending on the node sizes, a different alignment can increase the - * compactness of the layout. - *

- *

- * The way in which edges are distributed around their incident nodes is computed by an instance of - * {@link yfiles.seriesparallel.IPortAssignment}. The {@link yfiles.seriesparallel.DefaultPortAssignment default assignment} is able to consider - * {@link yfiles.layout.PortConstraint}s and edge groups. - *

- *

- * The {@link yfiles.seriesparallel.SeriesParallelLayout#fromSketchMode From Sketch mode} allows to take the initial locations of the nodes into account. However, the layout algorithm won't - * insert crossings because it maintains the order of children of each node. - *

- *

- * {@link yfiles.seriesparallel.SeriesParallelLayout} supports custom sorting of the outgoing edges of a node. A {@link yfiles.collections.IComparer.} can be assigned - * individually for the nodes using a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY}. For all nodes for which the {@link yfiles.algorithms.IDataProvider} - * returns null, the layout algorithm falls back to the {@link yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer default comparator}. - *

- *

- * By default, this layout algorithm can only handle graphs with a series-parallel structure. To apply it to a general - * graph, {@link yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling general graph handling} needs to be activated. Then, the layout algorithm will temporarily add and/or remove some - * edges from the input graph until a series-parallel graph is obtained. The edges that were removed will be routed - * separately afterwards. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface SeriesParallelLayout extends yfiles.layout.MultiStageLayout{} - export class SeriesParallelLayout { - /** - * Creates a new {@link yfiles.seriesparallel.SeriesParallelLayout} instance with default settings. - */ - constructor(); - /** - * Determines whether or not the given graph has a series-parallel structure. - *

- * The current implementation detects the series-parallel graph structure in linear time. - *

- * @param graph the input graph - * @returns true if the given graph is series-parallel, false otherwise - * @static - */ - static isSeriesParallelGraph(graph:yfiles.algorithms.Graph):boolean; - /** - * Data provider key for storing individual settings for edges - *

- * If no edge layout descriptor is mapped for an edge, a default edge layout descriptor will be obtained by method {@link yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor}. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning different orderings for outgoing edges of the nodes - *

- * If the {@link yfiles.collections.IComparer.} associated with a node is null, the outgoing edges maintain their initial order. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.>} - */ - static OUT_EDGE_COMPARER_DP_KEY:yfiles.algorithms.NodeDpKey>; - /** - * Data provider key for providing an individual port distribution at nodes - *

- * If there is no {@link yfiles.seriesparallel.IPortAssignment} specified for a node, the layout algorithm uses the - * {@link yfiles.seriesparallel.SeriesParallelLayout#defaultPortAssignment default assignment}. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#defaultPortAssignment - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PORT_ASSIGNMENT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking edge labels of non-series-parallel edges - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelSelectionKey - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm - * @const - * @static - * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} - */ - static NON_SERIES_PARALLEL_EDGE_LABELS_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels to avoid overlaps. - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not the layout algorithm will place edge labels and reserve space for them. - * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets the vertical alignment of parallel subgraphs. - *

- * The alignment is defined by a ratio: - *

- *
    - *
  • Ratio 0 means that nodes are top-aligned
  • - *
  • Ratio 0.5 means that nodes are center-aligned
  • - *
  • Ratio 1 means that nodes are bottom-aligned
  • - *
- * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets whether or not the layout algorithm can handle general graphs. - *

- * General graphs are required to be transformed before being laid out (by adding or removing some edges) such that they - * satisfy the criteria of a series-parallel graph. After the layout, the graph will be restored and the initial edges - * which weren't included in the series-parallel graph are routed by a separate {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeRouter edge routing algorithm}. Furthermore, the - * labels of these edges are placed by a customizable {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm edge labeling algorithm}. - *

- * @type {boolean} - */ - generalGraphHandling:boolean; - /** - * Gets or sets the edge routing algorithm used for the edges of a general graph that are not part of the series-parallel - * subgraph whose layout is calculated. - * @throws {Stubs.Exceptions.ArgumentError} if null is specified - * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgesDpKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - nonSeriesParallelEdgeRouter:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used for marking non-series-parallel edges. - *

- * This key is used for determining the edges that are not part of the series-parallel structure in a general graph, such - * that the specified non-series-parallel edge router only routes marked edges. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given key is set to null - * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeRouter - * @type {any} - */ - nonSeriesParallelEdgesDpKey:any; - /** - * Gets or sets the labeling algorithm that is applied to all edge labels that belong to non-series-parallel edges. - * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelSelectionKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - nonSeriesParallelEdgeLabelingAlgorithm:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used by the {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm non-series-parallel edge labeling algorithm} - * to determine which edge labels it should place. - *

- * During the layout, a {@link yfiles.algorithms.IDataProvider} with this key will be registered with the graph. It will mark all - * {@link yfiles.layout.IEdgeLabelLayout}s that belong to non-series-parallel edges. A specified custom non-series-parallel edge - * labeling algorithm needs to obey this selection. If using {@link yfiles.labeling.GenericLabeling} as labeling algorithm, set - * this key as value of property {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey}. - *

- *

- * The labeling algorithm set as default is already configured such that it uses the correct selection key. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm - * @type {any} - */ - nonSeriesParallelEdgeLabelSelectionKey:any; - /** - * Gets or sets the default {@link yfiles.seriesparallel.IPortAssignment} used for those nodes that do not have their own specific - * instance. - *

- * A {@link yfiles.seriesparallel.IPortAssignment} instance is defined using a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with key {@link yfiles.seriesparallel.SeriesParallelLayout#PORT_ASSIGNMENT_DP_KEY}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if null is specified - * @type {yfiles.seriesparallel.IPortAssignment} - */ - defaultPortAssignment:yfiles.seriesparallel.IPortAssignment; - /** - * Gets or sets the default {@link yfiles.collections.IComparer.} used for sorting the outgoing edges incident to nodes that do not have a specific {@link yfiles.collections.IComparer.}. - *

- * Such a comparator is defined using a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY}. - *

- * @type {yfiles.collections.IComparer.} - */ - defaultOutEdgeComparer:yfiles.collections.IComparer; - /** - * Gets or sets the currently used routing style for edges. - * @type {yfiles.seriesparallel.RoutingStyle} - */ - routingStyle:yfiles.seriesparallel.RoutingStyle; - /** - * Gets or sets the minimum vertical distance of the edge segments that are not orthogonal. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified length is smaller than 0 - * @see yfiles.seriesparallel.SeriesParallelLayout#minimumSlope - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - * @see yfiles.seriesparallel.RoutingStyle#POLYLINE - * @type {number} - */ - minimumPolylineSegmentLength:number; - /** - * Gets or sets the minimum slope which a non-orthogonal edge segment should have. - *

- * A higher minimum slope prevents those segments in very wide graphs from becoming nearly horizontal. The slope needs to - * have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified slope is smaller than 0 - * @see yfiles.seriesparallel.SeriesParallelLayout#minimumPolylineSegmentLength - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - * @see yfiles.seriesparallel.RoutingStyle#POLYLINE - * @type {number} - */ - minimumSlope:number; - /** - * Gets or sets the preferred length for non-orthogonal segments in octilinear edge routes. - *

- * If there is not enough space, those segments may be shorter than the specified length. The length needs to be - * non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified length is smaller than 0 - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - * @see yfiles.seriesparallel.RoutingStyle#OCTILINEAR - * @type {number} - */ - preferredOctilinearSegmentLength:number; - /** - * Gets or sets the {@link yfiles.seriesparallel.EdgeLayoutDescriptor} instance used for all those edges that do not have a - * specific layout descriptor assigned. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.seriesparallel.EdgeLayoutDescriptor} is null - * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.seriesparallel.EdgeLayoutDescriptor} - */ - defaultEdgeLayoutDescriptor:yfiles.seriesparallel.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum distance between nodes. - *

- * This distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 - * @type {number} - */ - minimumNodeToNodeDistance:number; - /** - * Gets or sets the minimum distance between nodes and edges. - *

- * This distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 - * @type {number} - */ - minimumNodeToEdgeDistance:number; - /** - * Gets or sets the minimum distance between edges. - *

- * This distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 - * @type {number} - */ - minimumEdgeToEdgeDistance:number; - /** - * Gets or sets whether or not to take the coordinates of the input diagram into account when arranging the nodes. - *

- * The order of edges incident to the same source node will remain the same as in the original layout. - *

- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.SeriesParallelLayout; - } - /** - * Specifies custom data for the {@link yfiles.seriesparallel.SeriesParallelLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface SeriesParallelLayoutData extends yfiles.layout.LayoutData{} - export class SeriesParallelLayoutData { - constructor(); - /** - * Gets or sets the mapping from edges to their {@link yfiles.seriesparallel.EdgeLayoutDescriptor}. - * @see yfiles.seriesparallel.EdgeLayoutDescriptor - * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.seriesparallel.IPortAssignment}. - * @see yfiles.seriesparallel.SeriesParallelLayout#PORT_ASSIGNMENT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - portAssignments:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to comparison functions used to sort the nodes' outgoing edges. - * @see yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - outEdgeComparers:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.SeriesParallelLayoutData; - } - }} - -type yfiles_namespace = typeof yfiles; -declare module 'yfiles/algorithms' { export = yfiles; } -declare module 'yfiles/complete' { export = yfiles; } -declare module 'yfiles/lang' { export = yfiles.lang; } -declare module 'yfiles/layout' { export = yfiles; } -declare module 'yfiles/layout-familytree' { export = yfiles; } -declare module 'yfiles/layout-hierarchic' { export = yfiles; } -declare module 'yfiles/layout-multipage' { export = yfiles; } -declare module 'yfiles/layout-organic' { export = yfiles; } -declare module 'yfiles/layout-orthogonal' { export = yfiles; } -declare module 'yfiles/layout-orthogonal-compact' { export = yfiles; } -declare module 'yfiles/layout-partial' { export = yfiles; } -declare module 'yfiles/layout-radial' { export = yfiles; } -declare module 'yfiles/layout-seriesparallel' { export = yfiles; } -declare module 'yfiles/layout-tree' { export = yfiles; } -declare module 'yfiles/router-other' { export = yfiles; } -declare module 'yfiles/router-polyline' { export = yfiles; } -declare module 'yfiles/view' { export = yfiles; } -declare module 'yfiles/view-component' { export = yfiles; } -declare module 'yfiles/view-editor' { export = yfiles; } -declare module 'yfiles/view-folding' { export = yfiles; } -declare module 'yfiles/view-graphml' { export = yfiles; } -declare module 'yfiles/view-layout-bridge' { export = yfiles; } -declare module 'yfiles/view-table' { export = yfiles; } \ No newline at end of file diff --git a/types/yfiles/tslint.json b/types/yfiles/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/yfiles/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/types/yfiles/yfiles-tests.ts b/types/yfiles/yfiles-tests.ts deleted file mode 100644 index 5d13f4de75..0000000000 --- a/types/yfiles/yfiles-tests.ts +++ /dev/null @@ -1,175 +0,0 @@ -class BasicTest { - private readonly graphComponent:yfiles.view.GraphComponent; - - constructor() { - this.graphComponent = new yfiles.view.GraphComponent("graphControl"); - - let graphEditorInputMode = new yfiles.input.GraphEditorInputMode(); - - // Modify the MyHitTestable class to be usable with our class framework - yfiles.lang.Class.injectInterfaces(MyHitTestable.prototype, [yfiles.input.IHitTestable]); - let myHitTestable = new MyHitTestable(); - - if (yfiles.input.IHitTestable.isInstance(myHitTestable)) { - // If myHitTestable is recognized as instance of yfiles.drawing.IHitTestable by the yFiles class - // framework, set it as hit testable to prevent clicking any item. - // If you cannot click-select the nodes in the GraphControl, this worked correctly. - graphEditorInputMode.clickInputMode.validClickHitTestable = myHitTestable; - } - - this.graphComponent.inputMode = graphEditorInputMode; - - this.graphComponent.graph.nodeDefaults.style = new yfiles.styles.ShinyPlateNodeStyle({ fill: yfiles.view.Fill.ORANGE }); - - this.graphComponent.graph.createNode(new yfiles.geometry.Rect(0, 0, 10, 10), new MyNodeStyle()); - - this.layout(); - } - - start() { - for (let i = 0; i < 5; i++) { - for (let j = 0; j < 5; j++) { - this.graphComponent.graph.createNodeAt(new yfiles.geometry.Point(100 * i, 100 * j)); - } - } - this.graphComponent.graph.nodes.forEach((node) => this.graphComponent.graph.addLabel(node, "Label")); - this.graphComponent.fitGraphBounds(); - } - - /** - * Runs a layout algorithm and animates the transition to the new layout. - */ - layout() { - let layouter = new yfiles.hierarchic.HierarchicLayout(); - let layoutExecutor = new yfiles.layout.LayoutExecutor(this.graphComponent, - new yfiles.layout.MinimumNodeSizeStage(layouter)); - - layoutExecutor.duration = yfiles.lang.TimeSpan.fromSeconds(1); - layoutExecutor.animateViewport = true; - layoutExecutor.updateContentRect = true; - layoutExecutor.start().then(() => { - return null; - }) - .catch(error => { - throw error; - }); - } - - /** - * Runs a shortest path analysis. - */ - analyze() { - let graph = this.graphComponent.graph; - - // Create the graph model adapter to get a proper analysis graph structure. - let graphAdapter = new yfiles.layout.YGraphAdapter(graph); - - // Create an array the size of the edge set with costs for each edge. - let cost = new Array(graph.edges.size); - for (let i = 0; i < graph.edges.size; i++) { - cost[i] = Math.random(); - } - - let pred:yfiles.algorithms.Edge[] = null; - - // Suppose the first node from the graph is the node named "Start." - let startNode = graphAdapter.getCopiedNode(graph.nodes.first()); - // Suppose the last node from the graph is the node named "Destination." - let destinationNode = graphAdapter.getCopiedNode(graph.nodes.last()); - - // Run the single-source single-sink algorithm on the graph. - let result = yfiles.algorithms.ShortestPaths.singleSourceSingleSink(graphAdapter.yGraph, startNode, - destinationNode, true, cost, pred); - // Transfer back the result. - let predIGraph = new Array(pred.length); - for (let i = 0; i < pred.length; i++) { - predIGraph[i] = graphAdapter.getOriginalEdge(pred[i]); - } - } - - coreLib() { - new yfiles.lang.AttributeDefinition(() => { return {} }); - new yfiles.lang.ClassDefinition(() => { return {} }); - new yfiles.lang.EnumDefinition(() => { return {} }); - new yfiles.lang.StructDefinition(() => { return {} }); - } - - namespacesExist() { - let a01 = new yfiles.algorithms.AbortHandler(); - let a02 = new yfiles.binding.AdjacentNodesGraphBuilder(this.graphComponent.graph); - let a03 = new yfiles.circular.CircularLayout(); - let a04 = new yfiles.collections.List(); - let a05 = new yfiles.genealogy.FamilyTreeLayout(); - let a06 = new yfiles.geometry.Matrix(); - let a07 = new yfiles.graph.GraphClipboard(); - let a08:yfiles.graphml.ChildParseContext; - let a09 = new yfiles.hierarchic.AsIsLayerer(); - let a10 = new yfiles.input.GraphEditorInputMode(); - let a11 = new yfiles.labeling.GenericLabeling(); - let a12 = new yfiles.lang.Attribute(); - let a13 = new yfiles.layout.BendConverter(); - let a14 = new yfiles.multipage.DefaultElementFactory(); - let a15 = new yfiles.organic.OrganicLayout(); - let a16 = new yfiles.orthogonal.CompactOrthogonalLayout(); - let a17 = new yfiles.partial.PartialLayout(); - let a18 = new yfiles.radial.RadialLayout(); - let a19 = new yfiles.router.BusRouter(); - let a20 = new yfiles.seriesparallel.SeriesParallelLayout(); - let a21 = new yfiles.styles.ArcEdgeStyle(); - let a22 = new yfiles.tree.AspectRatioTreeLayout(); - let a23 = new yfiles.view.GraphComponent(); - let yfilesNamespace : yfiles_namespace; - } - - testsForVersion2001() { - var element:SVGElement; - yfiles.view.SvgVisual.setScale(element, 4, 2); - yfiles.view.SvgVisual.setTranslate(element, 4, 2); - - var args = new yfiles.lang.EventArgs(); - yfiles.input.KeyEventRecognizers.META_PRESSED(null, args); - } - - testsForVersion2012() { - //isInstance type-guard - let r : any; - let p : any; - if(yfiles.geometry.Rect.isInstance(r) && yfiles.geometry.Point.isInstance(p)) { - r.contains(p); - } - - //Typings for yfiles.lang.Object instance methods. - let r2 : yfiles.geometry.Rect = new yfiles.geometry.Rect(0,0,100,100); - let r3 : yfiles.geometry.Rect = new yfiles.geometry.Rect(0,0,100,100); - r2.equals(r3); - } -} - -class MyHitTestable extends yfiles.lang.BaseClass(yfiles.input.IHitTestable) implements yfiles.input.IHitTestable { - isHit(ctx:yfiles.input.IInputModeContext, p:yfiles.geometry.Point):boolean { - return false; - } -} - -class MyNodeStyle extends yfiles.styles.NodeStyleBase { - createVisual(renderContext:yfiles.view.IRenderContext, node:yfiles.graph.INode):yfiles.view.SvgVisual { - let g = document.createElementNS("http://www.w3.org/2000/svg", "g"); - return new yfiles.view.SvgVisual(g); - } -} - -// tests for version 2.0.1.2 - -// parameterless baseclass call. -class MyHitTestable2 extends yfiles.lang.BaseClass(yfiles.input.IHitTestable) implements yfiles.input.IHitTestable { - isHit(context: yfiles.input.IInputModeContext, location: yfiles.geometry.Point): boolean { - return null; - } -} - -// yfiles.lang.Object as baseclass. -class MyHitTestable3 extends yfiles.lang.BaseClass(yfiles.input.IHitTestable) implements yfiles.input.IHitTestable { - isHit(context: yfiles.input.IInputModeContext, location: yfiles.geometry.Point): boolean { - return null; - } -} diff --git a/types/youtube/index.d.ts b/types/youtube/index.d.ts index a636894060..b9e45aab2d 100644 --- a/types/youtube/index.d.ts +++ b/types/youtube/index.d.ts @@ -383,7 +383,7 @@ declare namespace YT /** * ID of the video to load. */ - videoId: string; + videoId?: string; /** * Player parameters. diff --git a/types/zeromq/index.d.ts b/types/zeromq/index.d.ts index 949a5f567b..189d60fc29 100644 --- a/types/zeromq/index.d.ts +++ b/types/zeromq/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for zeromq 4.5 +// Type definitions for zeromq 4.6 // Project: https://github.com/zeromq/zeromq.js -// Definitions by: Dave McKeown , Erik Mavrinac +// Definitions by: Dave McKeown +// Erik Mavrinac +// Philippe D'Alva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Forked from the DefinitelyTyped 'zmq' project originally created by Dave McKeown, @@ -149,9 +151,10 @@ export class Socket { * Each event receives the parameters: (eventValue, eventEndpointAddrress, error) * * @param timer interval in ms > 0 or Undefined for default + * @param numOfEvents The maximum number of events to read on each interval, default is 1, use 0 for reading all events * @return for chaining */ - monitor(interval?: number): Socket; + monitor(interval?: number, numOfEvents?: number): Socket; /** * Close the socket. diff --git a/types/zeromq/zeromq-tests.ts b/types/zeromq/zeromq-tests.ts index a49de9cc7d..a1230957a7 100644 --- a/types/zeromq/zeromq-tests.ts +++ b/types/zeromq/zeromq-tests.ts @@ -37,6 +37,7 @@ function test5() { }); sock.monitor(); sock.monitor(10); + sock.monitor(10, 2); } function test6() {