import * as i0 from '@angular/core'; import { EventEmitter, OnInit, OnDestroy, OnChanges, ElementRef, SimpleChange, NgZone } from '@angular/core'; import { Data, Options, NetworkEvents, IdType, FitOptions, ClusterOptions, EdgeOptions, NodeOptions, OpenClusterOptions, Position, BoundingBox, MoveToOptions } from 'vis-network'; export { Data, Edge, Node, Options } from 'vis-network'; import { DataItemCollectionType, TimelineOptions, DataGroupCollectionType, DateType, IdType as IdType$1, TimelineAnimationOptions, TimelineEventPropertiesResult } from 'vis-timeline'; export { DataGroup, DataGroupCollectionType, DataItem, DataItemCollectionType, TimelineOptions } from 'vis-timeline'; import * as i1 from '@angular/common'; export { DataSet } from 'vis-data'; /** * A service to create, manage and control Network instances. * * @export * @class NetworkService */ declare class VisNetworkService { /** * Fired when the user clicks the mouse or taps on a touchscreen device. * * @type {EventEmitter} * @memberOf NetworkService */ click: EventEmitter; /** * Fired when the user double clicks the mouse or double taps on a touchscreen device. * Since a double click is in fact 2 clicks, 2 click events are fired, followed by a double click event. * If you do not want to use the click events if a double click event is fired, * just check the time between click events before processing them. * * @type {EventEmitter} * @memberOf NetworkService */ doubleClick: EventEmitter; /** * Fired when the user click on the canvas with the right mouse button. * The right mouse button does not select by default. * You can use the method getNodeAt to select the node if you want. * * @type {EventEmitter} * @memberOf NetworkService */ oncontext: EventEmitter; /** * Fired when the user clicks and holds the mouse or taps and holds on a touchscreen device. * A click event is also fired in this case. * * @type {EventEmitter} * @memberOf NetworkService */ hold: EventEmitter; /** * Fired after drawing on the canvas has been completed. * Can be used to draw on top of the network. * * @type {EventEmitter} * @memberOf NetworkService */ release: EventEmitter; /** * Fired when the selection has changed by user action. * This means a node or edge has been selected, added to the selection or deselected. * All select events are only triggered on click and hold. * * @type {EventEmitter} * @memberOf NetworkService */ select: EventEmitter; /** * Fired when a node has been selected by the user. * * @type {EventEmitter} * @memberOf NetworkService */ selectNode: EventEmitter; /** * Fired when a edge has been selected by the user. * * @type {EventEmitter} * @memberOf NetworkService */ selectEdge: EventEmitter; /** * Fired when a node (or nodes) has (or have) been deselected by the user. * The previous selection is the list of nodes and edges that were selected before the last user event. * * @type {EventEmitter} * @memberOf NetworkService */ deselectNode: EventEmitter; /** * Fired when a edge (or edges) has (or have) been deselected by the user. * The previous selection is the list of nodes and edges that were selected before the last user event. * * @type {EventEmitter} * @memberOf NetworkService */ deselectEdge: EventEmitter; /** * Fired when starting a drag. * * @type {EventEmitter} * @memberOf NetworkService */ dragStart: EventEmitter; /** * Fired when dragging node(s) or the view. * * @type {EventEmitter} * @memberOf NetworkService */ dragging: EventEmitter; /** * Fired when the drag has finished. * * @type {EventEmitter} * @memberOf NetworkService */ dragEnd: EventEmitter; /** * Fired if the option interaction:{hover:true} is enabled and the mouse hovers over a node. * * @type {EventEmitter} * @memberOf NetworkService */ hoverNode: EventEmitter; /** * Fired if the option interaction:{hover:true} is enabled and * the mouse moved away from a node it was hovering over before. * * @type {EventEmitter} * @memberOf NetworkService */ blurNode: EventEmitter; /** * Fired if the option interaction:{hover:true} is enabled and the mouse hovers over an edge. * * @type {EventEmitter} * @memberOf NetworkService */ hoverEdge: EventEmitter; /** * Fired if the option interaction:{hover:true} is enabled and * the mouse moved away from an edge it was hovering over before. * * @type {EventEmitter} * @memberOf NetworkService */ blurEdge: EventEmitter; /** * Fired when the user zooms in or out. * * @type {EventEmitter} * @memberOf NetworkService */ zoom: EventEmitter; /** * Fired when the popup (tooltip) is shown. * * @type {EventEmitter} * @memberOf NetworkService */ showPopup: EventEmitter; /** * Fired when the popup (tooltip) is hidden. * * @type {EventEmitter} * @memberOf NetworkService */ hidePopup: EventEmitter; /** * Fired when stabilization starts. * This is also the case when you drag a node and the physics * simulation restarts to stabilize again. * Stabilization does not neccesarily imply 'without showing'. * * @type {EventEmitter} * @memberOf NetworkService */ startStabilizing: EventEmitter; /** * Fired when a multiple of the updateInterval number of iterations is reached. * This only occurs in the 'hidden' stabilization. * * @type {EventEmitter} * @memberOf NetworkService */ stabilizationProgress: EventEmitter; /** * Fired when the 'hidden' stabilization finishes. * This does not necessarily mean the network is stabilized; * it could also mean that the amount of iterations defined in the options has been reached. * * @type {EventEmitter} * @memberOf NetworkService */ stabilizationIterationsDone: EventEmitter; /** * Fired when the 'hidden' stabilization finishes. * This does not necessarily mean the network is stabilized; * it could also mean that the amount of iterations defined in the options has been reached. * * @type {EventEmitter} * @memberOf NetworkService */ stabilized: EventEmitter; /** * Fired when the size of the canvas has been resized, * either by a redraw call when the container div has changed in size, * a setSize() call with new values or a setOptions() with new width and/or height values. * * @type {EventEmitter} * @memberOf NetworkService */ resize: EventEmitter; /** * Fired before the redrawing begins. * The simulation step has completed at this point. * Can be used to move custom elements before starting drawing the new frame. * * @type {EventEmitter} * @memberOf NetworkService */ initRedraw: EventEmitter; /** * Fired after the canvas has been cleared, scaled and translated to * the viewing position but before all edges and nodes are drawn. * Can be used to draw behind the network. * * @type {EventEmitter} * @memberOf NetworkService */ beforeDrawing: EventEmitter; /** * Fired after drawing on the canvas has been completed. * Can be used to draw on top of the network. * * @type {EventEmitter} * @memberOf NetworkService */ afterDrawing: EventEmitter; /** * Fired when an animation is finished. * * @type {EventEmitter} * @memberOf NetworkService */ animationFinished: EventEmitter; /** * Fired when a user changes any option in the configurator. * The options object can be used with the setOptions method or stringified using JSON.stringify(). * You do not have to manually put the options into the network: this is done automatically. * You can use the event to store user options in the database. * * @type {EventEmitter} * @memberOf NetworkService */ configChange: EventEmitter; private networks; /** * Creates a new network instance. * * @param {string} visNetwork The network name/identifier. * @param {HTMLElement} container The HTML element that contains the network view. * @param {Data} data The initial network nodes and edges. * @param {Options} [options] The network options. * * @throws {Error} Thrown when a network with the same name already exists. * * @memberOf NetworkService */ create(visNetwork: string, container: HTMLElement, data: Data, options?: Options): void; /** * Remove the network from the DOM and remove all Hammer bindings and references. * * @param {string} visNetwork The network name/identifier. * * @memberOf NetworkService */ destroy(visNetwork: string): void; /** * Activates an event. * * @param {string} visNetwork The network name/identifier. * @param {NetworkEvents} eventName The event name. * @param {boolean} preventDefault Stops the default behavior of the event. * @returns {boolean} Returns true when the event was activated. * * @memberOf NetworkService */ on(visNetwork: string, eventName: NetworkEvents, preventDefault?: boolean): boolean; /** * Deactivates an event. * * @param {string} visNetwork The network name/identifier. * @param {NetworkEvents} eventName The event name. * * @memberOf NetworkService */ off(visNetwork: string, eventName: NetworkEvents): void; /** * Activates an event listener only once. * After it has taken place, the event listener will be removed. * * @param {string} visNetwork The network name/identifier. * @param {NetworkEvents} eventName The event name. * @returns {boolean} Returns true when the event was activated. * * @memberOf NetworkService */ once(visNetwork: string, eventName: NetworkEvents): boolean; /** * Override all the data in the network. * If stabilization is enabled in the physics module, * the network will stabilize again. * This method is also performed when first initializing the network. * * @param {string} visNetwork The network name/identifier. * @param {Data} data The network data. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ setData(visNetwork: string, data: Data): void; /** * Set the options. * * @param {string} visNetwork The network name/identifier. * @param {Options} options The network options. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ setOptions(visNetwork: string, options: Options): void; /** * Selects the nodes corresponding to the id's in the input array. * This method unselects all other objects before selecting its own objects. * Does not fire events. * * @param {string} visNetwork The network name/identifier. * @param {IdType[]} nodeIds The node ids that should be selected. * @param {boolean} [highlightEdges] If highlightEdges is true or undefined, * the neighbouring edges will also be selected. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ selectNodes(visNetwork: string, nodeIds: IdType[], highlightEdges?: boolean): void; /** * Selects the nodes and edges corresponding to the id's in the input arrays. * Does not fire events. * * @param {string} visNetwork The network name/identifier. * @param { nodes: IdType[], edges: IdType[] } selection The node and edge ids that should be selected. * @param { unselectAll?: boolean, highlightEdges?: boolean } [options] * If unselectAll is true or undefined, the other objects will be deselected. * If highlightEdges is true or undefined, the neighbouring edges will also be selected. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ setSelection(visNetwork: string, selection: { nodes: IdType[]; edges: IdType[]; }, options?: { unselectAll?: boolean; highlightEdges?: boolean; }): void; /** * Returns an object with selected nodes and edges ids. * * @param {string} visNetwork The network name/identifier. * @returns {{ nodes: IdType[], edges: IdType[] }} * The selected node and edge ids or undefined when the network does not exist. * * @memberOf NetworkService */ getSelection(visNetwork: string): { nodes: IdType[]; edges: IdType[]; }; /** * Returns an array of selected node ids. * * @param {string} visNetwork The network name/identifier. * @returns {IdType[]} The selected node ids or undefined when the network does not exist. * * @memberOf NetworkService */ getSelectedNodes(visNetwork: string): IdType[]; /** * Returns an array of selected edge ids. * * @param {string} visNetwork The network name/identifier. * @returns {IdType[]} The selected edge ids or undefined when the network does not exist. * * @memberOf NetworkService */ getSelectedEdges(visNetwork: string): IdType[]; /** * Unselect all objects. * Does not fire events. * * @param {string} visNetwork The network name/identifier. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ unselectAll(visNetwork: string): void; /** * Zooms out so all nodes fit on the canvas. * * @param {string} visNetwork The network name/identifier. * @param {VisFitOptions} [options] Options to customize. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ fit(visNetwork: string, options?: FitOptions): void; /** * Redraw the network. * * @param {string} visNetwork The network name/identifier. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ redraw(visNetwork: string): void; /** * Go into addNode mode. Having edit mode or manipulation enabled is not required. * To get out of this mode, call disableEditMode(). The callback functions defined in handlerFunctions still apply. * To use these methods without having the manipulation GUI, make sure you set enabled to false. * * @param {string} visNetwork The network name/identifier. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ addNodeMode(visNetwork: string): void; /** * Programatically enable the edit mode. * Similar effect to pressing the edit button. * * @param {string} visNetwork The network name/identifier. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ enableEditMode(visNetwork: string): void; /** * Go into addEdge mode. * The explaination from addNodeMode applies here as well. * * @param {string} visNetwork The network name/identifier. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ addEdgeMode(visNetwork: string): void; /** * Programatically disable the edit mode. * Similar effect to pressing the close icon * (small cross in the corner of the toolbar). * * @param {string} visNetwork The network name/identifier. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ disableEditMode(visNetwork: string): void; /** * Delete selected. * Having edit mode or manipulation enabled is not required. * * @param {string} visNetwork The network name/identifier. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ deleteSelected(visNetwork: string): void; /** * Makes a cluster. * * @param {string} visNetwork The network name/identifier. * @param {ClusterOptions} [options] The joinCondition function is presented with all nodes. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ cluster(visNetwork: string, options?: ClusterOptions): void; /** * This method looks at the provided node and makes a cluster of it and all it's connected nodes. * The behaviour can be customized by proving the options object. * All options of this object are explained below. * The joinCondition is only presented with the connected nodes. * * @param {string} visNetwork The network name/identifier. * @param {IdType} nodeId the id of the node * @param {ClusterOptions} [options] the cluster options * * @memberOf NetworkService */ clusterByConnection(visNetwork: string, nodeId: IdType, options?: ClusterOptions): void; /** * This method checks all nodes in the network and those with a equal or higher * amount of edges than specified with the hubsize qualify. * If a hubsize is not defined, the hubsize will be determined as the average * value plus two standard deviations. * For all qualifying nodes, clusterByConnection is performed on each of them. * The options object is described for clusterByConnection and does the same here. * * @param {string} visNetwork The network name/identifier. * @param {number} [hubsize] optional hubsize * @param {ClusterOptions} [options] optional cluster options * * @memberOf NetworkService */ clusterByHubsize(visNetwork: string, hubsize?: number, options?: ClusterOptions): void; /** * This method will cluster all nodes with 1 edge with their respective connected node. * * @param {string} visNetwork The network name/identifier. * @param {ClusterOptions} [options] optional cluster options * * @memberOf NetworkService */ clusterOutliers(visNetwork: string, options?: ClusterOptions): void; /** * Nodes can be in clusters. * Clusters can also be in clusters. * This function returns an array of nodeIds showing where the node is. * * Example: * cluster 'A' contains cluster 'B', cluster 'B' contains cluster 'C', * cluster 'C' contains node 'fred'. * * network.clustering.findNode('fred') will return ['A','B','C','fred']. * * @param {string} visNetwork The network name/identifier. * @param {IdType} nodeId the node id. * @returns {IdType[]} an array of nodeIds showing where the node is * * @memberOf NetworkService */ findNode(visNetwork: string, nodeId: IdType): IdType[]; /** * Similar to findNode in that it returns all the edge ids that were * created from the provided edge during clustering. * * @param {string} visNetwork The network name/identifier. * @param {IdType} baseEdgeId the base edge id * @returns {IdType[]} an array of edgeIds * * @memberOf NetworkService */ getClusteredEdges(visNetwork: string, baseEdgeId: IdType): IdType[]; /** * When a clusteredEdgeId is available, this method will return the original * baseEdgeId provided in data.edges ie. * After clustering the 'SelectEdge' event is fired but provides only the clustered edge. * This method can then be used to return the baseEdgeId. * * @param {string} visNetwork The network name/identifier. * @param {IdType} clusteredEdgeId * @returns {IdType} * * @memberOf NetworkService * */ getBaseEdge(visNetwork: string, clusteredEdgeId: IdType): IdType; /** * Visible edges between clustered nodes are not the same edge as the ones provided * in data.edges passed on network creation. With each layer of clustering, copies of * the edges between clusters are created and the previous edges are hidden, * until the cluster is opened. This method takes an edgeId (ie. a base edgeId from data.edges) * and applys the options to it and any edges that were created from it while clustering. * * @param {string} visNetwork The network name/identifier. * @param {IdType} startEdgeId * @param {VisEdgeOptions} [options] * * @memberOf NetworkService * */ updateEdge(visNetwork: string, startEdgeId: IdType, options?: EdgeOptions): void; /** * Clustered Nodes when created are not contained in the original data.nodes * passed on network creation. This method updates the cluster node. * * @param {string} visNetwork The network name/identifier. * @param {IdType} clusteredNodeId * @param {NodeOptions} options * * @memberOf NetworkService */ updateClusteredNode(visNetwork: string, clusteredNodeId: IdType, options?: NodeOptions): void; /** * Returns an array of all nodeIds of the nodes that * would be released if you open the cluster. * * @param {string} visNetwork The network name/identifier. * @param {IdType} clusterNodeId the id of the cluster node * @returns {IdType[]} * * @memberOf NetworkService */ getNodesInCluster(visNetwork: string, clusterNodeId: IdType): IdType[]; /** * Opens the cluster, releases the contained nodes and edges, * removing the cluster node and cluster edges. * * @param {string} visNetwork The network name/identifier. * @param {IdType} nodeId The node id that represents the cluster. * @param {OpenClusterOptions} [options] Cluster options. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ openCluster(visNetwork: string, nodeId: IdType, options?: OpenClusterOptions): void; /** * Returns true if the node whose ID has been supplied is a cluster. * * @param {string} visNetwork The network name/identifier. * @param {IdType} nodeId The associated node id. * @returns {boolean} True if the node whose ID has been supplied is a cluster. * * @memberOf NetworkService */ isCluster(visNetwork: string, nodeId: IdType): boolean; /** * If you like the layout of your network and would like it to start in the same way next time, * ask for the seed using this method and put it in the layout.randomSeed option. * * @param {string} visNetwork The network name/identifier. * @returns {number} The seed of the current network or -1 when the network is not defined. * * @memberOf NetworkService */ getSeed(visNetwork: string): number; /** * This function converts canvas coordinates to coordinates on the DOM. * Input and output are in the form of {x:Number,y:Number}. * The DOM values are relative to the network container. * * @param {string} visNetwork The network name/identifier. * @param {Position} position The canvas position. * @returns {Position} The DOM position. * * @memberOf NetworkService */ canvasToDOM(visNetwork: string, position: Position): Position; /** * This function converts DOM coordinates to coordinates on the canvas. * Input and output are in the form of {x:Number,y:Number}. * The DOM values are relative to the network container. * * @param {string} visNetwork The network name/identifier. * @param {Position} position The DOM position. * @returns {Position} The canvas position. * * @memberOf NetworkService */ DOMtoCanvas(visNetwork: string, position: Position): Position; /** * This function looks up the node at the given DOM coordinates on the canvas. * Input and output are in the form of {x:Number,y:Number}. * The DOM values are relative to the network container -> DOM not Canvas coords. * * @param {string} visNetwork The network name/identifier. * @param {Position} position The DOM position. * @returns {IdType} nodeId The associated node id. * * @memberOf NetworkService */ getNodeAt(visNetwork: string, position: Position): IdType; /** * This function looks up the edge at the given DOM coordinates on the canvas. * Input and output are in the form of {x:Number,y:Number}. * The DOM values are relative to the network container -> DOM not Canvas coords. * * @param {string} visNetwork The network name/identifier. * @param {Position} position The DOM position. * @returns {IdType} edgeId The associated edge id. * * @memberOf NetworkService */ getEdgeAt(visNetwork: string, position: Position): IdType; /** * This function looks up the edges for a given nodeId. * The DOM values are relative to the network container -> DOM not Canvas coords. * * @param {string} visNetwork The network name/identifier. * @param {IdType} nodeId The associated node id. * @returns {IdType[]} Return array of edge ids * * @memberOf NetworkService */ getConnectedEdges(visNetwork: string, nodeId: IdType): IdType[]; /** * Returns an array of nodeIds of the all the nodes that are directly connected to this node. * If you supply an edgeId, vis will first match the id to nodes. * If no match is found, it will search in the edgelist and return an array: [fromId, toId]. * * @param {string} visNetwork The network name/identifier. * @param nodeOrEdgeId a node or edge id * @returns {IdType[]} Return array of node ids */ getConnectedNodes(visNetwork: string, nodeOrEdgeId: IdType): IdType[] | { fromId: IdType; toId: IdType; }[]; /** * Returns the positions of the nodes. * @param {string} visNetwork The network name/identifier. * @param {Array.|String} [ids] --> optional, can be array of nodeIds, can be string * @returns {{}} */ getPositions(visNetwork: string, nodeIds?: IdType[]): { [nodeId: string]: Position; }; /** * Returns the positions of the nodes. * @param {string} visNetwork The network name/identifier. */ getBoundingBox(visNetwork: string, nodeId: IdType): BoundingBox; /** * Returns the positions of the nodes. * @param {string} visNetwork The network name/identifier. */ storePositions(visNetwork: string): void; /** * You can animate or move the camera using the moveTo method. * * @param {string} visNetwork The network name/identifier. * @param {MoveToOptions} options Options for moveTo function. */ moveTo(visNetwork: string, moveToOptions: MoveToOptions): void; /** * Start the physics simulation. * This is normally done whenever needed and is only really useful * if you stop the simulation yourself and wish to continue it afterwards. * @param {string} visNetwork The network name/identifier. */ startSimulation(visNetwork: string): void; /** * This stops the physics simulation and triggers a stabilized event. * Tt can be restarted by dragging a node, * altering the dataset or calling startSimulation(). * @param {string} visNetwork The network name/identifier. */ stopSimulation(visNetwork: string): void; /** * Returns the current scale of the network. 1.0 is comparible to 100%, 0 is zoomed out infinitely. * * @param {string} visNetwork The network name/identifier. * * @throws {Error} Thrown when the network does not exist. * * @memberOf NetworkService */ getScale(visNetwork: string): number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Use this directive with a div container to show network data. * * @export * @class VisNetworkDirective * @implements {OnInit} * @implements {OnDestroy} * @implements {OnChanges} */ declare class VisNetworkDirective implements OnInit, OnDestroy, OnChanges { private elementRef; private visNetworkService; /** * The name or identifier of the network (must be unique in your application). * This property is used once on init and must not be changed. * * @type {string} * @memberOf VisNetworkDirective */ visNetwork: string; /** * The data that will be used to create the network. * Changes to the nodes or edges property won't be detected but * changes to the reference of this object. * Changes lead to a call to setData of this network instance. * * @type {Data} * @memberOf VisNetworkDirective */ visNetworkData: Data; /** * The options that will be used with this network instance. * Only reference changes to the whole options object will be detected * but not changes to properties. * Changes lead to a call to setOptions of the network instance. * * @type {VisOptions} * @memberOf VisNetworkDirective */ visNetworkOptions: Options; /** * This event will be raised when the network is initialized. * At this point of time the network is successfully registered * with the VisNetworkService and you can register to events. * The event data is the name of the network as a string. * * @type {EventEmitter} * @memberOf VisNetworkDirective */ initialized: EventEmitter; private visNetworkContainer; private isInitialized; /** * Creates an instance of VisNetworkDirective. * * @param {ElementRef} elementRef The HTML element reference. * @param {VisNetworkService} visNetworkService The VisNetworkService. * * @memberOf VisNetworkDirective */ constructor(elementRef: ElementRef, visNetworkService: VisNetworkService); /** * Create the network when at least visNetwork and visData * are defined. * * @memberOf VisNetworkDirective */ ngOnInit(): void; /** * Update the network data or options on reference changes to * the visData or visOptions properties. * * @param {{[propName: string]: SimpleChange}} changes * * @memberOf VisNetworkDirective */ ngOnChanges(changes: { [propName: string]: SimpleChange; }): void; /** * Calls the destroy function for this network instance. * * @memberOf VisNetworkDirective */ ngOnDestroy(): void; private createNetwork; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * A service to create, manage and control VisTimeline instances. * * @export * @class VisTimelineService */ declare class VisTimelineService { private ngZone; /** * Fired when the current time bar redraws. * The rate depends on the zoom level. * * @type {EventEmitter} * @memberOf VisTimelineService */ currentTimeTick: EventEmitter; /** * Fired when clicked inside the Timeline. * * @type {EventEmitter} * @memberOf VisTimelineService */ click: EventEmitter; /** * Fired when right-clicked inside the Timeline. * Note that in order to prevent the context menu from showing up, * default behavior of the event must be stopped. * * @type {EventEmitter} * @memberOf VisTimelineService */ contextmenu: EventEmitter; /** * Fired when double clicked inside the Timeline. * * @type {EventEmitter} * @memberOf VisTimelineService */ doubleClick: EventEmitter; /** * Fired after the dragging of a group is finished. * * @type {EventEmitter} * @memberOf VisTimelineService */ groupDragged: EventEmitter; /** * Fired once after each graph redraw. * * @type {EventEmitter} * @memberOf VisTimelineService */ changed: EventEmitter; /** * Fired repeatedly when the timeline window is being changed. * * @type {EventEmitter} * @memberOf VisTimelineService */ rangechange: EventEmitter; /** * Fired once after the timeline window has been changed. * * @type {EventEmitter} * @memberOf VisTimelineService */ rangechanged: EventEmitter; /** * Fired after the user selects or deselects items by tapping or holding them. * When a use taps an already selected item, the select event is fired again. * Not fired when the method setSelectionis executed. * * @type {EventEmitter} * @memberOf VisTimelineService */ select: EventEmitter; /** * Fired when the user moves the mouse over an item. * * @type {EventEmitter} * @memberOf VisTimelineService */ itemover: EventEmitter; /** * Fired when the user moves the mouse out of an item. * * @type {EventEmitter} * @memberOf VisTimelineService */ itemout: EventEmitter; /** * Fired repeatedly when the user is dragging the custom time bar. * Only available when the custom time bar is enabled. * * @type {EventEmitter} * @memberOf VisTimelineService */ timechange: EventEmitter; /** * Fired once after the user has dragged the custom time bar. * Only available when the custom time bar is enabled. * * @type {EventEmitter} * @memberOf VisTimelineService */ timechanged: EventEmitter; private events; private timelines; constructor(ngZone: NgZone); /** * Creates a new timeline instance. * * @param {string} visTimeline The timeline name/identifier. * @param {HTMLElement} container The HTML element that contains the timeline view. * @param {VisTimelineItems} items The initial timeline items. * @param {VisTimelineOptions} [options] The timeline options. * * @throws {Error} Thrown when timeline already exists. * * @memberOf VisTimelineService */ createWithItems(visTimeline: string, container: HTMLElement, items: DataItemCollectionType, options?: TimelineOptions): void; /** * Creates a new timeline instance. * * @param {string} visTimeline The timeline name/identifier. * @param {HTMLElement} container The HTML element that contains the timeline view. * @param {VisTimelineItems} items The initial timeline items. * @param {VisTimelineGroups} groups The initial timeline groups. * @param {VisTimelineOptions} [options] The timeline options. * * @throws {Error} Thrown when timeline already exists. * * @memberOf VisTimelineService */ createWithItemsAndGroups(visTimeline: string, container: HTMLElement, items: DataItemCollectionType, groups: DataGroupCollectionType, options?: TimelineOptions): void; /** * Add new vertical bar representing a custom time that can be dragged by the user. * The id is added as CSS class name of the custom time bar, * allowing to style multiple time bars differently. * * @param {string} visTimeline The timeline name/identifier. * @param {DateType} time Parameter time can be a Date, Number, or String, and is new Date() by default. * @param {IdType} [id] Parameter id can be Number or String and is undefined by default. * @returns {IdType} The method returns id of the created bar. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ addCustomTime(visTimeline: string, time: DateType, id?: IdType$1): IdType$1; /** * Adjust the visible window such that it fits all items. * See also function focus(id). * * @param {string} visTimeline The timeline name/identifier. * @param {TimelineAnimationOptions} [options] Optional options. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ fit(visTimeline: string, options?: TimelineAnimationOptions): void; /** * Adjust the visible window such that the selected item is centered on screen. * * @param {string} visTimeline The timeline name/identifier. * @param {IdType} id The id of the item. * @param {TimelineAnimationOptions} [options] Options options. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ focusOnId(visTimeline: string, id: IdType$1, options?: TimelineAnimationOptions): void; /** * Adjust the visible window such that the selected items are centered on screen. * * @param {string} visTimeline The timeline name/identifier. * @param {IdType[]} ids The item ids. * @param {TimelineAnimationOptions} [options] Optional options. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ focusOnIds(visTimeline: string, ids: IdType$1[], options?: TimelineAnimationOptions): void; /** * Get the current time. * Only applicable when option showCurrentTime is true. * * @param {string} visTimeline The timeline name/identifier. * @returns {Date} The current time. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ getCurrentTime(visTimeline: string): Date; /** * Retrieve the custom time from the custom time bar with given id. * Id is undefined by default. * * @param {string} visTimeline The timeline name/identifier. * @param {IdType} [id] The time bar id. * @returns {Date} The custom time. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ getCustomTime(visTimeline: string, id?: IdType$1): Date; /** * Returns an Object with relevant properties from an event. * * @param {string} visTimeline The timeline name/identifier. * @param {Event} event The event. * @returns {VisTimelineEventPropertiesResult} Properties of an event * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ getEventProperties(visTimeline: string, event: Event): TimelineEventPropertiesResult; /** * Get the range of all the items as an object containing min: Date and max: Date. * * @param {string} visTimeline The timeline name/identifier. * @returns {{ min: Date, max: Date }} The min and max dates. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ getItemRange(visTimeline: string): { min: Date; max: Date; }; /** * Get an array with the ids of the currently selected items. * * @param {string} visTimeline The timeline name/identifier. * @returns {IdType[]} The currently selected items. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ getSelection(visTimeline: string): IdType$1[]; /** * Get an array with the ids of the currently visible items. * * @param {string} visTimeline The timeline name/identifier. * @returns {IdType[]} The currently visible items. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ getVisibleItems(visTimeline: string): IdType$1[]; /** * Get the current visible window. * * @param {string} visTimeline The timeline name/identifier. * @returns {{ start: Date, end: Date }} Returns an object with properties start: Date and end: Date. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ getWindow(visTimeline: string): { start: Date; end: Date; }; /** * Move the window such that given time is centered on screen. * * @param {string} visTimeline The timeline name/identifier. * @param {DateType} time Parameter time can be a Date, Number, or String. * @param {TimelineAnimationOptions} [options] Optional options. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ moveTo(visTimeline: string, time: DateType, options?: TimelineAnimationOptions): void; /** * Force a redraw of the Timeline. * The size of all items will be recalculated. * Can be useful to manually redraw when option autoResize=false and the window has been resized, * or when the items CSS has been changed. * * @param {string} visTimeline The timeline name/identifier. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ redraw(visTimeline: string): void; /** * Remove vertical bars previously added to the timeline via addCustomTime method. * * @param {string} visTimeline The timeline name/identifier. * @param {IdType} id Parameter id is the ID of the custom vertical bar returned by addCustomTime method. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ removeCustomTime(visTimeline: string, id: IdType$1): void; /** * Set a current time. * This can be used for example to ensure that a client's time is synchronized * with a shared server time. * Only applicable when option showCurrentTime is true. * * @param {string} visTimeline The timeline name/identifier. * @param {DateType} time time can be a Date object, numeric timestamp, or ISO date string. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setCurrentTime(visTimeline: string, time: DateType): void; /** * Adjust the time of a custom time bar. * * @param {string} visTimeline The timeline name/identifier. * @param {DateType} time Parameter time can be a Date object, numeric timestamp, or ISO date string. * @param {IdType} [id] Parameter id is the id of the custom time bar, and is undefined by default. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setCustomTime(visTimeline: string, time: DateType, id?: IdType$1): void; /** * Adjust the title attribute of a custom time bar. * * @param {string} visTimeline The timeline name/identifier. * @param {string} title Parameter title is the string to be set as title. * Use empty string to hide the title completely. * @param {IdType} [id] Parameter id is the id of the custom time bar, and is undefined by default. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setCustomTimeTitle(visTimeline: string, title: string, id?: IdType$1): void; /** * Set both groups and items at once. * Both properties are optional. * This is a convenience method for individually calling both setItems(items) and setGroups(groups). * Both items and groups can be an Array with Objects, a DataSet (offering 2 way data binding), * or a DataView (offering 1 way data binding). * For each of the groups, the items of the timeline are filtered on the property group, * which must correspond with the id of the group. * * @param {string} visTimeline The timeline name/identifier. * @param {{ groups?: VisTimelineGroups; items?: VisTimelineItems }} data The new timline data. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setData(visTimeline: string, data: { groups?: DataGroupCollectionType; items?: DataItemCollectionType; }): void; /** * Set a data set with groups for the Timeline. * For each of the groups, the items of the timeline are filtered on the property group, * which must correspond with the id of the group. * * @param {string} visTimeline The timeline name/identifier. * @param {VisTimelineGroups} groups a DataSet (offering 2 way data binding) * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setGroups(visTimeline: string, groups: DataGroupCollectionType): void; /** * Set a data set with items for the Timeline. * * @param {string} visTimeline The timeline name/identifier. * @param {VisTimelineItems} items can be an Array with Objects, a DataSet (offering 2 way data binding) * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setItems(visTimeline: string, items: DataItemCollectionType): void; /** * Set or update options. * It is possible to change any option of the timeline at any time. * You can for example switch orientation on the fly. * * @param {string} visTimeline The timeline name/identifier. * @param {VisTimelineOptions} options The new options of the timeline. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setOptions(visTimeline: string, options: TimelineOptions): void; /** * Select one item by its id.# * The currently selected items will be unselected. * * @param {string} visTimeline The timeline name/identifier. * @param {IdType} id The id of the item that should be selected. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setSelectionToId(visTimeline: string, id: IdType$1): void; /** * Select multiple items by their id. * The currently selected items will be unselected. * To unselect all selected items, call `setSelection([])`. * * @param {string} visTimeline The timeline name/identifier. * @param {IdType[]} ids The ids of the irems that should be selected. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setSelectionToIds(visTimeline: string, ids: IdType$1[]): void; /** * Set the current visible window. * * If the parameter value of start or end is null, the parameter will be left unchanged. * * @param {string} visTimeline The timeline name/identifier. * @param {DateType} start The parameters start can be a Date, Number, or String. * @param {DateType} end The parameters end can be a Date, Number, or String. * @param {TimelineAnimationOptions} [options] Optional options. * * @throws {Error} Thrown when timeline does not exist. * * @memberOf VisTimelineService */ setWindow(visTimeline: string, start: DateType, end: DateType, options?: TimelineAnimationOptions): void; /** * Destroy the Timeline. * The timeline is removed from memory. * All DOM elements and event listeners are cleaned up. * * @param {string} visTimeline The timeline name/identifier. * * @memberOf VisTimelineService */ destroy(visTimeline: string): void; /** * Activates an event. * * @param {string} visTimeline The timeline name/identifier. * @param {string} eventName The event name. * @param {boolean} preventDefault Stops the default behavior of the event. * @returns {boolean} Returns true when the event was activated. * * @memberOf VisTimelineService */ on(visTimeline: string, eventName: string, preventDefault?: boolean): boolean; /** * Deactivates an event. * * @param {string} visTimeline The timeline name/identifier. * @param {string} eventName The event name. * * @memberOf VisTimelineService */ off(visTimeline: string, eventName: string): void; /** * Get the event emitter associated with the specified event name. * @param {string} eventName The event name. * @returns {EventEmitter} The event emitter of the specified event name. */ getEmitter(eventName: string): EventEmitter; private doesNotExistError; private alreadyExistsError; private wrapCallbacksWithNgZone; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Use this directive with a div container to show timeline data. * * @export * @class VisTimelineDirective * @implements {OnInit} * @implements {OnDestroy} * @implements {OnChanges} */ declare class VisTimelineDirective implements OnInit, OnDestroy, OnChanges { private elementRef; private visTimelineService; /** * The name or identifier of the timeline (must be unique in your application). * This property is used once on init and must not be changed. * * @type {string} * @memberOf VisTimelineDirective */ visTimeline: string; /** * The data that will be used to create the timeline. * Changes will be detected. If the reference changes then * setData will be called on this timeline instance. * * @type {VisTimelineItems} * @memberOf VisTimelineDirective */ visTimelineItems: DataItemCollectionType; /** * The groups that will be used to create the timeline. * Changes will be detected. If the reference changes then * setGroups will be called on this timeline instance. * * @type {VisTimelineGroups} * @memberOf VisTimelineDirective */ visTimelineGroups: DataGroupCollectionType; /** * The options that will be used with this timeline. * Changes will be detected. If the reference changes then * setOptions will be called on this timeline instance. * * @type {VisTimelineOptions} * @memberOf VisTimelineDirective */ visTimelineOptions: TimelineOptions; /** * This event will be raised when the timline is initialized. * At this point of time the timeline is successfully registered * with the VisNetworkService and you can register to events. * The event data is the name of the timeline as a string. * * @type {EventEmitter} * @memberOf VisTimelineDirective */ initialized: EventEmitter; private visTimelineContainer; private isInitialized; /** * Creates an instance of VisTimelineDirective. * * @param {ElementRef} elementRef The HTML element reference. * @param {VisTimelineService} visTimelineService The VisTimelineService. * * @memberOf VisTimelineDirective */ constructor(elementRef: ElementRef, visTimelineService: VisTimelineService); /** * Create the timeline when at least visNetwork and visNetworkData * are defined. * * @memberOf VisTimelineDirective */ ngOnInit(): void; /** * Update the timeline data, groups or options on reference changes to * the visTimelineItems, visTimelineGroups or visTimelineOptions properties. * * @param {{[propName: string]: SimpleChange}} changes * * @memberOf VisTimelineDirective */ ngOnChanges(changes: { [propName: string]: SimpleChange; }): void; /** * Calls the destroy function for this timeline instance. * * * @memberOf VisTimelineDirective */ ngOnDestroy(): void; private createTimeline; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class VisModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { VisModule, VisNetworkDirective, VisNetworkService, VisTimelineDirective, VisTimelineService };