# Ogma {#ogma} ## `ogma.constructor([parameters])` {#ogma-constructor} **Arguments** * parameters(optional) object * container(optional) string|HTMLElement HTML element to use as a container. If a string is specified, the element will be lookup with `document.getElementById()`. * dimensions(optional) [Size](/api/types/size)[={ width: 300, height: 300 }] Dimensions of the canvas. If unspecified, the container's dimensions will be used. * graph(optional) [RawGraph](/api/types/rawgraph) Graph to initialize Ogma with * imgCrossOrigin(optional) [CrossOriginValue](/api/types/crossoriginvalue)[="anonymous"] Indicates the value of the `crossOrigin` field for DOM images. This is an alias for `ogma.setOptions({imgCrossOrigin: value})` * options(optional) [Options](/api/types/options) Settings for all the modules. * renderer(optional) "webgl"|"canvas"|"svg"|null[="webgl"] Rendering type. If WebGL is selected and not available, Ogma fallback on Canvas. If no renderer is available (e.g in Node.js), Ogma will fallback on headless mode (`null`). This field is an alias for `ogma.setOptions({renderer: value})` ## `ogma.addEdge(edge[, options])` {#ogma-addedge} Add the specified edge to the graph **Arguments** * edge [RawEdge](/api/types/rawedge) Edge to add. * options(optional) AddItemOptions * ignoreInvalid(optional) boolean[=false] If true, the method quietly skip the edges whose extremities are not in the visualisation. **Returns** * [Edge](/api/edge) Edge that has just been added. ## `ogma.addEdges(edges[, options])` {#ogma-addedges} Add the specified edges to the graph **Arguments** * edges Array\<[RawEdge](/api/types/rawedge)\> * options(optional) object * batchSize(optional) number If specified, the graph will be imported progressively (`batchSize` nodes/edges at a time). It will effectively increase the total loading time, but the construction of the graph will be shown and the thread will not be frozen. * ignoreInvalid(optional) boolean[=false] If true, the method quietly skip the edges whose extremities are not in the visualisation. **Returns** * Promise\<[EdgeList](/api/edgelist)\> Edges added to the graph. ## `ogma.addGraph(graph[, options])` {#ogma-addgraph} Add the specified nodes and edges to the graph. If your visualisation is empty, it will also automatically center the view on the graph. **Arguments** * graph [RawGraph](/api/types/rawgraph) * options(optional) object * batchSize(optional) number If specified, the graph will be imported progressively (`batchSize` nodes/edges at a time). It will effectively increase the total loading time, but the construction of the graph will be shown and the thread will not be frozen. * ignoreInvalid(optional) boolean[=false] If true, the method quietly skip the edges whose extremities are not in the visualisation. **Returns** * Promise\<{nodes: [NodeList](/api/nodelist), edges: [EdgeList](/api/edgelist)}\> ## `ogma.addNode(node[, options])` {#ogma-addnode} Add the specified node to the graph **Arguments** * node [RawNode](/api/types/rawnode) Node to add. * options(optional) AddItemOptions Unused for now. **Returns** * [Node](/api/node) Node that has just been added. ## `ogma.addNodes(nodes[, options])` {#ogma-addnodes} Add the specified nodes to the graph. Ignores nodes that have the same id as a node in the graph. **Arguments** * nodes Array\<[RawNode](/api/types/rawnode)\> * options(optional) object * batchSize(optional) number If specified, the graph will be imported progressively (`batchSize` nodes/edges at a time). It will effectively increase the total loading time, but the construction of the graph will be shown and the thread will not be frozen. **Returns** * Promise\<[NodeList](/api/nodelist)\> Nodes added to the graph. ## `ogma.clearGraph()` {#ogma-cleargraph} Removes all the nodes and edges from the graph. **Returns** * void ## `ogma.clearSelection()` {#ogma-clearselection} Clear the selection. ## `ogma.createEdgeList()` {#ogma-createedgelist} Returns a new empty EdgeList. **Returns** * [EdgeList](/api/edgelist) ## `ogma.createNodeList()` {#ogma-createnodelist} Returns a new empty NodeList. **Returns** * [NodeList](/api/nodelist) ## `ogma.destroy()` {#ogma-destroy} Release the memory used and removes all connections between Ogma and the DOM. After this method is called, Ogma's container will not contain any DOM element created by Ogma. Global DOM elements such as `window` and `document`'s event listeners added by Ogma will be removed. All `setTimeout` created by Ogma will be cleared. **Returns** * void ## `ogma.getConnectedComponentByNode(node[, options])` {#ogma-getconnectedcomponentbynode} **Arguments** * node [Node](/api/node)|[NodeId](/api/types/nodeid) * options(optional) object * filter(optional) object[='visible'] * returnIds(optional) boolean[=false] Return node ids instead of Nodes **Returns** * [NodeList](/api/nodelist) ## `ogma.getConnectedComponents([options])` {#ogma-getconnectedcomponents} Returns weakly connected components of the graph. **Arguments** * options(optional) object * filter(optional) object[='visible'] * returnIds(optional) boolean[=false] Return node ids instead of Nodes **Returns** * Array\<[NodeList](/api/nodelist)\> ## `ogma.getContainer()` {#ogma-getcontainer} Returns the DOM element used by this Ogma instance. **Returns** * HTMLElement|null ## `ogma.getEdge(edgeId)` {#ogma-getedge} Return the specified edge, or `undefined` if it doesn't exist. **Arguments** * edgeId [EdgeId](/api/types/edgeid) **Returns** * [Edge](/api/edge)|undefined ## `ogma.getEdgeFilters()` {#ogma-getedgefilters} Retrieve all edge filters. Same as ```js const edgeFilters = ogma.transformations.getEdgeFilters(); ``` **Returns** * Array\<[Transformation](/api/transformation)\> ## `ogma.getEdges([selector])` {#ogma-getedges} Return the specified edges. **Arguments** * selector(optional) Array\<[EdgeId](/api/types/edgeid)\>|[Filter](/api/types/filter)|Array\<[Edge](/api/edge)\>[="visible"] If it's an array of ids, returns the edges that match the specified ids. If it's "visible", return all the visible edges. If it's "raw", returns all edges except the ones that are the result of a transformation (e.g. grouping). If it's "all", returns all the edges. **Returns** * [EdgeList](/api/edgelist) ## `ogma.getEdgesByClassName(className[, filter])` {#ogma-getedgesbyclassname} Returns the edges that have the specified class. Same effect as [`StyleClass.update`](#StyleClass-getEdges). **Arguments** * className string * filter(optional) [Filter](/api/types/filter) Filter to apply to edges **Returns** * [EdgeList](/api/edgelist) ## `ogma.getHoveredElement()` {#ogma-gethoveredelement} Returns the element that is currently hovered. **Returns** * [Node](/api/node)|[Edge](/api/edge)|null ## `ogma.getNode(nodeId)` {#ogma-getnode} Return the specified node, or `undefined` if it doesn't exist. **Arguments** * nodeId [NodeId](/api/types/nodeid) **Returns** * [Node](/api/node)|undefined ## `ogma.getNodeFilters()` {#ogma-getnodefilters} Retrieve all node filters. Same as ```js const nodeFilters = ogma.transformations.getNodeFilters(); ``` **Returns** * Array\<[Transformation](/api/transformation)\> ## `ogma.getNodes([selector])` {#ogma-getnodes} Return the specified nodes. **Arguments** * selector(optional) Array\<[NodeId](/api/types/nodeid)\>|[Filter](/api/types/filter)|Array\<[Node](/api/node)\>[="visible"] If it's an array of ids, returns the nodes that match the specified ids. If it's "visible", return all the visible nodes. If it's "raw", returns all nodes except the ones that are the result of a transformation (e.g. grouping). If it's "all", returns all the nodes. **Returns** * [NodeList](/api/nodelist) ## `ogma.getNodesByClassName(className[, filter])` {#ogma-getnodesbyclassname} Returns the nodes that have the specified class. Same effect as [`StyleClass.update`](#StyleClass-getNodes). **Arguments** * className string * filter(optional) [Filter](/api/types/filter) Filter to apply to nodes **Returns** * [NodeList](/api/nodelist) ## `ogma.getNonSelectedEdges()` {#ogma-getnonselectededges} Returns all edges that are not selected. **Returns** * [EdgeList](/api/edgelist) ## `ogma.getNonSelectedNodes()` {#ogma-getnonselectednodes} Returns all nodes that are not selected. **Returns** * [NodeList](/api/nodelist) ## `ogma.getOptions()` {#ogma-getoptions} Get options of the Ogma instance. **Returns** * [Options](/api/types/options) ## `ogma.getPointerInformation()` {#ogma-getpointerinformation} Returns information on the cursor. **Returns** * {x: number, y: number, target: [Node](/api/node)|[Edge](/api/edge)|null} ## `ogma.getSelectedEdges()` {#ogma-getselectededges} Returns all edges that are selected. **Returns** * [EdgeList](/api/edgelist) ## `ogma.getSelectedNodes()` {#ogma-getselectednodes} Returns all nodes that are selected. **Returns** * [NodeList](/api/nodelist) ## `ogma.isDestroyed()` {#ogma-isdestroyed} **Returns** * boolean ## `ogma.reloadFonts()` {#ogma-reloadfonts} Indicates that the DOM has finished loading fonts. If you use an external font (like FontAwesome) and the font is not displayed correctly on your nodes and edges (e.g squares instead of the actual characters), call this method once you know the font has been loaded. ## `ogma.removeEdge(edge)` {#ogma-removeedge} Remove the specified edge from the graph. **Arguments** * edge [Edge](/api/edge)|[EdgeId](/api/types/edgeid) ## `ogma.removeEdges(edges)` {#ogma-removeedges} Remove the specified edges from the graph **Arguments** * edges [EdgeList](/api/edgelist)|Array\<[Edge](/api/edge)|[EdgeId](/api/types/edgeid)\> **Returns** * Promise\ ## `ogma.removeNode(node)` {#ogma-removenode} Remove the specified node from the graph. **Arguments** * node [Node](/api/node)|[NodeId](/api/types/nodeid) ## `ogma.removeNodes(nodes)` {#ogma-removenodes} Remove the specified nodes from the graph **Arguments** * nodes [NodeList](/api/nodelist)|Array\<[Node](/api/node)|[NodeId](/api/types/nodeid)\> **Returns** * Promise\ ## `ogma.reset()` {#ogma-reset} Reset Ogma to its initial state. Doing `ogma.reset();` has the same effect as `ogma.destroy(); ogma = new Ogma(params);`, with `params` being the parameters used the first time Ogma was instantiated. **Returns** * void ## `ogma.setContainer(elt)` {#ogma-setcontainer} Set the DOM element used by this Ogma instance. If a string is specified, the element will be looked up with `document.getElementById()`. If the argument is `null`, then Ogma is removed from the current container. **Arguments** * elt HTMLElement|string|null ## `ogma.setGraph(graph[, options])` {#ogma-setgraph} Clear the graph, then add the specified nodes and edges to the graph. **Arguments** * graph [RawGraph](/api/types/rawgraph) * options(optional) object * batchSize(optional) number If specified, the graph will be imported progressively (`batchSize` nodes/edges at a time). It will effectively increase the total loading time, but the construction of the graph will be shown and the thread will not be frozen. * ignoreInvalid(optional) boolean[=false] If true, the method quietly skip the edges whose extremities are not in the visualisation. **Returns** * Promise\<{nodes: [NodeList](/api/nodelist), edges: [EdgeList](/api/edgelist)}\> ## `ogma.setOptions(options)` {#ogma-setoptions} Update the options of Ogma. **Arguments** * options [Options](/api/types/options) * [Ogma.algorithms]() * [Ogma.events]() * [Ogma.export]() * [Ogma.generate]() * [Ogma.geo]() * [Ogma.keyboard]() * [Ogma.layers]() * [Ogma.layouts]() * [Ogma.parse]() * [Ogma.rules]() * [Ogma.schema]() * [Ogma.styles]() * [Ogma.tools]() * [Ogma.transformations]() * [Ogma.view]() * [Ogma.geometry]() # Edge {#edge} Ogma edge entity class. Use this class to manipulate edges, change data, attributes, etc. * ## `edge.isNode` {#edge-isnode} Read-only property that is always `false`. ## `edge.addClass(className[, options])` {#edge-addclass} Add the specified class to the edge. **Arguments** * className string * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Edge](/api/edge)\> ## `edge.addClasses(classNames[, options])` {#edge-addclasses} Add the specified classes to the edge. **Arguments** * classNames Array\ * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Edge](/api/edge)\> ## `edge.getAdjacentElements()` {#edge-getadjacentelements} Retrieves the list of edges parallel to the edge, excluding the source edge plus the extremities of the edge. **Returns** * [SubGraph](/api/types/subgraph) ## `edge.getAttribute(attributeName)` {#edge-getattribute} Returns the value of the specified attribute for the edge. **Arguments** * attributeName [PropertyPath](/api/types/propertypath) Attribute to retrieve. **Returns** * any ## `edge.getAttributes([attributeNames])` {#edge-getattributes} Returns an object containing the specified attributes for the edge. **Arguments** * attributeNames(optional) Array\<[PropertyPath](/api/types/propertypath)\> List of attributes to include in the object. If not specified, includes all the edge attributes. **Returns** * [EdgeAttributes](/api/types/edgeattributes) ## `edge.getBoundingBox([options])` {#edge-getboundingbox} Returns the bounding box of the edge, in graph coordinates. **Arguments** * options(optional) object * ignoreCurvature(optional) boolean[=false] Use it if you want to only take into account the edge sources and targets. * includeTexts(optional) boolean[=false] Wether or not take texts in account in the bouding box **Returns** * [BoundingBox](/api/types/boundingbox) ## `edge.getClassList()` {#edge-getclasslist} Returns the list of classes that the edge has. **Returns** * Array\ ## `edge.getData([property])` {#edge-getdata} Retrieve the specified data property of the edge. If no property is specified, retrieve the whole data object. This method method returns the internal data object; modifying it could cause unexpected behavior. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath) **Returns** * any ## `edge.getExtremities()` {#edge-getextremities} Returns a `NodeList` containing the source and the target of the edge. **Returns** * [NodeList](/api/nodelist) ## `edge.getId()` {#edge-getid} Returns the id of the edge. **Returns** * [EdgeId](/api/types/edgeid) ## `edge.getMetaEdge()` {#edge-getmetaedge} If the edge is grouped inside a meta-edge, returns this meta-edge. Otherwise, returns null. **Returns** * [Edge](/api/edge)|null ## `edge.getParallelEdges([options])` {#edge-getparalleledges} Retrieves the list of edges parallel to the edge, including the source edge itself. **Arguments** * options(optional) object * filter(optional) [Filter](/api/types/filter)[="visible"] Indicates which edges to take into account **Returns** * [EdgeList](/api/edgelist) ## `edge.getSource()` {#edge-getsource} Returns the source node of the edge **Returns** * [Node](/api/node) ## `edge.getSubEdges()` {#edge-getsubedges} If the edge is a meta-edge (result of a grouping), returns the list of edges that are part of the group it represents. If it's not a meta-edge, returns `null`. **Returns** * [EdgeList](/api/edgelist)|null ## `edge.getTarget()` {#edge-gettarget} Returns the target node of the edge **Returns** * [Node](/api/node) ## `edge.getTransformation()` {#edge-gettransformation} Returns the transformation that created the edge, if it is virtual. Otherwise returns `null`. **Returns** * [Transformation](/api/transformation)|null ## `edge.hasClass(className)` {#edge-hasclass} Indicates if the edge has the specified class. **Arguments** * className string **Returns** * boolean ## `edge.isInView([options])` {#edge-isinview} Indicates if the edge is visible in the current view. **Arguments** * options(optional) object * margin(optional) number[=0] Tolerance in pixels. **Returns** * boolean ## `edge.isSelected()` {#edge-isselected} Indicates if the edge is currently selected. **Returns** * boolean ## `edge.isVirtual()` {#edge-isvirtual} Indicates if the edge was created by a transformation (`true`) or not (`false`). **Returns** * boolean ## `edge.isVisible()` {#edge-isvisible} Indicates if the edge is visible. A edge is not visible if it has been filtered out, or if it is used in a transformation. /!\ A edge with an opacity of 0 is considered visible! **Returns** * boolean ## `edge.locate([options])` {#edge-locate} Centers the view on the edge. **Arguments** * options(optional) [LocateOptions](/api/types/locateoptions) **Returns** * Promise\ ## `edge.pulse([options])` {#edge-pulse} Highlights the edge. It's a shorthand for the case when you want the elements pulse for `number * (interval - 1) + duration` milliseconds. It will also update the pulse attributes of the items with the one provided in the `.pulse()` call. **Arguments** * options(optional) object * duration(optional) number[=1000] Duration of a pulse (milliseconds) * endColor(optional) [Color](/api/types/color)|"inherit"[="rgb(0,0,0,0.0)"] Ending color of the pulse * endRatio(optional) number[=2] Where the pulse ends, relative to the edge siz (1 = at the edge's border) * interval(optional) number[=800] Interval between two pulses (milliseconds) * number(optional) number[=1] Number of pulses * startColor(optional) [Color](/api/types/color)|"inherit"[="rgb(0,0,0,0.6)"] Starting color of the pulse * startRatio(optional) number[=1] Where the pulse starts, relative to the edge siz (1 = at the edge's border) * width(optional) number[=10] Width of the pulse in pixels **Returns** * Promise\<[Edge](/api/edge)\> ## `edge.removeClass(className[, options])` {#edge-removeclass} Remove the specified class from the edge. **Arguments** * className string * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Edge](/api/edge)\> ## `edge.removeClasses(classNames[, options])` {#edge-removeclasses} Remove the specified class from the edge. **Arguments** * classNames Array\ * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Edge](/api/edge)\> ## `edge.resetAttributes([attributeNames][, options])` {#edge-resetattributes} Remove all attributes that have been applied through `setAttributes`. Original attributes or attributes applied by the rules are not affected. **Arguments** * attributeNames(optional) Array\<[PropertyPath](/api/types/propertypath)\> List of attributes to clear. If no attribute is specified, clear all of them. * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Edge](/api/edge)\> ## `edge.setAttribute(attribute, value[, options])` {#edge-setattribute} Set the specified attribute of the edge. **Arguments** * attribute [PropertyPath](/api/types/propertypath) * value any * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Edge](/api/edge)\> ## `edge.setAttributes(attributes[, options])` {#edge-setattributes} Set the individual attributes of the edge. **Arguments** * attributes [EdgeAttributesValue](/api/types/edgeattributesvalue) Attributes to update * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Edge](/api/edge)\> ## `edge.setData([property], value)` {#edge-setdata} Set the specified data property of the edge. If no property is specified, update the whole data object. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath) * value any|function(edge: [Edge](/api/edge)): any **Returns** * [Edge](/api/edge) ## `edge.setSelected(active)` {#edge-setselected} Add or remove the edge to/from the selection. **Arguments** * active boolean Whether to select or unselect the edge. ## `edge.setSource(source)` {#edge-setsource} Set the source node of the edge. **Arguments** * source [Node](/api/node)|[NodeId](/api/types/nodeid) ## `edge.setTarget(target)` {#edge-settarget} Set the target node of the edge. **Arguments** * target [Node](/api/node)|[NodeId](/api/types/nodeid) ## `edge.setVisible(value)` {#edge-setvisible} Hide or show the edge. **Arguments** * value boolean Whether to show or hide the edge. ## `edge.toJSON([options])` {#edge-tojson} Returns an object containing the id, source id, target id, attributes and data of the edge. **Arguments** * options(optional) object * attributes(optional) Array\<[PropertyPath](/api/types/propertypath)\>|"all"[=[]] List of attributes to retrieve. By default, retrieve all attributes. * data(optional) function (data: any): any Function that takes the edge's data in input and return the data to retrieve. By default return the whole object. **Returns** * [RawEdge](/api/types/rawedge) ## `edge.toList()` {#edge-tolist} Returns a new EdgeList that contains only the edge. **Returns** * [EdgeList](/api/edgelist) # EdgeList {#edgelist} Ogma edge list class. Use this class to manipulate a list of edges, change data, attributes, etc. * ## `edgeList.isNode` {#edgelist-isnode} Read-only property that is always `false`. * ## `edgeList.size` {#edgelist-size} Read-only property that indicates the number of edges in the list. ## `edgeList.addClass(className[, options])` {#edgelist-addclass} Add the specified class to the edges. **Arguments** * className string * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[EdgeList](/api/edgelist)\> ## `edgeList.addClasses(classNames[, options])` {#edgelist-addclasses} Add the specified classes to the edges. **Arguments** * classNames Array\ * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[EdgeList](/api/edgelist)\> ## `edgeList.concat(edges)` {#edgelist-concat} **Arguments** * edges [EdgeList](/api/edgelist) **Returns** * [EdgeList](/api/edgelist) ## `edgeList.dedupe()` {#edgelist-dedupe} Returns a new EdgeList which does not contain any duplicate edge. **Returns** * [EdgeList](/api/edgelist) ## `edgeList.every(callback)` {#edgelist-every} **Arguments** * callback function(edge: [Edge](/api/edge), index: number, list: [EdgeList](/api/edgelist)): boolean **Returns** * boolean ## `edgeList.fillData([property], value)` {#edgelist-filldata} Set the specified data property of the edges with the same value. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath)|any Path of the data property to update. If no property is specified, update the whole data object. * value any Value that will be assigned to all the edges. **Returns** * [EdgeList](/api/edgelist) ## `edgeList.filter(callback)` {#edgelist-filter} **Arguments** * callback function(edge: [Edge](/api/edge), index: number, list: [EdgeList](/api/edgelist)): boolean **Returns** * [EdgeList](/api/edgelist) ## `edgeList.find(callback)` {#edgelist-find} **Arguments** * callback function(edge: [Edge](/api/edge), index: number, list: [EdgeList](/api/edgelist)): boolean **Returns** * [Edge](/api/edge) ## `edgeList.forEach(callback)` {#edgelist-foreach} **Arguments** * callback function(edge: [Edge](/api/edge), index: number, list: [EdgeList](/api/edgelist)) ## `edgeList.get(index)` {#edgelist-get} Returns the edge at the specified index. **Arguments** * index number **Returns** * [Edge](/api/edge) ## `edgeList.getAdjacentElements()` {#edgelist-getadjacentelements} Retrieves the list of edges parallel to the edges, excluding the source edges themselves plus the extremities of the edges. **Returns** * [EdgeList](/api/edgelist) ## `edgeList.getAttribute(attributeName)` {#edgelist-getattribute} Returns an array containing the value of the specified attribute for each edge. **Arguments** * attributeName [PropertyPath](/api/types/propertypath) Attribute to retrieve. **Returns** * any[] ## `edgeList.getAttributes([attributes])` {#edgelist-getattributes} Returns an array of objects containing the specified attributes for each edge. **Arguments** * attributes(optional) [PropertyPath](/api/types/propertypath)[] List of attributes to include in the object. If not specified, includes all the edge attributes. **Returns** * [EdgeAttributes](/api/types/edgeattributes)[] ## `edgeList.getBoundingBox([options])` {#edgelist-getboundingbox} Returns the bounding box of the edges, in graph coordinates. **Arguments** * options(optional) object * ignoreCurvature(optional) boolean[=false] Use it if you want to only take into account the edge sources and targets. * includeTexts(optional) boolean[=false] Wether or not take texts in account in the bouding box **Returns** * [BoundingBox](/api/types/boundingbox) ## `edgeList.getClassList()` {#edgelist-getclasslist} Returns the list of classes that each edge has. **Returns** * Array\\> ## `edgeList.getData([property])` {#edgelist-getdata} Retrieve the specified data property. If no property is specified, retrieve the whole data object. This method method returns the internal data object; modifying it could cause unexpected behavior. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath) **Returns** * Array\ ## `edgeList.getExtremities()` {#edgelist-getextremities} Returns a `NodeList` containing the sources and targets of the edges. Duplicate nodes are not removed. **Returns** * [NodeList](/api/nodelist) ## `edgeList.getId()` {#edgelist-getid} Returns the id of each edge. **Returns** * Array\<[EdgeId](/api/types/edgeid)\> ## `edgeList.getMetaEdge()` {#edgelist-getmetaedge} Run `getMetaEdge` on each edge in the list and returns the array of results. **Returns** * Array\<[Edge](/api/edge)|null\> ## `edgeList.getParallelEdges([options])` {#edgelist-getparalleledges} Retrieves the list of edges parallel to the edges, including the source edges themselves. **Arguments** * options(optional) object * filter(optional) [Filter](/api/types/filter)[="visible"] Indicates which edges to take into account **Returns** * [EdgeList](/api/edgelist) ## `edgeList.getSource()` {#edgelist-getsource} Returns the list of source nodes of the edges **Returns** * [NodeList](/api/nodelist) ## `edgeList.getSubEdges()` {#edgelist-getsubedges} Run `getSubEdges` on all the edges in the list and returns the array of results **Returns** * Array\<[EdgeList](/api/edgelist)|null\> ## `edgeList.getTarget()` {#edgelist-gettarget} Returns the list of target nodes of the edges **Returns** * [NodeList](/api/nodelist) ## `edgeList.includes(edge)` {#edgelist-includes} Indicates if the `EdgeList` contains the specified edge. **Arguments** * edge [Edge](/api/edge) **Returns** * boolean ## `edgeList.inverse()` {#edgelist-inverse} Returns a new EdgeList containing all the visible edges that are not in the list. **Returns** * [EdgeList](/api/edgelist) ## `edgeList.isSelected()` {#edgelist-isselected} Indicates if the edges are currently selected. **Returns** * Array\ ## `edgeList.isVisible()` {#edgelist-isvisible} Call [`isVisible`](#Edge-isVisible) on each edge in the list, and returns the array of results. **Returns** * Array\ ## `edgeList.locate([options])` {#edgelist-locate} Centers the view on the edges. **Arguments** * options(optional) [LocateOptions](/api/types/locateoptions) **Returns** * Promise\ ## `edgeList.map(callback)` {#edgelist-map} **Arguments** * callback function(edge: [Edge](/api/edge), index: number, list: [EdgeList](/api/edgelist)): any **Returns** * Array\ ## `edgeList.pulse([options])` {#edgelist-pulse} Highlights the edges. It's a shorthand for the case when you want the elements pulse for `number * (interval - 1) + duration` milliseconds. It will also update the pulse attributes of the items with the one provided in the `.pulse()` call **Arguments** * options(optional) object * duration(optional) number[=1000] Duration of a pulse (milliseconds) * endColor(optional) [Color](/api/types/color)|"inherit"[="rgb(0,0,0,0.0)"] Ending color of the pulse * endRatio(optional) number[=2] Where the pulse ends, relative to the edge siz (1 = at the edge's border) * interval(optional) number[=800] Interval between two pulses (milliseconds) * number(optional) number[=1] Number of pulses * startColor(optional) [Color](/api/types/color)|"inherit"[="rgb(0,0,0,0.6)"] Starting color of the pulse * startRatio(optional) number[=1] Where the pulse starts, relative to the edge siz (1 = at the edge's border) * width(optional) number[=10] Width of the pulse in pixels **Returns** * Promise\<[EdgeList](/api/edgelist)\> ## `edgeList.reduce(callback, initialValue)` {#edgelist-reduce} **Arguments** * callback function(accumulator: any, currentValue: [Edge](/api/edge), index: number): any * initialValue any **Returns** * any ## `edgeList.removeClass(className[, options])` {#edgelist-removeclass} Remove the specified class from the edges. **Arguments** * className string * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[EdgeList](/api/edgelist)\> ## `edgeList.removeClasses(classNames[, options])` {#edgelist-removeclasses} Remove the specified class from the edges. **Arguments** * classNames Array\ * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[EdgeList](/api/edgelist)\> ## `edgeList.resetAttributes([attributes][, options])` {#edgelist-resetattributes} Remove all attributes that have been applied through `setAttributes` of all the edges in the list. Original attributes or attributes applied by the rules are not affected. **Arguments** * attributes(optional) Array\<[PropertyPath](/api/types/propertypath)\> List of attributes to clear. If no attribute is specified, clear all of them. * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[EdgeList](/api/edgelist)\> ## `edgeList.setAttribute(attribute, value[, options])` {#edgelist-setattribute} Set the specified attribute of all the edges in the list. **Arguments** * attribute [PropertyPath](/api/types/propertypath) * value any|Array\ If it is an array, the values will be spread across the edges of the list. Otherwise the value will be assigned to all edges. * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[EdgeList](/api/edgelist)\> ## `edgeList.setAttributes(attributes[, options])` {#edgelist-setattributes} Set the individual attributes of all the edges in the list. **Arguments** * attributes [EdgeAttributesValue](/api/types/edgeattributesvalue)|Array\<[EdgeAttributesValue](/api/types/edgeattributesvalue)\> If a single attribute is specified, it is applied to all edges. If an array is specified, each index of the array is assigned to the corresponding edge. * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[EdgeList](/api/edgelist)\> ## `edgeList.setData([property], values)` {#edgelist-setdata} Set the specified data property of the edges. If no property is specified, update the whole data object. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath) Path of the data property to update. * values Array\|function(edge: [Edge](/api/edge)): any If it's an array, each value is assigned to the corresponding edge, meaning the array must have the same length as the EdgeList. If it's a function, it will be applied to each edge to **Returns** * [EdgeList](/api/edgelist) Determine which value to assign. ## `edgeList.setSelected(active)` {#edgelist-setselected} **Arguments** * active boolean|Array\ Whether to select or unselect the edges. ## `edgeList.setVisible()` {#edgelist-setvisible} Call [`setVisible`](#Edge-setVisible) on each edge in the list. ## `edgeList.slice([start][, end])` {#edgelist-slice} Returns a new EdgeList which contains only the edges from index `start` to `end` (excluding `end`). **Arguments** * start(optional) number * end(optional) number **Returns** * [EdgeList](/api/edgelist) ## `edgeList.some(callback)` {#edgelist-some} **Arguments** * callback function(edge: [Edge](/api/edge), index: number, list: [EdgeList](/api/edgelist)): boolean **Returns** * boolean ## `edgeList.subtract([list])` {#edgelist-subtract} **Arguments** * list(optional) [EdgeList](/api/edgelist) Returns a new EdgeList which does not contain any element from list **Returns** * [EdgeList](/api/edgelist) ## `edgeList.toArray()` {#edgelist-toarray} Returns an array of edges from the EdgeList. **Returns** * Array\<[Edge](/api/edge)\> ## `edgeList.toJSON([options])` {#edgelist-tojson} Runs `toJSON` on all the edges in the list and returns the list of objects. **Arguments** * options(optional) object * attributes(optional) Array\<[PropertyPath](/api/types/propertypath)\>|"all"[=[]] * data(optional) function (data: any): any **Returns** * Array\<[RawEdge](/api/types/rawedge)\> ## `edgeList.toList()` {#edgelist-tolist} Returns itself. **Returns** * [EdgeList](/api/edgelist) # Node {#node} Ogma node entity class. Use this class to manipulate nodes, change data, attributes, etc. * ## `node.isNode` {#node-isnode} Read-only property that is always `true`. ## `node.addClass(className[, options])` {#node-addclass} Add the specified class to the node. **Arguments** * className string * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Node](/api/node)\> ## `node.addClasses(classNames[, options])` {#node-addclasses} Add the specified classes to the node. **Arguments** * classNames Array\ * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Node](/api/node)\> ## `node.get(index)` {#node-get} Convenience method to make Nodes and NodeLists more uniform **Arguments** * index number **Returns** * [Node](/api/node)|undefined ## `node.getAdjacentEdges([options])` {#node-getadjacentedges} Returns the list of adjacent edges of the node. **Arguments** * options(optional) [AdjacencyOptions](/api/types/adjacencyoptions) **Returns** * [EdgeList](/api/edgelist) ## `node.getAdjacentElements([options])` {#node-getadjacentelements} Returns the list of adjacent nodes of the node and the edges connected to it. **Arguments** * options(optional) [AdjacencyOptions](/api/types/adjacencyoptions) **Returns** * [SubGraph](/api/types/subgraph) ## `node.getAdjacentNodes([options])` {#node-getadjacentnodes} Returns the list of adjacent nodes of the node. **Arguments** * options(optional) [AdjacencyOptions](/api/types/adjacencyoptions) **Returns** * [NodeList](/api/nodelist) ## `node.getAttribute(attributeName)` {#node-getattribute} Returns the value of the specified attribute for the node. **Arguments** * attributeName [PropertyPath](/api/types/propertypath) Attribute to retrieve. **Returns** * any ## `node.getAttributes([attributeNames])` {#node-getattributes} Returns an object containing the specified attributes for the node. **Arguments** * attributeNames(optional) Array\<[PropertyPath](/api/types/propertypath)\> List of attributes to include in the object. If not specified, includes all the node attributes. **Returns** * [NodeAttributes](/api/types/nodeattributes) ## `node.getBoundingBox([options])` {#node-getboundingbox} Returns the bounding box of the node, in graph coordinates. **Arguments** * options(optional) object * includeTexts(optional) boolean[=false] Wether or not take texts in account in the bouding box **Returns** * [BoundingBox](/api/types/boundingbox) ## `node.getClassList()` {#node-getclasslist} Returns the list of classes that the node has. **Returns** * Array\ ## `node.getConnectedComponent([options])` {#node-getconnectedcomponent} **Arguments** * options(optional) object * filter(optional) [Filter](/api/types/filter)[='visible'] * returnIds(optional) boolean[=false] Return node ids instead of Nodes **Returns** * [NodeList](/api/nodelist) ## `node.getData([property])` {#node-getdata} Retrieve the specified data property of the node. If no property is specified, retrieve the whole data object. This method method returns the internal data object; modifying it could cause unexpected behavior. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath) **Returns** * any ## `node.getDegree([options])` {#node-getdegree} Retrieve the number of neighbors of the node. **Arguments** * options(optional) object|[EdgeDirection](/api/types/edgedirection) * direction(optional) [EdgeDirection](/api/types/edgedirection)[="both"] Direction of the edges to follow. * filter(optional) [Filter](/api/types/filter)[="visible"] Indicates which edges to take into account **Returns** * number ## `node.getGeoCoordinates()` {#node-getgeocoordinates} Returns node's geographical coordinate **Returns** * [GeoCoordinate](/api/types/geocoordinate) ## `node.getId()` {#node-getid} Returns the id of the node. **Returns** * [NodeId](/api/types/nodeid) ## `node.getMetaNode()` {#node-getmetanode} If the node is grouped inside a meta-node, returns this meta-node. Otherwise, returns null. **Returns** * [Node](/api/node)|null ## `node.getPosition()` {#node-getposition} Retrieve the position of the node. This is strictly equivalent to `node.getAttributes(['x', 'y'])`. **Returns** * {x: number, y: number} ## `node.getSubNodes()` {#node-getsubnodes} If the node is a meta-node (result of a grouping), returns the list of nodes that are part of the group it represents. If it's not a meta-node, returns `null`. **Returns** * [NodeList](/api/nodelist)|null ## `node.getTransformation()` {#node-gettransformation} Returns the transformation that created the node, if it is virtual. Otherwise returns `null`. **Returns** * [Transformation](/api/transformation)|null ## `node.hasClass(className)` {#node-hasclass} Indicates if the node has the specified class. **Arguments** * className string **Returns** * boolean ## `node.isInView([options])` {#node-isinview} Indicates if the node is visible in the current view. **Arguments** * options(optional) object * margin(optional) number[=0] Tolerance in pixels. **Returns** * boolean ## `node.isSelected()` {#node-isselected} Indicates if the node is currently selected. **Returns** * boolean ## `node.isVirtual()` {#node-isvirtual} Indicates if the node was created by a transformation (`true`) or not (`false`). **Returns** * boolean ## `node.isVisible()` {#node-isvisible} Indicates if the node is visible. A node is not visible if it has been filtered out, or if it is used in a transformation. /!\ A node with an opacity of 0 is considered visible! **Returns** * boolean ## `node.locate([options])` {#node-locate} Centers the view on the node. **Arguments** * options(optional) [LocateOptions](/api/types/locateoptions) **Returns** * Promise\ ## `node.pulse([options])` {#node-pulse} Highlights the node. It's a shorthand for the case when you want the elements pulse for `number * (interval - 1) + duration` milliseconds. It will also update the pulse attributes of the items with the one provided in the `.pulse()` call. **Arguments** * options(optional) object * duration(optional) number[=1000] Duration of a pulse (milliseconds) * endColor(optional) [Color](/api/types/color)|"inherit"[="rgb(0,0,0,0.0)"] Ending color of the pulse * endRatio(optional) number[=2] Where the pulse ends, relative to the node siz (1 = at the node's border) * interval(optional) number[=800] Interval between two pulses (milliseconds) * number(optional) number[=1] Number of pulses * startColor(optional) [Color](/api/types/color)|"inherit"[="rgb(0,0,0,0.6)"] Starting color of the pulse * startRatio(optional) number[=1] Where the pulse starts, relative to the node siz (1 = at the node's border) * width(optional) number[=50] Width of the pulse in pixels **Returns** * Promise\<[Node](/api/node)\> ## `node.removeClass(className[, options])` {#node-removeclass} Remove the specified class from the node. **Arguments** * className string * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Node](/api/node)\> ## `node.removeClasses(classNames[, options])` {#node-removeclasses} Remove the specified class from the node. **Arguments** * classNames Array\ * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Node](/api/node)\> ## `node.resetAttributes([attributeNames][, options])` {#node-resetattributes} Remove all attributes that have been applied through `setAttributes`. Original attributes or attributes applied by the rules are not affected. **Arguments** * attributeNames(optional) Array\<[PropertyPath](/api/types/propertypath)\> List of attributes to clear. If no attribute is specified, clear all of them. * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Node](/api/node)\> ## `node.setAttribute(attribute, value[, options])` {#node-setattribute} Set the specified attribute of the node. **Arguments** * attribute [PropertyPath](/api/types/propertypath) * value any * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Node](/api/node)\> ## `node.setAttributes(attributes[, options])` {#node-setattributes} Set the individual attributes of the node. **Arguments** * attributes [NodeAttributesValue](/api/types/nodeattributesvalue) Attributes to update * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[Node](/api/node)\> ## `node.setData([property], value)` {#node-setdata} Set the specified data property of the node. If no property is specified, update the whole data object. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath) * value any|function(node: [Node](/api/node)): any **Returns** * [Node](/api/node) ## `node.setGeoCoordinates(coords)` {#node-setgeocoordinates} Set geographical position of the node. Passing null will erase the coordinates and remove the node from the visualisation in geo mode. **Arguments** * coords [GeoCoordinate](/api/types/geocoordinate)|null **Returns** * Promise\<[Node](/api/node)\> ## `node.setSelected(active)` {#node-setselected} Add or remove the node to/from the selection. **Arguments** * active boolean Whether to select or unselect the node. ## `node.setVisible(value)` {#node-setvisible} Hide or show the node. **Arguments** * value boolean Whether to show or hide the node. ## `node.toJSON([options])` {#node-tojson} Returns an object containing the id, attributes and data of the node. **Arguments** * options(optional) object * attributes(optional) Array\<[PropertyPath](/api/types/propertypath)\>|"all"[=[]] List of attributes to retrieve. By default, retrieve all attributes. * data(optional) function (data: any): any Function that takes the node's data in input and return the data to retrieve. By default return the whole object. **Returns** * [RawNode](/api/types/rawnode) ## `node.toList()` {#node-tolist} Returns a new NodeList that contains only the node. **Returns** * [NodeList](/api/nodelist) # NodeList {#nodelist} Ogma node list class. Use this class to manipulate a list of nodes, change data, attributes, etc. * ## `nodeList.isNode` {#nodelist-isnode} Read-only property that is always `true`. * ## `nodeList.size` {#nodelist-size} Read-only property that indicates the number of nodes in the list. ## `nodeList.addClass(className[, options])` {#nodelist-addclass} Add the specified class to the nodes. **Arguments** * className string * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.addClasses(classNames[, options])` {#nodelist-addclasses} Add the specified classes to the nodes. **Arguments** * classNames Array\ * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.concat(nodes)` {#nodelist-concat} **Arguments** * nodes [NodeList](/api/nodelist) **Returns** * [NodeList](/api/nodelist) ## `nodeList.dedupe()` {#nodelist-dedupe} Returns a new NodeList which does not contain any duplicate node. **Returns** * [NodeList](/api/nodelist) ## `nodeList.fillData([property], value)` {#nodelist-filldata} Set the specified data property of the nodes with the same value. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath)|any Path of the data property to update. If no property is specified, update the whole data object. * value any Value that will be assigned to all the nodes. **Returns** * [NodeList](/api/nodelist) ## `nodeList.filter(callback)` {#nodelist-filter} **Arguments** * callback function(node: [Node](/api/node), index: number): boolean **Returns** * [NodeList](/api/nodelist) ## `nodeList.find(callback)` {#nodelist-find} **Arguments** * callback function(node: [Node](/api/node), index: number, list: [NodeList](/api/nodelist)): boolean **Returns** * [Node](/api/node)|undefined ## `nodeList.forEach(callback)` {#nodelist-foreach} **Arguments** * callback function(node: [Node](/api/node), index: number) ## `nodeList.get(index)` {#nodelist-get} Returns the node at the specified index. **Arguments** * index number **Returns** * [Node](/api/node) ## `nodeList.getAdjacentEdges([options])` {#nodelist-getadjacentedges} Returns the list of adjacent edges of the nodes. **Arguments** * options(optional) [AdjacencyOptions](/api/types/adjacencyoptions) **Returns** * [EdgeList](/api/edgelist) ## `nodeList.getAdjacentElements([options])` {#nodelist-getadjacentelements} Returns the list of adjacent nodes of the nodeList and the edges connected to it. **Arguments** * options(optional) [AdjacencyOptions](/api/types/adjacencyoptions) **Returns** * [SubGraph](/api/types/subgraph) ## `nodeList.getAdjacentNodes([options])` {#nodelist-getadjacentnodes} Returns the list of adjacent nodes of the nodes. **Arguments** * options(optional) [AdjacencyOptions](/api/types/adjacencyoptions) **Returns** * [NodeList](/api/nodelist) ## `nodeList.getAttribute(attributeName)` {#nodelist-getattribute} Returns an array containing the value of the specified attribute for each node. **Arguments** * attributeName [PropertyPath](/api/types/propertypath) Attribute to retrieve. **Returns** * Array\ ## `nodeList.getAttributes([attributes])` {#nodelist-getattributes} Returns an array of objects containing the specified attributes for each node. **Arguments** * attributes(optional) Array\<[PropertyPath](/api/types/propertypath)\> List of attributes to include in the object. If not specified, includes all the node attributes. **Returns** * [NodeAttributes](/api/types/nodeattributes)[] ## `nodeList.getBoundingBox([options])` {#nodelist-getboundingbox} Returns the bounding box of the nodes, in graph coordinates. **Arguments** * options(optional) object * includeTexts(optional) boolean[=false] Wether or not take texts in account in the bouding box **Returns** * [BoundingBox](/api/types/boundingbox) ## `nodeList.getClassList()` {#nodelist-getclasslist} Returns the list of classes that each node has. **Returns** * Array\\> ## `nodeList.getConnectedComponents([options])` {#nodelist-getconnectedcomponents} Returns weakly connected components of the list of nodes. **Arguments** * options(optional) object * filter(optional) [Filter](/api/types/filter)[='visible'] * returnIds(optional) boolean[=false] Return node ids instead of Nodes **Returns** * Array\<[NodeList](/api/nodelist)\> ## `nodeList.getData([property])` {#nodelist-getdata} Retrieve the specified data property. If no property is specified, retrieve the whole data object. This method method returns the internal data object; modifying it could cause unexpected behavior. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath) **Returns** * Array\ ## `nodeList.getDegree()` {#nodelist-getdegree} Runs `getDegree` on each node in the list and returns the array of results. ## `nodeList.getGeoCoordinates()` {#nodelist-getgeocoordinates} Returns geographical coordinates of all the nodes in the collection **Returns** * Array\<[GeoCoordinate](/api/types/geocoordinate)\> ## `nodeList.getId()` {#nodelist-getid} Returns the id of each node. **Returns** * Array\<[NodeId](/api/types/nodeid)\> ## `nodeList.getMetaNode()` {#nodelist-getmetanode} Run `getMetaNode` on each node in the list and returns the array of results. **Returns** * Array\<[Node](/api/node)|null\> ## `nodeList.getPosition()` {#nodelist-getposition} Retrieve the position of each node in the list. This is strictly equivalent to `nodeList.getAttributes(['x', 'y'])`. **Returns** * Array\<{x: number, y: number}\> ## `nodeList.getSubNodes()` {#nodelist-getsubnodes} Run `getSubNodes` on all the nodes in the list and returns the array of results **Returns** * Array\<[NodeList](/api/nodelist)|null\> ## `nodeList.includes(node)` {#nodelist-includes} Indicates if the `NodeList` contains the specified node. **Arguments** * node [Node](/api/node) **Returns** * boolean ## `nodeList.inverse()` {#nodelist-inverse} Returns a new NodeList containing all the visible nodes that are not in the list. **Returns** * [NodeList](/api/nodelist) ## `nodeList.isSelected()` {#nodelist-isselected} Indicates for each node if it is selected. **Returns** * Array\ ## `nodeList.isVisible()` {#nodelist-isvisible} Call [`isVisible`](#Node-isVisible) on each node in the list, and returns the array of results. **Returns** * Array\ ## `nodeList.locate([options])` {#nodelist-locate} Centers the view on the nodes. **Arguments** * options(optional) [LocateOptions](/api/types/locateoptions) **Returns** * Promise\ ## `nodeList.map(callback)` {#nodelist-map} **Arguments** * callback function(node: [Node](/api/node), index: number, list: [NodeList](/api/nodelist)): any **Returns** * Array\ ## `nodeList.pulse([options])` {#nodelist-pulse} Highlights the nodes with a pulse. It's a shorthand for the case when you want the elements pulse for `number * (interval - 1) + duration` milliseconds. It will also update the pulse attributes of the items with the one provided in the `.pulse()` call. **Arguments** * options(optional) object * duration(optional) number[=1000] Duration of a pulse (milliseconds) * endColor(optional) [Color](/api/types/color)|"inherit"[="rgb(0,0,0,0.0)"] Ending color of the pulse * endRatio(optional) number[=2] Where the pulse ends, relative to the node siz (1 = at the node's border) * interval(optional) number[=800] Interval between two pulses (milliseconds) * number(optional) number[=1] Number of pulses * startColor(optional) [Color](/api/types/color)|"inherit"[="rgb(0,0,0,0.6)"] Starting color of the pulse * startRatio(optional) number[=1] Where the pulse starts, relative to the node siz (1 = at the node's border) * width(optional) number[=50] Width of the pulse in pixels **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.reduce(callback, initialValue)` {#nodelist-reduce} **Arguments** * callback function(accumulator: any, currentValue: [Node](/api/node), index: number): any * initialValue any **Returns** * any ## `nodeList.removeClass(className[, options])` {#nodelist-removeclass} Remove the specified class from the nodes. **Arguments** * className string * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.removeClasses(classNames[, options])` {#nodelist-removeclasses} Remove the specified class from the nodes. **Arguments** * classNames Array\ * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.resetAttributes([attributes][, options])` {#nodelist-resetattributes} Remove all attributes that have been applied through `setAttributes` of all the nodes in the list. Original attributes or attributes applied by the rules are not affected. **Arguments** * attributes(optional) Array\<[PropertyPath](/api/types/propertypath)\> List of attributes to clear. If no attribute is specified, clear all of them. * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.setAttribute(attribute, values[, options])` {#nodelist-setattribute} Set the specified attribute of all the nodes in the list. **Arguments** * attribute [PropertyPath](/api/types/propertypath) * values any|Array\ If it is an array, the values will be spread across the nodes of the list. Otherwise the value will be assigned to all nodes. * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.setAttributes(attributes[, options])` {#nodelist-setattributes} Set the individual attributes of all the nodes in the list. **Arguments** * attributes [NodeAttributesValue](/api/types/nodeattributesvalue)|Array\<[NodeAttributesValue](/api/types/nodeattributesvalue)\> If a single attribute is specified, it is applied to all nodes. If an array is specified, each index of the array is assigned to the corresponding node. * options(optional) [AttributeAnimationOptions](/api/types/attributeanimationoptions) **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.setData([property], values)` {#nodelist-setdata} Set the specified data property of the nodes. If no property is specified, update the whole data object. **Arguments** * property(optional) [PropertyPath](/api/types/propertypath) Path of the data property to update. * values Array\|function(node: [Node](/api/node)): any If it's an array, each value is assigned to the corresponding node, meaning the array must have the same length as the NodeList. If it's a function, it will be applied to each node to determine which value to assign. **Returns** * [NodeList](/api/nodelist) ## `nodeList.setGeoCoordinates(coordinates[, duration])` {#nodelist-setgeocoordinates} Assign geographical coordinates to the nodes in collection **Arguments** * coordinates Array\<[GeoCoordinate](/api/types/geocoordinate)|null\>|null * duration(optional) number Animation duration **Returns** * Promise\<[NodeList](/api/nodelist)\> ## `nodeList.setSelected(active)` {#nodelist-setselected} Add or remove the nodes from the selection. **Arguments** * active boolean|Array\ Whether to select or unselect the nodes. ## `nodeList.setVisible()` {#nodelist-setvisible} Call [`setVisible`](#Node-setVisible) on each node in the list. ## `nodeList.slice([start][, end])` {#nodelist-slice} Returns a new NodeList which contains only the nodes from index `start` to `end` (excluding `end`). **Arguments** * start(optional) number * end(optional) number **Returns** * [NodeList](/api/nodelist) ## `nodeList.some(callback)` {#nodelist-some} **Arguments** * callback function(node: [Node](/api/node), index: number, list: [NodeList](/api/nodelist)): boolean **Returns** * boolean ## `nodeList.sort(fn)` {#nodelist-sort} **Arguments** * fn (a: [Node](/api/node), b: [Node](/api/node)): number Sort function ## `nodeList.subtract([list])` {#nodelist-subtract} **Arguments** * list(optional) [NodeList](/api/nodelist) Returns a new NodeList which does not contain any element from list **Returns** * [NodeList](/api/nodelist) ## `nodeList.toArray()` {#nodelist-toarray} Returns an array of nodes from the NodeList. **Returns** * Array\<[Node](/api/node)\> ## `nodeList.toJSON([options])` {#nodelist-tojson} Runs `toJSON` on all the nodes in the list and returns the list of objects. **Arguments** * options(optional) object * attributes(optional) Array\<[PropertyPath](/api/types/propertypath)\>|"all"[=[]] * data(optional) function (data: any): any **Returns** * Array\<[RawNode](/api/types/rawnode)\> ## `nodeList.toList()` {#nodelist-tolist} Returns itself. **Returns** * [NodeList](/api/nodelist) # geometry {#geometry} Ogma static toolbox for geometry purposes ## `geometry.computeCentroid(points)` {#geometry-computecentroid} Returns the average of the specified points. **Arguments** * points [Point](/api/types/point)[] **Returns** * [Point](/api/types/point) ## `geometry.distance(x1, y1, x2, y2)` {#geometry-distance} Compute the distance between two points (x1, y1) and (x2, y2). **Arguments** * x1 number * y1 number * x2 number * y2 number **Returns** * number Distance between the two points. ## `geometry.getNormalOnEdge(edge, t)` {#geometry-getnormalonedge} Returns the normal vector of the edge at t. Returns the normal at the source of the edge for t = 0 and at the target for t = 1 **Arguments** * edge [Edge](/api/edge) An edge * t number The interpolation value bounded in [0;1]. **Returns** * object {x,y} The normal to the edge at t ## `geometry.getPointOnEdge(edge, t)` {#geometry-getpointonedge} Returns the point of the edge at t. Returns the source of the edge for t = 0 and at the target for t = 1 **Arguments** * edge [Edge](/api/edge) An edge * t number The interpolation value bounded in [0;1]. **Returns** * object {x,y} The position on the edge at t ## `geometry.getQuadraticCurveControlPoint(x1, y1, x2, y2, curvature, dest?)` {#geometry-getquadraticcurvecontrolpoint} Returns the control point used to draw a curved edge. **Arguments** * x1 number X position of the source * y1 number Y position of the source * x2 number X position of the target * y2 number Y position of the target * curvature number The curvature factor of the edge * dest? [Point](/api/types/point) A Point to write in the result **Returns** * [Point](/api/types/point) The control point used to draw a curved edge. ## `geometry.getTangentOnEdge(edge, t)` {#geometry-gettangentonedge} Returns the tangent vector of the edge at t. Returns the tangent at the source of the edge for t = 0 and at the target for t = 1 **Arguments** * edge [Edge](/api/edge) An edge * t number The interpolation value bounded in [0;1]. **Returns** * object {x,y} The tangent to the edge at t * [geometry.lines]() # parse {#parse} Ogma static toolbox for data imports, use as `Ogma.parse.*`. ## `parse.gexf(content)` {#parse-gexf} Parse a GEXF string and return the raw graph. **Arguments** * content string **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.gexfFromUrl(url)` {#parse-gexffromurl} Fetch and parse a GEXF file and return the raw graph. **Arguments** * url string **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.graphml(content[, xmlparser])` {#parse-graphml} Parse a GraphML string and return the raw graph. **Arguments** * content string GraphML string to transform custom JSON format into Ogma's `RawGraph` * xmlparser(optional) DOMParser DOMParser instance to use for parsing the XML **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.graphmlFromUrl(url[, xmlparser])` {#parse-graphmlfromurl} Fetch and parse a GraphML file and return the raw graph. **Arguments** * url string * xmlparser(optional) DOMParser DOMParser instance to use for parsing the XML **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.janus(content)` {#parse-janus} Parse the result of a JanusGraph query into an Ogma graph. **Arguments** * content object Response of the gremlin-client library ("gremlin-client") **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.json(content[, transform])` {#parse-json} Parse a JSON string and return the raw graph. **Arguments** * content string * transform(optional) function(json: object | unknown[]): [RawGraph](/api/types/rawgraph) Function to transform custom JSON format into Ogma's `RawGraph` **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.jsonFromUrl(url[, transform])` {#parse-jsonfromurl} Fetch and parse a JSON file and return the raw graph. **Arguments** * url string * transform(optional) function(json: object | unknown[]): [RawGraph](/api/types/rawgraph) Function to transform custom JSON format into Ogma's `RawGraph` **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.mtx(content)` {#parse-mtx} Parse a Matrix Market file (.mtx) **Arguments** * content string **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.mtxFromUrl(url)` {#parse-mtxfromurl} Loads and parses a Matrix Market file (.mtx) **Arguments** * url string **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> ## `parse.neo4j(content)` {#parse-neo4j} **Arguments** * content object Response of the Neo4j Bolt driver ("neo4j-javascript-driver") **Returns** * Promise\<[RawGraph](/api/types/rawgraph)\> # StyleClass {#styleclass} Represents a visual class that can be applied to nodes and edges. ## `styleClass.add(elements)` {#styleclass-add} Add the class to the specified node(s)/edge(s). Equivalent to to `elements.addClass(myClass.getName())`. **Arguments** * elements [Node](/api/node)|[Edge](/api/edge)|[NodeList](/api/nodelist)|[EdgeList](/api/edgelist) ## `styleClass.clearEdges([filter])` {#styleclass-clearedges} Remove the class from all edges. **Arguments** * filter(optional) [Filter](/api/types/filter) Filter to apply to edges ## `styleClass.clearNodes([filter])` {#styleclass-clearnodes} Remove the class from all nodes. **Arguments** * filter(optional) [Filter](/api/types/filter) Filter to apply to nodes ## `styleClass.destroy()` {#styleclass-destroy} Remove the class from all nodes and edges and delete it. **Returns** * Promise\ ## `styleClass.getDefinition()` {#styleclass-getdefinition} Returns the node and edge attributes associated with the class. **Returns** * [StyleClassDefinition](/api/types/styleclassdefinition) ## `styleClass.getEdges([filter])` {#styleclass-getedges} Returns the list of edges that have the class. Does not include filtered edges. **Arguments** * filter(optional) [Filter](/api/types/filter) Filter to apply to edges **Returns** * [EdgeList](/api/edgelist) ## `styleClass.getIndex()` {#styleclass-getindex} Returns the index of the class in the internal class array. A higher index class is applied after a lower index class. **Returns** * number ## `styleClass.getName()` {#styleclass-getname} Returns the name of the class. **Returns** * string ## `styleClass.getNodes(Filter)` {#styleclass-getnodes} Returns the list of nodes that have the class. Does not include filtered nodes. **Arguments** * Filter [filter] filter to apply to nodes **Returns** * [NodeList](/api/nodelist) ## `styleClass.remove(elements)` {#styleclass-remove} Remove the class from the specified node(s)/edge(s). Equivalent to to `elements.removeClass(myClass.getName())`. **Arguments** * elements [Node](/api/node)|[Edge](/api/edge)|[NodeList](/api/nodelist)|[EdgeList](/api/edgelist) ## `styleClass.setIndex(index)` {#styleclass-setindex} Set the index of the class in the internal class array. A higher index class is applied after a lower index class. **Arguments** * index number ## `styleClass.update(options)` {#styleclass-update} Updates the attributes assigned to nodes and edges that have that class. **Arguments** * options object * edgeAttributes(optional) [EdgeAttributesValue](/api/types/edgeattributesvalue) * edgeDependencies(optional) [EdgeDependencies](/api/types/edgedependencies) * edgeOutput(optional) [EdgeOutput](/api/types/edgeoutput) * fullOverwrite(optional) boolean[=false] Indicates if the specified attributes should be merge with current ones (false) or if the specified attributes should entirely replace the current ones. * nodeAttributes(optional) [NodeAttributesValue](/api/types/nodeattributesvalue) * nodeDependencies(optional) [NodeDependencies](/api/types/nodedependencies) * nodeOutput(optional) [NodeOutput](/api/types/nodeoutput) # StyleRule {#stylerule} Controller class for a style rule, used to update and manage the attributes and selectors associated with the rule. ## `styleRule.destroy()` {#stylerule-destroy} Delete the rule. After this is called, a call to any method on this object will throw an error. **Returns** * Promise\ ## `styleRule.getId()` {#stylerule-getid} Returns the unique positive integer rule id associated with the rule. **Returns** * number ## `styleRule.getIndex()` {#stylerule-getindex} Retrieve the position of the rule in the internal rule list. Rules with a higher index are applied after rules with a lower index. **Returns** * number ## `styleRule.refresh()` {#stylerule-refresh} Refresh the rule for all nodes. **Returns** * Promise\ ## `styleRule.setIndex(index)` {#stylerule-setindex} Assign the position of the rule in the internal rule list. Rules with a higher index are applied after rules with a lower index. **Arguments** * index number **Returns** * Promise\ ## `styleRule.update(options)` {#stylerule-update} Updates the attributes and selectors associated with the rule. **Arguments** * options * edgeAttributes(optional) [EdgeAttributesValue](/api/types/edgeattributesvalue) * edgeDependencies(optional) [EdgeDependencies](/api/types/edgedependencies) * edgeOutput(optional) [EdgeOutput](/api/types/edgeoutput) * edgeSelector(optional) [EdgeSelector](/api/types/edgeselector)|null * fullOverwrite(optional) boolean[=false] Indicates if the specified attributes should be merged with current ones (false) or if the specified attributes should entirely replace the current ones. * nodeAttributes(optional) [NodeAttributesValue](/api/types/nodeattributesvalue) * nodeDependencies(optional) [NodeDependencies](/api/types/nodedependencies) * nodeOutput(optional) [NodeOutput](/api/types/nodeoutput) * nodeSelector(optional) [NodeSelector](/api/types/nodeselector)|null **Returns** * Promise\ ## `styleRule.whenApplied()` {#stylerule-whenapplied} Call the specified function when the rule is applied for the first time. **Returns** * Promise\<[StyleRule](/api/stylerule)\> # NonObjectPropertyWatcher {#nonobjectpropertywatcher} Retrieved from `ogma.schema.watchNodeNonObjectProperty()` or `ogma.schema.watchEdgeNonObjectProperty()`. ## `nonObjectPropertyWatcher.destroy()` {#nonobjectpropertywatcher-destroy} Stops the watcher from being updated ## `nonObjectPropertyWatcher.getPath()` {#nonobjectpropertywatcher-getpath} Returns the path of the data property being watched **Returns** * Array\ ## `nonObjectPropertyWatcher.getPropertyInfo()` {#nonobjectpropertywatcher-getpropertyinfo} Retrieve some information on the property being watched. **Returns** * [PropertyInformation](/api/propertyinformation) ## `nonObjectPropertyWatcher.onUpdate(handler)` {#nonobjectpropertywatcher-onupdate} Triggers the specified function when the property is updated, **Arguments** * handler function (info: [PropertyInformation](/api/propertyinformation)) # ObjectPropertyWatcher {#objectpropertywatcher} Retrieved from `ogma.schema.watchNodeProperties()` or `ogma.schema.watchEdgeProperties()`. ## `objectPropertyWatcher.destroy()` {#objectpropertywatcher-destroy} Stops the watcher from being updated. ## `objectPropertyWatcher.getPath()` {#objectpropertywatcher-getpath} Returns the path of the data property being watched **Returns** * Array\ ## `objectPropertyWatcher.getProperties()` {#objectpropertywatcher-getproperties} Returns the names of the sub-property of the watched property. **Returns** * Array\ ## `objectPropertyWatcher.getPropertyInfo(name)` {#objectpropertywatcher-getpropertyinfo} Retrieve some information on the specified sub-property. **Arguments** * name string **Returns** * [PropertyInformation](/api/propertyinformation)|null ## `objectPropertyWatcher.onPropertyAdded(handler)` {#objectpropertywatcher-onpropertyadded} Triggers the specified function when a new sub-property is added (at least one node has a value for it). **Arguments** * handler function (property: string, info: [PropertyInformation](/api/propertyinformation)) **Returns** * [ObjectPropertyWatcher](/api/objectpropertywatcher) ## `objectPropertyWatcher.onPropertyRemoved(handler)` {#objectpropertywatcher-onpropertyremoved} Triggers the specified function when a new sub-property is removed (no node has a value for it). **Arguments** * handler function (property: string, info: [PropertyInformation](/api/propertyinformation)) **Returns** * [ObjectPropertyWatcher](/api/objectpropertywatcher) ## `objectPropertyWatcher.onPropertyUpdated(handler)` {#objectpropertywatcher-onpropertyupdated} Triggers when a sub-property of the watched property is updated. **Arguments** * handler function (property: string, info: [PropertyInformation](/api/propertyinformation)) **Returns** * [ObjectPropertyWatcher](/api/objectpropertywatcher) # PropertyInformation {#propertyinformation} Retrieved from `watcher.getPropertyInfo()`. ## `propertyInformation.getBoundaries()` {#propertyinformation-getboundaries} If there is at least one numerical value for this property, returns the minimum and maximum value for this property across the graph. Returns `null` if there is no numerical value for that property. **Returns** * null|{min: number, max: number} ## `propertyInformation.getCount()` {#propertyinformation-getcount} Returns the number of nodes/edges for which the property is different from `undefined` **Returns** * number ## `propertyInformation.getType()` {#propertyinformation-gettype} Returns the type of the property. **Returns** * "any"|"number"|"undefined" If there is at least one non-number (excluding `undefined`) value, returns `'any'`. If there are only numerical values for that property, returns `'number'`. If no node/edge has a value for that property, returns `'undefined'`. ## `propertyInformation.getValueCount(value)` {#propertyinformation-getvaluecount} Returns the number of nodes/edges for which the property has the specified value. **Arguments** * value any **Returns** * number ## `propertyInformation.getValues()` {#propertyinformation-getvalues} Returns the different values for this property. **Returns** * Array\ ## `propertyInformation.isNode()` {#propertyinformation-isnode} Indicates if it is a node or edge property. **Returns** * boolean # Transformation {#transformation} Controller for an individual transformation on the graph, such as grouping, filtering etc. ## `transformation.destroy(duration)` {#transformation-destroy} Remove the transformation over the specified amount of time. After this methods is called, the transformation is not manipulable anymore (cannot be enabled again for example). Note: the animation will not be played if the transformation is not the last in the transformation stack, because the transformations are sequential **Arguments** * duration number **Returns** * Promise\ ## `transformation.disable([duration])` {#transformation-disable} Disable the transformation over the specified amount of time. **Arguments** * duration(optional) number[=0] Animation duration in ms **Returns** * Promise\ ## `transformation.enable([duration])` {#transformation-enable} Enable the transformation over the specified amount of time. **Arguments** * duration(optional) number[=0] Animation duration in ms **Returns** * Promise\ ## `transformation.getId()` {#transformation-getid} Returns the id of the transformation, a unique strictly positive integer. **Returns** * number ## `transformation.getIndex()` {#transformation-getindex} Retrieves the index of the transformation in the pipeline. **Returns** * number ## `transformation.getName()` {#transformation-getname} Returns the name of the transformation. **Returns** * "node-filter"|"edge-filter"|"node-grouping"|"edge-grouping" ## `transformation.isEnabled()` {#transformation-isenabled} Returns true if the transformation is currently enabled **Returns** * boolean ## `transformation.refresh()` {#transformation-refresh} Refresh the transformation. **Returns** * Promise\ ## `transformation.setIndex(index)` {#transformation-setindex} Set the index of the transformation in the pipeline. The transformation with the lower index is applied first, the one with the higher index is applied last. **Arguments** * index **Returns** * Promise\ ## `transformation.setOptions(index)` {#transformation-setoptions} Set the index of the transformation in the pipeline. The transformation with the lower index is applied first, the one with the higher index is applied last. **Arguments** * index **Returns** * Promise\ ## `transformation.toggle([duration])` {#transformation-toggle} Toggle the transformation over the specified amount of time. **Arguments** * duration(optional) number[=0] Animation duration in ms **Returns** * Promise\ ## `transformation.whenApplied()` {#transformation-whenapplied} Returns a Promise that resolves the first time the transformation is applied. **Returns** * Promise\ ## `NodeAttributes` {#nodeattributes} **Type:** object **Properties** * badges(optional) object * bottomLeft(optional) [Badge](/api/types/badge) * bottomRight(optional) [Badge](/api/types/badge) * topLeft(optional) [Badge](/api/types/badge) * topRight(optional) [Badge](/api/types/badge) * color(optional) [Color](/api/types/color)|Array\<[Color](/api/types/color)\>[="grey"] Color of the node * detectable(optional) boolean[=true] Indicates if the node is detectable by the mouse. * draggable(optional) boolean[=true] Indicates if the node is draggable by the user * halo(optional) object|[Color](/api/types/color)|null If not an object, alias for `halo.color` * color(optional) [Color](/api/types/color)[=null] Color of the halo * hideNonAdjacentEdges(optional) boolean[=false] If true, the halo hides edges which don't have at least one extremity with `halo.hideNonAdjacentEdges` to `true`. * scalingMethod(optional) [ScalingMethod](/api/types/scalingmethod)[="fixed"] Indicates if the halo width should be multiplied by the zoom when the node is displayed. * strokeColor(optional) [Color](/api/types/color)[=null] Color of the stroke of the halo * strokeWidth(optional) [PixelSize](/api/types/pixelsize)[=1] Width of the stroke of the halo * width(optional) [PixelSize](/api/types/pixelsize)[=50] Width of the halo, in pixels * icon(optional) object|[TextContent](/api/types/textcontent) If not an object, alias for `icon.content` * color(optional) [Color](/api/types/color)[="black"] Color used to display the icon text * content(optional) [TextContent](/api/types/textcontent) Text to display inside the icon * font(optional) string[="Arial"] Font used to display the icon text * minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the icon will not be shown * scale(optional) number[=0.7] Text size relative to the node diameter * style(optional) [FontStyle](/api/types/fontstyle)[="normal"] Style applied to the icon. * image(optional) object|string|null If not an object, alias for `image.url` * fit(optional) boolean[=true] Indicates if the image should be rescaled to fit the node * minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the image will not be shown * scale(optional) number[=1] Size of the image relative to the node diameter * tile(optional) boolean[=false] If the image is smaller than the node, indicates if the image should be duplicated to fill the node. If true, `fit` will be considered to be `false`. * url(optional) string|null[=null] URL of the image to display * innerStroke(optional) object|[Color](/api/types/color)|"inherit" If not an object, alias for `innerStroke.color` * color(optional) [Color](/api/types/color)|"inherit"[="white"] Color of the node's inner stroke * minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the inner stroke will not be shown * scalingMethod(optional) [ScalingMethod](/api/types/scalingmethod)[="fixed"] Indicates if the inner stroke width should be multiplied by the zoom when the node is displayed. * width(optional) [PixelSize](/api/types/pixelsize)[=2] Width of the node's inner stroke * layer(optional) [LayerValue](/api/types/layervalue)[=0] Z-index of the node. Integer value between 1 and 3. * layoutable(optional) boolean[=true] Indicates if the node movable by the layout algorithm Some of the layouts (ForceLink) would take the non-movable nodes into account by making other nodes avoid them, others would just ignore them in calculations. * opacity(optional) [OpacityValue](/api/types/opacityvalue)[=1] Opacity of the node. * outerStroke(optional) object|[Color](/api/types/color)|"inherit" If not an object, alias for `outerStroke.color` * color(optional) [Color](/api/types/color)|"inherit"[=null] Color of the node's outer stroke * minVisibleSize(optional) number[=0] If the node diameter on screen is less than this value, the outer stroke will not be shown * scalingMethod(optional) [ScalingMethod](/api/types/scalingmethod)[="fixed"] Indicates if the outer stroke width should be multiplied by the zoom when the node is displayed. * width(optional) [PixelSize](/api/types/pixelsize)[=5] Width of the node's outer stroke * outline(optional) object|boolean If not an object, alias for `outline.enabled` * color(optional) [Color](/api/types/color)[="rgba(0, 0, 0, 0.36)"] Color of the outline * enabled(optional) boolean[=false] Indicates if the outline should be visible * minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the outline will ne be shown * pulse(optional) object|null * duration(optional) number[=1000] Lifespan of one pulse ripple (milliseconds). * enabled(optional) boolean[=false] If true, shows animated pulse around the node. * endColor(optional) [Color](/api/types/color)[="rgba(0, 0, 0, 0)"] End color of the pulse * endRatio(optional) number[=2] Where the pulse ends, relative to the node size (2 = 2x size of the node) * interval(optional) number[=800] Interval between two pulses (milliseconds). * startColor(optional) [Color](/api/types/color)[="rgba(0, 0, 0, 0.6)"] Starting color of the pulse * startRatio(optional) number[=1] Where the pulse starts, relative to the node size (1 = at the node's border) * width(optional) number[=50] Width of the pulse in pixels * radius(optional) [PixelSize](/api/types/pixelsize)[=5] Indicates the radius of the node (graph size) * scalingMethod(optional) [ScalingMethod](/api/types/scalingmethod)[="scaled"] Indicates if the radius should be multiplied by the zoom when the node is displayed. * shape(optional) [NodeShape](/api/types/nodeshape)[="circle"] Shape of the node * text(optional) object|[TextContent](/api/types/textcontent) If not an object, alias for `text.content` * align(optional) [TextAlign](/api/types/textalign)[="center"] Alignment of the text (for multi-line texts) * backgroundColor(optional) [Color](/api/types/color)|"inherit"|null[=null] Background color of the text * color(optional) [Color](/api/types/color)|"inherit"[="black"] Color of the text * content(optional) [TextContent](/api/types/textcontent)[=null] Text to display * font(optional) string[="Arial"] Font used to display the text * margin(optional) [PixelSize](/api/types/pixelsize)[=10] Additional space (in pixels) between the node and the text * maxLineLength(optional) number[=0] If > 1, lines that have more characters than this value will be split across multiple lines. Affects both primary and secondary texts. * minVisibleSize(optional) number[=24] If the node diameter on screen is less than this value, the text will not be shown * padding(optional) [PixelSize](/api/types/pixelsize)[=2] Space between the text and its background's edge, in pixels * position(optional) "right"|"left"|"top"|"bottom"|"center"[="bottom"] Position of the text relative to the node * scale(optional) number[=0.1] Text size relative to the node diameter * scaling(optional) boolean[=false] Indicates if the `size` property (false) or the `scale` property (true) must be used to compute the text size. Affects both primary and secondary text. * secondary(optional) object|[TextContent](/api/types/textcontent) If not an object, alias for `text.secondary.content` * align(optional) [TextAlign](/api/types/textalign)[="center"] Alignment of the secondary text (for multi-line texts) * backgroundColor(optional) [Color](/api/types/color)|"inherit"|null[=null] Background color of the secondary text * color(optional) [Color](/api/types/color)|"inherit"[="black"] Color of the secondary text * content(optional) [TextContent](/api/types/textcontent)[=null] Secondary text content. The secondary text is always displayed below the node. * font(optional) string[="Arial"] Font used to display the secondary text * margin(optional) [PixelSize](/api/types/pixelsize)[=2] Space (in pixels) on top of the secondary text. * minVisibleSize(optional) number[=24] If the node diameter on screen is less than this value, the secondary text will not be shown * padding(optional) [PixelSize](/api/types/pixelsize)[=2] Space (in pixels) between the text and its background's edge * scale(optional) number[=0.08] Secondary text size (relative to the node diameter) * size(optional) [PixelSize](/api/types/pixelsize)[=10] Secondary text size (in pixels) * style(optional) [FontStyle](/api/types/fontstyle)[="normal"] Secondary text style * size(optional) [PixelSize](/api/types/pixelsize)[=12] Text size (in pixels) * style(optional) [FontStyle](/api/types/fontstyle)[="normal"] Style applied to the text * tip(optional) boolean[=true] Indicates if the margin between the text and the background should be filled with a small arrow pointing towards the node * x(optional) number[=0] X coordinate of the node (graph space) * y(optional) number[=0] Y coordinate of the node (graph space) ## `EdgeAttributes` {#edgeattributes} **Type:** object Default values indicate the system values (when an edge has not been assigned any value for that attribute). **Properties** * adjustAnchors(optional) boolean[=true] If true, the edge's extremities' badges and shape will be taken into account when displaying it. Edges that ends with an arrow will stop at the node's badge/corner. * color(optional) [Color](/api/types/color)|"source"|"target"[="grey"] Color of the edge * detectable(optional) boolean[=true] Indicates if the edge is detectable by the mouse. * halo(optional) object|[Color](/api/types/color) If not an object, alias to `halo.color` * color(optional) [Color](/api/types/color)[=null] Color of the halo * scalingMethod(optional) [ScalingMethod](/api/types/scalingmethod)[="fixed"] Indicates if the halo width should be multiplied by the zoom when the edge is displayed. * width(optional) [PixelSize](/api/types/pixelsize)[=10] Width of the halo, in pixels * layer(optional) [LayerValue](/api/types/layervalue)[=0] Z-index of the node. Integer value between -1 and 3. * minVisibleSize(optional) number[=0] If the edge width on screen is less than this value, it will not be displayed * opacity(optional) [OpacityValue](/api/types/opacityvalue)[=1] Opacity of the edge. 0 = transparent, 1 = opaque. * outline(optional) object|boolean If not an object, alias to `outline.enabled` * color(optional) [Color](/api/types/color)[="rgba(0, 0, 0, 0.36)"] Color of the outline * enabled(optional) boolean[=false] Indicates if the outline should be visible * minVisibleSize(optional) number[=0] If the edge width on screen is less than this value, the outline will ne be shown * pulse(optional) object * duration(optional) number[=1000] Lifespan of one pulse ripple (milliseconds). * enabled(optional) boolean[=false] If true, shows animated pulse around the edge. * endColor(optional) [Color](/api/types/color)[="rgba(0, 0, 0, 0)"] End color of the pulse * endRatio(optional) number[=2] Where the pulse ends, relative to the edge width (2 = 2x width of the edge) * interval(optional) number[=800] Interval between two pulses (milliseconds). * startColor(optional) [Color](/api/types/color)[="rgba(0, 0, 0, 0.6)"] Starting color of the pulse * startRatio(optional) number[=1] Where the pulse starts, relative to the edge width (1 = at the edge border) * width(optional) number[=50] Width of the pulse in pixels * scalingMethod(optional) [ScalingMethod](/api/types/scalingmethod)[="scaled"] Indicates if the edge width should be multiplied by the zoom when the edge is displayed. * shape(optional) object|[PredefinedEdgeShape](/api/types/predefinededgeshape) * body(optional) [EdgeType](/api/types/edgetype)[="line"] Shape of the edge * head(optional) [EdgeExtremity](/api/types/edgeextremity)[=null] Head of the edge * style(optional) [EdgeStyle](/api/types/edgestyle)[="plain"] Style of the edge * tail(optional) [EdgeExtremity](/api/types/edgeextremity)[=null] Tail of the edge * stroke(optional) object * color(optional) [Color](/api/types/color)|"inherit"[="inherit"] Color of the edge stroke. If it is "inherit", uses the same color as for the body. * minVisibleSize(optional) number[=0] If the edge width on screen is less than this value, the stroke will not be displayed * width(optional) [PixelSize](/api/types/pixelsize)[=0] Stroke width, in pixels. * strokeWidth(optional) [PixelSize](/api/types/pixelsize) Alias for `stroke.width` * text(optional) object|[TextContent](/api/types/textcontent) If not an object, alias to `text.content` * adjustAngle(optional) boolean[=true] In case the edge is shorter than the text, indicates if the text should be displayed horizontally. Only works for non-scaled texts. * align(optional) [TextAlign](/api/types/textalign)[="center"] Alignment of the text (for multi-line texts) * backgroundColor(optional) [Color](/api/types/color)|"inherit"[=null] Background color of the text * color(optional) [Color](/api/types/color)[="black"] Color of the text * content(optional) [TextContent](/api/types/textcontent)[=null] Text to display * font(optional) string[="Arial"] Font used to display the text * margin(optional) [PixelSize](/api/types/pixelsize)[=2] Space between the text and the edge, in pixels. Ignored if `text.position` is "centered". * maxLineLength(optional) number[=0] If > 1, lines that have more characters than this value will be split across multiple lines. Affects both primary and secondary texts. * minVisibleSize(optional) [PixelSize](/api/types/pixelsize)[=4] If the edge width on screen is less than this value, the text will not be shown * padding(optional) [PixelSize](/api/types/pixelsize)[=2] Space between the text and its background's edge, in pixels * position(optional) [EdgeTextPosition](/api/types/edgetextposition)[="shifted"] Text position relative to the edge: centered or shifted. Centered places the text on top of the edge and ignores margin * scale(optional) number[=1] Text size relative to the edge width * scaling(optional) boolean[=false] Indicates if the `size` property (false) or the `scale` property (true) must be used to compute the text size * secondary(optional) object|[TextContent](/api/types/textcontent) If not an object, alias to `text.secondary.content` * align(optional) [TextAlign](/api/types/textalign)[="center"] Alignment of the secondary text (for multi-line texts) * backgroundColor(optional) [Color](/api/types/color)|"inherit"[=null] Background color of the secondary text * color(optional) [Color](/api/types/color)[="black"] Color of the secondary text * content(optional) [TextContent](/api/types/textcontent)[=null] Text to display under the primary text * font(optional) string[="Arial"] Font used to display the secondary text * margin(optional) [PixelSize](/api/types/pixelsize)[=2] Space between the secondary text and the edge * minVisibleSize(optional) [PixelSize](/api/types/pixelsize)[=4] If the edge width on screen is less than this value, the secondary text will not be shown * padding(optional) [PixelSize](/api/types/pixelsize)[=2] Space between the secondary text and its background's edge, in pixels * scale(optional) number[=0.8] Secondary text size (relative to the edge width) * size(optional) [PixelSize](/api/types/pixelsize)[=12] Secondary text size (in pixels) * style(optional) [FontStyle](/api/types/fontstyle)[="normal"] Secondary text style * size(optional) [PixelSize](/api/types/pixelsize)[=12] Text size (in pixels) * style(optional) [FontStyle](/api/types/fontstyle)[="normal"] Style applied to the text * width(optional) [PixelSize](/api/types/pixelsize)[=1] Width of the edge (graph space) ## `AdjacencyOptions` {#adjacencyoptions} **Type:** object **Properties** * options(optional) * bothExtremities(optional) boolean[=false] Relevant only for `getAdjacentEdges`. If `true`, only edges for which both extremities are in the `NodeList` are retrieved. * direction(optional) "both"|"in"|"out"[="both"] Direction of the edges to follow. * filter(optional) [Filter](/api/types/filter)[="visible"] Indicates what kind of elements should be retrieved. * policy(optional) "union"|"include-sources"|"exclude-sources"[="union"] If "include-sources", the source node(s) will be added to the result. If "exclude-sources", the source node(s) will be removed from the result. If "union", the result is not modified. This parameter is ignored when retrieving adjacent edges. ## `AttributeAnimationOptions` {#attributeanimationoptions} **Type:** object|number If a number is specified, it specifies the `duration` property. **Properties** * duration(optional) number[=0] Indicates the duration of the attribute transition, in milliseconds. * easing(optional) [Easing](/api/types/easing)[="linear"] Indicates the animation easing ## `Badge` {#badge} **Type:** object Node badge attributes **Properties** * color(optional) [Color](/api/types/color)[="white"] Fill color of the badge. * image(optional) object|null|string If not an object, alias to `image.url` * scale(optional) number[=1] Size of the image relative to the badge diameter * url(optional) null|string[=null] URL of the image to display in the badge * minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the badge will not be displayed * positionScale(optional) number[=1] Center of the badge relative to the node size (1 = at the node's border) * scale(optional) number[=0.45] Size of the badge relative to the node. * stroke(optional) object * color(optional) [Color](/api/types/color)|"inherit"[="black"] Color of the badge stroke * scalingMethod(optional) [ScalingMethod](/api/types/scalingmethod)[="fixed"] Indicates if the badge width should be multiplied by the zoom when the node is displayed. * width(optional) [PixelSize](/api/types/pixelsize)[=2] Width of the badge stroke * text(optional) object|[TextContent](/api/types/textcontent) If not an object, alias for `text.content` * color(optional) "inherit"|[Color](/api/types/color)[="black"] Color of the badge text * content(optional) [TextContent](/api/types/textcontent)[=null] Text to display in the badge * font(optional) string[="Arial"] Font to use for the badge text * paddingLeft(optional) number[=0] Horizontal padding of the text inside the badge * paddingTop(optional) number[=0] Vertical padding of the text inside the badge * scale(optional) number[=0.5] Size of the text relative to the badge diameter * style(optional) [FontStyle](/api/types/fontstyle)[="normal"] Style applied to the badge text ## `BadgeText` {#badgetext} **Type:** object **Properties** * color(optional) "inherit"|[Color](/api/types/color)[="black"] Color of the badge text * content(optional) [TextContent](/api/types/textcontent)[=null] Text to display in the badge * font(optional) string[="Arial"] Font to use for the badge text * paddingLeft(optional) number[=0] Horizontal padding of the text inside the badge * paddingTop(optional) number[=0] Vertical padding of the text inside the badge * scale(optional) number[=0.5] Size of the text relative to the badge diameter * style(optional) [FontStyle](/api/types/fontstyle)[="normal"] Style applied to the badge text ## `BaseMapOptions` {#basemapoptions} **Type:** object Options for the base layer of the map in geo mode. **Properties** * BaseMapOptions(optional) * subdomains(optional) string[='abc'] Format of the URL used to search for tiles. * tms(optional) boolean[=false] Useful when using a `TMS` service. * url(optional) string Format of the URL used to search for tiles. Must contain `'{z}'` (zoom level of the tile), `'{x}'` and `'{y}'` (coordinates of the tile). Possible `'{s}'` (replaced by one of the characters in the `tileUrlSubdomains` setting). Possible `'{r}'` for tile servers who support retina tiles. * wms(optional) boolean[=false] Useful when using a `WMS` service. For custom WMS parameters the [Leaflet WMS TileLayer](https://leafletjs.com/reference-1.5.0.html#tilelayer-wms-options) options can be used as reference for additional parameters to be set ## `BetweennessOptions` {#betweennessoptions} **Type:** object **Properties** * directed (optional) boolean[=false] If true, the algorithm will take account of the edge directions. * edges(optional) [EdgeList](/api/edgelist)\ Edges to take in account while computing the betweenness. All visible edges by default. * nodes(optional) [NodeList](/api/nodelist)\ Nodes to compute the betweenness on. All visible nodes by default. * normalized(optional) boolean[=true] If true, will normalize the values within [0;1] ## `BoundingBox` {#boundingbox} **Type:** object **Properties** * computeForZoom function(zoom: number):[BoundingBox](/api/types/boundingbox) Method to include the maximum item sizes to compute the real boundaries at the selected zoom level * cx number X coordinate of the center of the bounding box * cy number Y coordinate of the center of the bounding box * height number Height of the bounding box * maxFixedSize number Maximum fixed size of the elements used to compute the bounding box * maxScaledSize number Maximum scaled size of the elements used to compute the bounding box * maxX number Maximum X coordinate of the bounding box * maxY number Maximum Y coordinate of the bounding box * minFixedSize number Minimum fixed size of the elements used to compute the bounding box * minScaledSize number Minimum scaled size of the elements used to compute the bounding box * minX number Minimum X coordinate of the bounding box * minY number Minimum Y coordinate of the bounding box * pad function(value: number):[BoundingBox](/api/types/boundingbox) Extends the bounding box by value on every direction * width number Width of the bounding box ## `BrandOptions` {#brandoptions} **Type:** object **Properties** * className(optional) string If specified, this class will be added to the HTML created HTML element. * horizontalMargin(optional) number[=0] Indicates the space in pixels between the brand and the top/bottom of the screen (depending on the position) * position(optional) "top-left"|"top-right"|"bottom-left"|"bottom-right"[="bottom-right"] Indicates the position of the brand. * verticalMargin(optional) number[=0] Indicates the space in pixels between the brand and the right/left of the screen (depending on the position) ## `CameraAnimationOptions` {#cameraanimationoptions} **Type:** object **Properties** * duration(optional) number[=0] Duration of the animation, in milliseconds. * easing(optional) [EasingFunction](/api/types/easingfunction)[="linear"] Easing used by the animation. * ignoreZoomLimits(optional) boolean[=false] If `false`, the options `interactions.zoom.minValue` and `interactions.zoom.maxValue` are ignored. * startAfter(optional) number[=0] Advanced usage. Number from 0 to 1 indicating after which percentage of the duration the animation must be started. For example, specifying 0.5 would cause the animation to start after half of its total duration, and to be played two times faster as a consequence. ## `CanvasLayer` {#canvaslayer} **Type:** object The layer object containing its properties (overloaded for handling canvas). **Properties** * destroy () =\> [CanvasLayer](/api/types/canvaslayer) Destroy the layer (remove it from the layer array, remove its listeners). * element HTMLElement HTML element used by the layer. * getLevel () =\> number Retrieves the index of the layer in the layer array. * getOpacity () =\> number Get the layer opacity, between 0 and 1. * hide () =\> [CanvasLayer](/api/types/canvaslayer) Keep the layer in the layer array but hide its content. * isHidden () =\> boolean Check the layer visibility. * moveDown () =\> [CanvasLayer](/api/types/canvaslayer) Take the layer down a notch (decreases its index by 1). * moveTo (depth: number) =\> [CanvasLayer](/api/types/canvaslayer) Move the layer to the specified index in the layer array. * moveToBottom () =\> [CanvasLayer](/api/types/canvaslayer) Move the layer at the very bottom of the array (index `0`). * moveToTop () =\> [CanvasLayer](/api/types/canvaslayer) Move the layer at the very top of the array (index `length - 1`). * moveUp () =\> [CanvasLayer](/api/types/canvaslayer) Take the layer up a notch (increases its index by 1). * refresh [DrawingFunction](/api/types/drawingfunction) Function rerendering the canvas. * setOpacity (opacity: number) =\> [CanvasLayer](/api/types/canvaslayer) Set the layer opacity. * show () =\> [CanvasLayer](/api/types/canvaslayer) Show the layer content. ## `CanvasLayerOptions` {#canvaslayeroptions} **Type:** object Canvas layer options. **Properties** * isStatic(optional) boolean[=false] Is the canvas sync with the view ? * noClear(optional) boolean[=false] No clearing is executed before each draw call. ## `Color` {#color} **Type:** null|string CSS color name (e.g `"red"`), `"transparent"`, rgb(a) notation (e.g: `"rgb(128, 128, 128)"` or `"rgba(128, 128, 128, 0.2)"`), hexadecimal notation (e.g: `"#FFFFFF"`) or `null` (transparent). ## `CrossOriginValue` {#crossoriginvalue} **Type:** "anonymous"|"use-credentials"|null ## `CursorStyle` {#cursorstyle} **Type:** string CSS value which will be assigned to the cursor. List of available values [here](https://developer.mozilla.org/en/docs/Web/CSS/cursor). ## `Dependency` {#dependency} **Type:** object|true `true` indicates that the rule/class depends on the existence of the node(s)/edge(s), but not on their attributes **Properties** * attributes(optional) "all"|Array\<[PropertyPath](/api/types/propertypath)\> List of attributes the rule/class depends on * data(optional) boolean Indicates if the result of the rule is based on the node/edge's data * hover(optional) boolean Indicates if the result of the rule changes depending on whether the node/edge is hovered or not * selection(optional) boolean Indicates if the result of the rule changes depending on whether the node/edge is selected or not ## `DrawingFunction` {#drawingfunction} **Type:** (ctx: CanvasRenderingContext2D) =\> void The function drawing on the canvas in the graph space. ## `DrillDownOptions` {#drilldownoptions} **Type:** object **Properties** * copyData(optional) boolean[=true] If true, the data of the open node will be copied into the group replacing it. * depthPath(optional) string[="depth"] Data path in the node that contains the depth of the node. * duration(optional) number Animation time in milliseconds. The animation will be played once after the creation of the group. Ignored if `enabled` is false. * easing(optional) [EasingFunction](/api/types/easingfunction)[="quadraticOut"] Grouping animation easing function. * nodeGenerator(optional) function(nodes: [NodeList](/api/nodelist), groupId: string, transformation: [Transformation](/api/transformation)): [NodeDataAndAttributes](/api/types/nodedataandattributes) See nodeGrouping [nodeGenerator]{@link types/nodegroupingoptions}. * onGetSubgraph function(node: [Node](/api/node)): Promise\<[RawGraph](/api/types/rawgraph)\> Function that should return a promise that resolves with the subgraph inside the group. * onGroupUpdate(optional) function(metaNode: [Node](/api/node), subNodes: [NodeList](/api/nodelist), isOpen: boolean): [SubLayout](/api/types/sublayout) Callback to run a layout over the content of an open group. It should return a promise that resolves when the layout is done, or a Promise containing an array of positions for each node in the group. * padding(optional) number|function(metaNode: [Node](/api/node), depth: number): number Padding applied to groups showing their content. If a function is passed, each MetaNode will get a padding depending on that function. * parentPath(optional) string[="parent"] Data path in the node that contains the id of the parent node. * showContents(optional) function(metaNode: [Node](/api/node), depth: number): boolean | boolean Function that would define if the contents of the group node should be hidden or not. This is called on every transformation update. ## `Easing` {#easing} **Type:** "linear"|"quadraticIn"|"quadraticOut"|"quadraticInOut"|"cubicIn"|"cubicOut"|"cubicInOut" ## `EasingFunction` {#easingfunction} **Type:** "linear"|"quadraticIn"|"quadraticOut"|"quadraticInOut"|"cubicIn"|"cubicOut"|"cubicInOut"|function(x: number): number ## `EdgeAttributesValue` {#edgeattributesvalue} **Type:** object Object following the same structure as [`EdgeAttributes`](/api/types/edgeattributes), with the addition that each property can be replaced by a function that return a value for this property (or an object if the property has multiple nested sub-properties). When working with a large number of nodes/edges, avoid as much as possible the usage of functions. ## `EdgeCollection` {#edgecollection} **Type:** [Edge](/api/edge)|[EdgeList](/api/edgelist)|[EdgeId](/api/types/edgeid)|Array\<[Edge](/api/edge)|[EdgeId](/api/types/edgeid)\> ## `EdgeDataAndAttributes` {#edgedataandattributes} **Type:** object **Properties** * attributes(optional) [EdgeAttributes](/api/types/edgeattributes) * data(optional) any * id(optional) [EdgeId](/api/types/edgeid) ## `EdgeDependencies` {#edgedependencies} **Type:** object|null If `null`, indicates that the edge attributes defined by the rule/class does not depend on any attribute of any node/edge. If unspecified, the `self`, `extremities` and `parallelEdges` fields are treated as `{attributes: "all", data: true, selection: true, hover: false}`, and the `allNodes` and `allEdges` fields are treated as `null`. **Properties** * allEdges(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that edge should be updated when the specified attributes of any edge change * allNodes(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that edge should be updated when the specified attributes of any node change * extremities(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that edge should be updated when the specified attributes of the edge's extremities change * parallelEdges(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that edge should be updated when the specified attributes of the node's parallel edges change * self(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that edge should be updated when the specified attributes of the edge change ## `EdgeDirection` {#edgedirection} **Type:** "both"|"in"|"out" ## `EdgeExtremity` {#edgeextremity} **Type:** null|"arrow"|"circle-hole-arrow"|"triangle-hole-arrow"|"short-arrow"|"sharp-arrow"|"circle"|"square" ## `EdgeFilterOptions` {#edgefilteroptions} **Type:** object **Properties** * options * criteria function(edge: [Edge](/api/edge)): boolean * duration(optional) number[=0] Duration of the filtering animation. When filtering is animated, edges are gradually faded, before disappearing completely. Ignored if `enabled` is false. * enabled(optional) boolean[=true] Indicates if the filter must be enabled. * easing(optional) [EasingFunction](/api/types/easingfunction)[="quadraticOut"] Fading animation easing function. ## `EdgeGroupingOptions` {#edgegroupingoptions} **Type:** object **Properties** * duration(optional) number Animation time in milliseconds. The animation will be played once after the creation of the group. Ignored if `enabled` is false. * easing(optional) [EasingFunction](/api/types/easingfunction)[="quadraticOut"] Grouping animation easing function. * enabled(optional) boolean Indicates if the edge grouping must be enabled. * generator(optional) function(edges: [EdgeList](/api/edgelist), groupId: string, source: [Node](/api/node), target: [Node](/api/node), transformation: [Transformation](/api/transformation)): [EdgeDataAndAttributes](/api/types/edgedataandattributes)| null Given a list of edges that should be grouped together, must return the new edge (meta-edge) to be added. Returning null means that the edges should not be grouped. * groupIdFunction(optional) function(edge: [Edge](/api/edge)): string|undefined Given an edge, must return a string identifying a group. All edges that are parallel and for which the function returns the same value will be grouped together. By default matches all the edges that are parallel together. The returned string will be used as prefix of the final id. Returning `undefined` means that the edge should not be grouped. * selector(optional) function(edge: [Edge](/api/edge)): boolean Only edges that match this criteria will be grouped with other edges. By default, all the edges will be assigned a group. * separateEdgesByDirection(optional) boolean By default, edges that have opposite source and target are grouped together (resulting source and target not deterministic). If this option is `true`, they will not be grouped together. ## `EdgeId` {#edgeid} **Type:** string|number ## `EdgeOutput` {#edgeoutput} **Type:** object|null If unspecified, the assigned attributes are inferred to the best possible extent from the `EdgeAttributesValue` value. **Properties** * attributes(optional) "all"|Array\<[PropertyPath](/api/types/propertypath)\> List of edge attributes assigned by the rule/class ## `EdgeSelector` {#edgeselector} **Type:** null|function(edge: [Edge](/api/edge)): boolean Used to indicate if a style rule should be applied to a given edge. `null` is equivalent to a function that always returns true. ## `EdgeSelector` {#edgeselector} **Type:** null|function(edge: [Edge](/api/edge)): boolean Used to indicate if a style rule should be applied to a given edge. `null` is equivalent to a function that always returns true. ## `EdgeStyle` {#edgestyle} **Type:** "plain"|"dotted"|"dashed" ## `EdgeTextPosition` {#edgetextposition} **Type:** "shifted"|"centered" ## `EdgeType` {#edgetype} **Type:** "line"|"triangle" ## `EdgesRoutingStyle` {#edgesroutingstyle} **Type:** 'horizontal' | 'vertical' | 'none' Routing direction for curved edges ## `Filter` {#filter} **Type:** "visible"|"raw"|"all" Indicates which nodes and edges to take into account. "visible" refers to visible element, "raw" refers to elements that are not the result of a transformation (the "original" graph), and "all" refers to all elements, including the non-visible ones. ## `FilterOptionDuringAction` {#filteroptionduringaction} **Type:** object ## `FontStyle` {#fontstyle} **Type:** "normal"|"bold"|"italic" ## `GeoClusteringOptions` {#geoclusteringoptions} **Type:** object **Properties** * edgeGenerator(optional) function(edges: [EdgeList](/api/edgelist), groupId: string, transformation: [Transformation](/api/transformation)): [EdgeDataAndAttributes](/api/types/edgedataandattributes)|null If `groupEdges` is `true`, indicates the function used to generate the new edges from the sub-edges. Ignored if `groupEdges` is `false`. If returned `null`, the meta edge will not be created. * enabled(optional) boolean Indicates if the grouping must be enabled. * groupEdges(optional) boolean Indicates if parallel edges that end up having at least one meta-node extremity should be grouped together (to reduce cluttering). * groupIdFunction(optional) function(node: [Node](/api/node)): string|undefined Given a node, must return a string identifying a group. All nodes for which the function returns the same value will be grouped together. By default group all the nodes that were selected together. * groupSelfLoopEdges(optional) boolean If true, edges for which the two extremities end up being grouped into the same node will be displayed as a self-loop edge, instead of not being displayed at all. * nodeGenerator(optional) function(nodes: [NodeList](/api/nodelist), groupId: string, transformation: [Transformation](/api/transformation)): [NodeDataAndAttributes](/api/types/nodedataandattributes)|null Given a list of nodes that should be grouped together, must return the new node (meta-node) to be added. The latitude and longitude of the meta-node will be the average of the latitude and longitude of the nodes. If `null` is returned, the meta-node will not be created. * onCreated(optional) function(metaNode: [Node](/api/node), showContents: boolean, subNodes: [NodeList](/api/nodelist), subEdges: [EdgeList](/api/edgelist)): Promise\ This is a callback called after a new group is created. See {@link ./tutorials/grouping/index.html | here} for more details. * radius(optional) number The radius in which a node gets grouped to annother one. * selector(optional) function(node: [Node](/api/node)): boolean Only nodes that match this criteria will be grouped with other nodes. By default, all the nodes will be assigned a group. * separateEdgesByDirection(optional) boolean By default, edges that have opposite source and target are grouped together (resulting source and target not deterministic). If this option is `true`, they will not be grouped together. ## `GeoCoordinate` {#geocoordinate} **Type:** object Geographical coordinates, latitude and longitude. **Properties** * latitude number Latitude (degrees) * longitude number Longitude (degrees) ## `GeoModeOptions` {#geomodeoptions} **Type:** object **Properties** * attribution(optional) string[='Map data (c) OpenStreetMap contributors'] HTML string that will be displayed on the corner, indicates the source of the tiles. * attributionOptions(optional) [BrandOptions](/api/types/brandoptions) Position and options for the attribution message * backgroundColor(optional) [Color](/api/types/color)[='silver'] Color of the map background (color of the missing tiles). * crs(optional) CRS[=L.CRS.EPSG3857] This parameter controls the Coordinate Reference System used for the map projection. Usually you do not need to change it, unless you need custom projections. For more information see the [Leaflet CRS documentation](https://leafletjs.com/reference-1.5.0.html#crs). * disableNodeDragging(optional) boolean[=true] Disable node dragging when the mode is on. Dragging is disabled by default, because geo mode is not scale-free. * duration(optional) number[=0] Duration of the transition when swapping mode. * latitudePath(optional) [PropertyPath](/api/types/propertypath)[='latitude'] Node path which contains the latitude. * longitudePath(optional) [PropertyPath](/api/types/propertypath)[='longitude'] Node path which contains the longitude. * maxZoomLevel(optional) number[=20] Maximum geo-spatial zoom. * minZoomLevel(optional) number[=1] Minimum geo-spatial zoom. * opacity(optional) number[=1] Map baselayer opacity * sizeRatio(optional) number[=1] Multiplier for the node radius an edge width. * tileBuffer(optional) number[=2] Number of extra tiles to be downloaded around the viewport bounds, to make the panning smoother. Deprecated: this is automatically handled now, alternatively, you can pass this to the `tiles` together with the [`L.TileLayer` options](https://leafletjs.com/reference-1.5.0.html#gridlayer-keepbuffer). * tileUrlSubdomains(optional) string[='abc'] Values with which the '{s}' string in the URL can be replaced. Deprecated, use `tiles.subdomains` instead. * tileUrlTemplate(optional) string[='https://{s}.tile.osm.org/{z}/{x}/{y}.png'] Format of the URL used to search for tiles. Must contain `'{z}'` (zoom level of the tile), `'{x}'` and `'{y}'` (coordinates of the tile). Possible `'{s}'` (replaced by one of the characters in the `tileUrlSubdomains` setting). Possible `'{r}'` for tile servers who support retina tiles. Deprecated: use `tiles.url` now. * tiles(optional) object|L.[Layer](/api/types/layer) In addition to the following list, this object supports also [Leaflet TileLayer Options](https://leafletjs.com/reference-1.5.0.html#tilelayer-options) and [Leaflet WMS TileLayer Options](https://leafletjs.com/reference-1.5.0.html#tilelayer-wms-options) options * subdomains(optional) string[='abc'] Format of the URL used to search for tiles. * tms(optional) boolean[=false] Useful when using a `TMS` service. * url(optional) string[='https://{s}.tile.osm.org/{z}/{x}/{y}.png'] Format of the URL used to search for tiles. Must contain `'{z}'` (zoom level of the tile), `'{x}'` and `'{y}'` (coordinates of the tile). Possible `'{s}'` (replaced by one of the characters in the `tileUrlSubdomains` setting). Possible `'{r}'` for tile servers who support retina tiles. * wms(optional) boolean[=false] Useful when using a `WMS` service. For custom WMS parameters the [Leaflet WMS TileLayer](https://leafletjs.com/reference-1.5.0.html#tilelayer-wms-options) options can be used as reference for additional parameters to be set * wrapCoordinates(optional) boolean[=true] Whether to wrap the coordinate to the projection space of [-180, 180] for longitude, [-85, 85] for longitude. If set to false, nodes with coordinates outside of that range will not be shown. ## `GroupLayout` {#grouplayout} **Type:** object **Properties** * groupId [NodeId](/api/types/nodeid) The id of the group to layout. * layout string The name of the layout to apply to the group (force, hierarchical etc). * params object The parametters of the layout to apply. ## `HoverEdgeOptions` {#hoveredgeoptions} **Type:** object Options for the hovered edge. (EdgeAttributesValue + AnimationOptions) You can specify the duration and easing of the hover animation here. ## `HoverNodeOptions` {#hovernodeoptions} **Type:** object Options for the hovered node. (NodeAttributesValue + AnimationOptions) You can specify the duration and easing of the hover animation here. ## `ImageExportOptions` {#imageexportoptions} **Type:** object **Properties** * background(optional) [Color](/api/types/color) Color of the background on the output image * badges(optional) boolean[=true] Whether or not to export badges * clip(optional) boolean[=false] If `true`, export the current view rather than the whole graph * download(optional) boolean[=true] If true, the user will be prompted a modal window so he can download the exported graph. * filename(optional) string[="graph.png"] If `download` is true, the default name for the downloaded file. * filter(optional) "visible"|"all"[="visible"] Indicates what elements to export. * height(optional) number If not specified, the height of the canvas will be used. * imageCrossOrigin(optional) string In case node or badge images are coming from a CDN, set this to 'anonymous' to avoid security errors on export. * imageWatermark(optional) object * alpha(optional) string[=0.65] Transparency of the watermark, from 0 to 1 (0 = fully transparent) * angle(optional) string[=0] Angle of the watermark (in degrees) * height(optional) string If not specified, the original width of the image will be used. * repeat(optional) string[=false] Indicates if the watermark should be repeated over the image * space(optional) string[=50] If repeating the watermark, space in pixels between the repetitions * url(optional) string Url of the image to use as watermark * width(optional) string If not specified, the original width of the image will be used. * x(optional) string X coordinate of the center of the watermark * y(optional) string Y coordinate of the center of the watermark * images(optional) boolean[=true] Whether or not to export images * layers (optional) boolean[=true] Whether to export visible layers or not. Defaults to true * legend(optional) boolean|[LegendOptions](/api/types/legendoptions) If unspecified and the legend is enabled, it will be exported with the current options. If unspecified and the legend is not enabled, it will not be exported. If `false`, the legend will not be exported no matter what. If `true`, the legend will be exported with the default options, whether it's enabled or not. If an object is specified, the legend will be exported with the specified options, whether it's enabled or not. * margin(optional) number[=10] Blank space around the graph (in pixels) * pixelRatio(optional) number Image resolution. Defaults to your screen resolution, so on high-resolution screens the exported image will be scaled up to maintain the resolution. * preventOverlap(optional) boolean[=true] If true, hide texts which overlap, else display labels which are already present on screen * textWatermark(optional) object * alpha(optional) number[=0.65] Transparency of the watermark, from 0 to 1 (0 = fully transparent) * angle(optional) number[=0] Angle of the watermark (in degrees) * content(optional) string Content of the text watermark * fontColor(optional) [Color](/api/types/color)[="red"] Color to use to display the text watermark * fontFamily(optional) string[="Arial"] Font used to display the text watermark * fontSize(optional) number[=48] Size of the text watermark * fontStyle(optional) "bold"|"italic" Style to use to display the text watermark * repeat(optional) boolean[=false] Indicates if the watermark should be repeated over the image * space(optional) number[=50] If repeating the watermark, space in pixels between the repetitions * x(optional) number X coordinate of the center of the watermark * y(optional) number Y coordinate of the center of the watermark * texts(optional) boolean[=true] Whether or not to export texts * width(optional) number If not specified, the width of the canvas will be used. ## `InputSource` {#inputsource} **Type:** "mouse"|"touch" Indicates what kind of source emitted the event. ## `InputTarget` {#inputtarget} **Type:** [Node](/api/node)|[Edge](/api/edge)|null Element that is clicked/hovered. If it's not `null`, you can check if it's a node or an edge with their `isNode` property. ## `InteractionOptions` {#interactionoptions} **Type:** object ## `KeyCode` {#keycode} **Type:** number JavaScript key code. ## `KeyName` {#keyname} **Type:** string Lowercase letter (e.g `"a"`), digit (e.g `"3"`) or `"shift"|"ctrl"|"cmd"|"alt"|"space"|"enter"|"esc"|"del"|"backspace"`. ## `Layer` {#layer} **Type:** object The layer object containing its properties. **Properties** * destroy () =\> [Layer](/api/types/layer) Destroy the layer (remove it from the layer array, remove its listeners). * element HTMLElement HTML element used by the layer. * getLevel () =\> number Retrieves the index of the layer in the layer array. * getOpacity () =\> number Get the layer opacity, between 0 and 1. * hide () =\> [Layer](/api/types/layer) Keep the layer in the layer array but hide its content. * isHidden () =\> boolean Check the layer visibility. * moveDown () =\> [Layer](/api/types/layer) Take the layer down a notch (decreases its index by 1). * moveTo (depth: number) =\> [Layer](/api/types/layer) Move the layer to the specified index in the layer array. * moveToBottom () =\> [Layer](/api/types/layer) Move the layer at the very bottom of the array (index `0`). * moveToTop () =\> [Layer](/api/types/layer) Move the layer at the very top of the array (index `length - 1`). * moveUp () =\> [Layer](/api/types/layer) Take the layer up a notch (increases its index by 1). * setOpacity (opacity: number) =\> [Layer](/api/types/layer) Set the layer opacity. * setPosition (position: {x: number, y: number}) =\> [Layer](/api/types/layer) Setter setting the element translation in the graph space. * setSize (size: {width: number, height: number}) =\> [Layer](/api/types/layer) Setter setting the element size in the graph space. * show () =\> [Layer](/api/types/layer) Show the layer content. ## `LayerValue` {#layervalue} **Type:** number Integer between -1 and 3 (included). By default elements are on the layer 0. Selected elements are on the layer 2. Hovered elements are on the layer 3. ## `LayoutOptions` {#layoutoptions} **Type:** object **Properties** * continuous(optional) boolean[=false] Whether or not the layout should render intermediate steps. * dryRun(optional) boolean[=false] If true, the layout will not be applied to the graph. * duration(optional) number[=300] Duration of the animation when the graph is updated * easing(optional) [Easing](/api/types/easing)[='cubicIn'] Easing function used during the animation * locate(optional) boolean|[LocateOptions](/api/types/locateoptions)[=false] Center on the graph bounding box when the layout is complete. You can also provide padding. * nodes(optional) [NodeId](/api/types/nodeid)[]|[NodeList](/api/nodelist) List of affected nodes. If nothing provided, the whole graph will be used. Where edges param is available and provided, then this list will be augmented with reached nodes from the passed edge list. * onEnd(optional) function(): void Function called after the last graph update * onSync(optional) function(): void Function called every time the graph is updated * skipTextDrawing(optional) boolean[=true] Skip drawing labels during the layout. Improves performance and user experience. * useWebWorker(optional) boolean[=true] Indicates if the layout should be computed inside a web worker. ## `LegendOptions` {#legendoptions} **Type:** object **Properties** * backgroundColor(optional) [Color](/api/types/color)[="white"] Background color of the widgets. * borderColor(optional) [Color](/api/types/color)[="black"] Border color of the widgets. * borderRadius(optional) number[=0] Border radius of the widgets. * borderWidth(optional) number[=1] Border width of the widgets, in pixels. * circleStrokeWidth(optional) number[=3] Stroke width of the circles used to indicate the size of the nodes. * fontColor(optional) [Color](/api/types/color)[="black"] Font color used to display the widgets' content * fontFamily(optional) string[="Arial"] Font used to display the widgets * fontSize(optional) number[=10] Font size used to display the widgets' content * innerMargin(optional) number[=10] Blank space between a widget's border and its content, in pixels. * outerMargin(optional) number[=5] Blank space between two widgets, in pixels. * position(optional) "bottom"|"top"|"left"|"right"[="bottom"] Position of the legend on the canvas. * shapeColor(optional) [Color](/api/types/color)[="grey"] Color used for displaying the widget indicating a node or edge shape * titleFontColor(optional) [Color](/api/types/color)[="black"] Font color used to display the widgets' title * titleFontSize(optional) number[=12] Font size used to display the widgets' title * titleFunction(optional) function(propertyPath: Array\, styleProperty: [PropertyPath](/api/types/propertypath)): string Given a property path, must return the title of the widget which displays information on that property. By default keep the last part of the property path. * titleMaxLength(optional) number[=20] If a widget's title has more characters that this value, it will be truncated * titleTextAlign(optional) "left"|"center"[="left"] Alignment of the widgets' title * widgetWidth(optional) number[=130] Width of a widget, in pixels ## `LocateOptions` {#locateoptions} **Type:** object **Properties** * duration(optional) number[=0] Duration of the camera movement, in milliseconds. * easing(optional) [EasingFunction](/api/types/easingfunction)[="cubicOut"] Easing function applied to the movement of the camera. * ignoreZoomLimits(optional) boolean[=false] If `true`, the options `interactions.zoom.minValue` and `interactions.zoom.maxValue` are ignored. * maxNodeSizeOnScreen(optional) number[=200] Additional restriction on the zoom that makes sure no node is displayed with a diameter greater than this value, in pixels. Set to 0 to disable this feature. * padding(optional) object|number If a number, indicates the padding for the four sides. * bottom(optional) number[=40] Bottom padding (in pixels). * left(optional) number[=40] Left padding (in pixels). * right(optional) number[=40] Right padding (in pixels). * top(optional) number[=40] Top padding (in pixels). ## `MapPosition` {#mapposition} **Type:** object Geo coordinates and zoom level of the map **Properties** * latitude number Latitude (degrees) * longitude number Longitude (degrees) * zoom number Map scale ## `MouseButton` {#mousebutton} **Type:** "left"|"right"|"middle" Identifies a mouse button. ## `NeighborGenerationOptions` {#neighborgenerationoptions} **Type:** object **Properties** * options(optional) * duration(optional) number[=0] * edgeGenerator(optional) function(originalNode: [Node](/api/node), generatedNode: [Node](/api/node)): [RawEdge](/api/types/rawedge) Given the original node and the generated neighbor, returns the edge that must be created between them. Source and target may be specified; otherwise the original node is the source and the generated node is the target. If this parameter is unspecified, an edge with no data and with default attributes is created. * enabled(optional) boolean[=true] * neighborIdFunction function(node: [Node](/api/node)): string|Array\|null String identifying the neighbor that will be created. An array of string can be passed; in this case multiple neighbors are created. If `null` is returned, no neighbor is created. * nodeGenerator(optional) function(identifier: string, nodes: [NodeList](/api/nodelist)): [RawNode](/api/types/rawnode) Given the nodes that spawned it and its identifier (which is not its final id, but is part of it), returns the node that must be created. If unspecified, a node with no data and with default attributes is created. * selector(optional) function(node: [Node](/api/node)): boolean If unspecified, defaults to a function that always returns true. * easing(optional) [EasingFunction](/api/types/easingfunction)[="quadraticOut"] Animation easing function. ## `NeighborMergingOptions` {#neighbormergingoptions} **Type:** object **Properties** * options * dataFunction(optional) function(node: [Node](/api/node)): object|undefined If unspecified or if it returns `undefined`, no data is added to the neighbors. * selector function(node: [Node](/api/node)): boolean Function indicating which nodes will be merged. * duration(optional) number[=0] * easing(optional) [EasingFunction](/api/types/easingfunction)[="quadraticOut"] Animation easing function. * enabled(optional) boolean[=true] ## `NodeAttributesValue` {#nodeattributesvalue} **Type:** object Object following the same structure as [`NodeAttributes`](/api/types/nodeattributes), with the addition that each property can be replaced by a function that return a value for this property (or an object if the property has multiple nested sub-properties). `undefined` can be explicitly specified in any field to indicate that the attribute should not be modified (useful when updating a class/rule). When working with a large number of nodes/edges, avoid as much as possible the usage of functions. ## `NodeClusteringOptions` {#nodeclusteringoptions} **Type:** object **Properties** * options(optional) * edgeGenerator(optional) function(edges: [EdgeList](/api/edgelist), clusterId: string, transformation: [Transformation](/api/transformation)): [EdgeDataAndAttributes](/api/types/edgedataandattributes) If `groupEdges` is `true`, indicates the function used to generate the new edges from the sub-edges. Ignored if `clusterEdges` is `false`. * enabled(optional) boolean[=true] Indicates if the clustering must be enabled. * groupIdFunction(optional) function(node: [RawNode](/api/types/rawnode)): string Given a node, must return a string identifying a cluster. All nodes for which the function returns the same value will be clustered together. By default cluster all the nodes that were selected together. * groupSelfLoopEdges(optional) boolean[=false] If true, edges for which the two extremities end up being clustered into the same node will be displayed as a self-loop edge, instead of not being displayed at all. * nodeGenerator(optional) function(nodes: [NodeList](/api/nodelist), clusterId: string, transformation: [Transformation](/api/transformation)): [NodeDataAndAttributes](/api/types/nodedataandattributes) Given a list of nodes that should be clustered together, must return the new node (meta-node) to be added. If `attributes.x` and `attributes.y` are not specified, the meta-node will be put at the center of the nodes. * selector(optional) function(node: [RawNode](/api/types/rawnode)): boolean Only nodes that match this criteria will be clustered with other nodes. By default, all the nodes will be assigned a cluster. ## `NodeCollapsingOptions` {#nodecollapsingoptions} **Type:** object **Properties** * options * duration(optional) number[=0] * edgeGenerator(optional) function(hiddenNode: [Node](/api/node), node1: [Node](/api/node), node2: [Node](/api/node), edges1: [EdgeList](/api/edgelist), edges2: [EdgeList](/api/edgelist)): [RawEdge](/api/types/rawedge)|null Function returning the RawEdge to create for each pair of adjacent nodes. `hiddenNode` is the node that is hidden (matches `selector`). `node1` is the first neighbor of the pair. `node2` is the second neighbor of the pair. `edges1` is the list of edges between the hidden node and the first neighbor of the pair. `edges2` is the list of edges between the hidden node and the second neighbor of the pair. The source and target of the edge may be specified; if it's the case they must be either `node1` or `node2`. If it's not the case, an exception will be thrown. If source/target are not specified and the edges follow a consistent direction (e.g A <- B <- C), the source and target are assigned according to that direction (here A <- B). Otherwise (e.g A -> B <- C), `node1` is used as the source and `node2` is used as the target. If `null` is returned, no edge is created between the two nodes. If no edge generator is specified, a default edge is created. * enabled(optional) boolean[=true] * selector function(node: [Node](/api/node)): boolean Function indicating which nodes will be hidden. * easing(optional) [EasingFunction](/api/types/easingfunction)[="quadraticOut"] Animation easing function. ## `NodeCollection` {#nodecollection} **Type:** [Node](/api/node)|[NodeList](/api/nodelist)|[NodeId](/api/types/nodeid)|Array\<[Node](/api/node)|[NodeId](/api/types/nodeid)\> ## `NodeDataAndAttributes` {#nodedataandattributes} **Type:** object **Properties** * attributes(optional) [NodeAttributes](/api/types/nodeattributes) * data(optional) any * id(optional) [NodeId](/api/types/nodeid) ## `NodeDependencies` {#nodedependencies} **Type:** object|null If `null`, indicates that the node attributes defined by the rule/class does not depend on any attribute of any node/edge. If unspecified, the `self`, `adjacentNodes` and `adjacentEdges` fields are treated as `{attributes: "all", data: true, selection: true, hover: false}`, and the `allNodes` and `allEdges` fields are treated as `null`. **Properties** * adjacentEdges(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that node should be updated when the specified attributes of the node's adjacent edges change * adjacentNodes(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that node should be updated when the specified attributes of the node's adjacent nodes change * allEdges(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that node should be updated when the specified attributes of any edge change * allNodes(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that node should be updated when the specified attributes of any node change * self(optional) [Dependency](/api/types/dependency) Indicates that the rule/class for that node should be updated when the specified attributes of the node change ## `NodeFilterOptions` {#nodefilteroptions} **Type:** object **Properties** * options * criteria function(node: [Node](/api/node)): boolean * duration(optional) number[=0] Duration of the filtering animation. When filtering is animated, nodes are gradually faded, before disappearing completely. Ignored if `enabled` is false. * enabled(optional) boolean[=true] Indicates if the filter must be enabled. * easing(optional) [EasingFunction](/api/types/easingfunction)[="quadraticOut"] Fading animation easing function. ## `NodeGroupingOptions` {#nodegroupingoptions} **Type:** object **Properties** * duration(optional) number Animation time in milliseconds. The animation will be played once after the creation of the group. Ignored if `enabled` is false. * easing(optional) [EasingFunction](/api/types/easingfunction)[="quadraticOut"] Grouping animation easing function. * edgeGenerator(optional) function(edges: [EdgeList](/api/edgelist), groupId: string, source: [Node](/api/node), target: [Node](/api/node), transformation: [Transformation](/api/transformation)): [EdgeDataAndAttributes](/api/types/edgedataandattributes) If `groupEdges` is `true`, indicates the function used to generate the new edges from the sub-edges. Ignored if `groupEdges` is `false`. * enabled(optional) boolean Indicates if the grouping must be enabled. * groupEdges(optional) boolean Indicates if parallel edges that end up having at least one meta-node extremity should be grouped together (to reduce cluttering). * groupIdFunction(optional) function(node: [Node](/api/node)): string|undefined Given a node, must return a string identifying a group. All nodes for which the function returns the same value will be grouped together. By default group all the nodes that were selected together. Returning `undefined` means that the node should not be grouped. * groupSelfLoopEdges(optional) boolean If true, edges for which the two extremities end up being grouped into the same node will be displayed as a self-loop edge, instead of not being displayed at all. * nodeGenerator(optional) function(nodes: [NodeList](/api/nodelist), groupId: string, transformation: [Transformation](/api/transformation)): [NodeDataAndAttributes](/api/types/nodedataandattributes) Given a list of nodes that should be grouped together, must return the new node (meta-node) to be added. GeoClustering will compute automatically the coordinate of the clusters. * onGroupUpdate(optional) function(metaNode: [Node](/api/node), subNodes: [NodeList](/api/nodelist), isOpen: boolean): [SubLayout](/api/types/sublayout) This is a callback allowing you to layout the content of an open group. It should return a promise that resolves when the layout is done, or a Promise containing an array of positions for each node in the group. * padding(optional) number|function(metaNode: [Node](/api/node)): number Padding applied to groups showing their content. If a function is passed, each MetaNode will get a padding depending on that function. * restorePositions(optional) boolean When the grouping is disabled/destroyed, indicates if the nodes should be positioned back around the meta-node position * selector(optional) function(node: [Node](/api/node)): boolean Only nodes that match this criteria will be grouped with other nodes. By default, all the nodes will be assigned a group. * separateEdgesByDirection(optional) boolean By default, edges that have opposite source and target are grouped together (resulting source and target not deterministic). If this option is `true`, they will not be grouped together. * showContents(optional) function(metaNode: [Node](/api/node)): boolean | boolean Function that would define if the contents of the group node should be hidden or not. This is called on every transformation update. ## `NodeId` {#nodeid} **Type:** string|number ## `NodeOutput` {#nodeoutput} **Type:** object|null If unspecified, the assigned attributes are inferred to the best possible extent from the `NodeAttributesValue` value. **Properties** * attributes(optional) "all"|Array\<[PropertyPath](/api/types/propertypath)\> List of node attributes assigned by the rule/class ## `NodeSelector` {#nodeselector} **Type:** null|function(node: [Node](/api/node)): boolean Used to indicate if a style rule should be applied to a given node. `null` is equivalent to a function that always returns true. ## `NodeSelector` {#nodeselector} **Type:** null|function(node: [Node](/api/node)): boolean Used to indicate if a style rule should be applied to a given node. `null` is equivalent to a function that always returns true. ## `NodeShape` {#nodeshape} **Type:** "circle"|"cross"|"diamond"|"pentagon"|"square"|"star"|"equilateral" ## `OpacityValue` {#opacityvalue} **Type:** number Value between 0 (transparent) and 1 (opaque) indicating the opacity of the node/edge. Note that Ogma doesn't perform real opacity, but background blending: the lower the opacity value is, the more the color of the node/edge is blended towards the background color, but it retains its original alpha value. This has one important implication: when using a transparent background and an image is displayed behind Ogma, it is necessary to set the RGB values to the background color that are close to the image, even if the color is transparent. For example, assuming the image is mainly grey, you should do `ogma.setOptions({backgroundColor: "rgba(128, 128, 128, 0)"})` so the nodes/edges are nicely blended towards the image color. ## `Options` {#options} **Type:** **Properties** * backgroundColor(optional) [Color](/api/types/color)[="white"] Background color of the canvas. * cursor(optional) object * default(optional) [CursorStyle](/api/types/cursorstyle)[="default"] A CSS value for the cursor. * edge(optional) [CursorStyle](/api/types/cursorstyle)[="pointer"] Cursor style when an edge is hovered. * node(optional) [CursorStyle](/api/types/cursorstyle)[="pointer"] Cursor style when a node is hovered. * detect(optional) object * edgeErrorMargin(optional) number[=2] How far of the mouse an edge can be and still be detected, in pixels. * edgeTexts(optional) boolean[=true] Indicates if the detection of edge texts should be enabled. * edges(optional) boolean[=true] Indicates if the detection of edges should be enabled. * nodeBadges(optional) boolean[=true] Indicates if the detection of node badges should be enabled. * nodeErrorMargin(optional) number[=5] How far of the mouse a node can be and still be detected, in pixels. * nodeTexts(optional) boolean[=true] Indicates if the detection of node texts should be enabled. * nodes(optional) boolean[=true] Indicates if the detection of nodes should be enabled. * directedEdges(optional) boolean[=false] If true, edges of opposing directions will be not be mixed together visually. * edgeMinTipSize(optional) number The minimum size of the edge tip. * edgeTipRatio(optional) number The ratio of the edge tip size compared to the edge width. * edgesAlwaysCurvy(optional) boolean[=false] If true, all edges will be curved. * edgesRoutingStyle(optional) [EdgesRoutingStyle](/api/types/edgesroutingstyle)[='none'] If 'horizontal' or 'vertical', cureved edges will have different curvature at the source and target, making horizontal or vertical hierarchies more readable. Use with hierarchical or custom layouts. * imgCrossOrigin(optional) [CrossOriginValue](/api/types/crossoriginvalue)[="anonymous"] Indicates the value of the `crossOrigin` field for DOM images. * interactions(optional) object * gesture(optional) object * enabled(optional) boolean[=true] Indicates if zooming/rotating using two fingers should be enabled. * hideEdgeTexts(optional) boolean[=false] Indicates if the edge texts should be hidden when zooming/rotating the view using two fingers. * hideEdges(optional) boolean[=false] Indicates if the edges should be hidden when zooming/rotating the view using two fingers. * hideNodeTexts(optional) boolean[=false] Indicates if the node texts should be hidden when zooming/rotating the view using two fingers. * hideNodes(optional) boolean[=false] Indicates if the nodes should be hidden when zooming/rotating the view using two fingers. * drag(optional) object * cursor(optional) [CursorStyle](/api/types/cursorstyle)[='move'] Cursor style to be applied while dragging the node * enabled(optional) boolean[=true] Indicates if dragging nodes with the mouse should be enabled. * pan(optional) object * enabled(optional) boolean[=true] Indicates if moving the view with the mouse should be enabled. * hideEdgeTexts(optional) boolean[=false] Indicates if the edge texts should be hidden when moving the view. * hideEdges(optional) boolean[=false] Indicates if the edges should be hidden when moving the view. * hideNodeTexts(optional) boolean[=false] Indicates if the node texts should be hidden when moving the view. * hideNodes(optional) boolean[=false] Indicates if the nodes should be hidden when moving the view. * rotation(optional) object * enabled(optional) boolean[=true] Indicates if rotating the view with the mouse should be enabled. * hideEdgeTexts(optional) boolean[=false] Indicates if the edge texts should be hidden when rotating the view. * hideEdges(optional) boolean[=false] Indicates if the edges should be hidden when rotating the view. * hideNodeTexts(optional) boolean[=false] Indicates if the node texts should be hidden when rotating the view. * hideNodes(optional) boolean[=false] Indicates if the nodes should be hidden when rotating the view. * selection(optional) object * enabled(optional) boolean[=true] Indicates if selection with the mouse should be enabled * multiSelectionKey(optional) [KeyName](/api/types/keyname)|null[="ctrl"] Indicates the key that must be pressed to select multiple nodes/edges at a time. * zoom(optional) object * duration(optional) number[=150] Indicate the duration of a manual zoom. * easing(optional) [EasingFunction](/api/types/easingfunction)[="cubicOut"] Easing function to use for the zoom. * enabled(optional) boolean[=true] Indicates if zoom on mouse wheel should be enabled. * hideEdgeTexts(optional) boolean[=false] Indicates if the edge texts should be hidden when zooming manually. * hideEdges(optional) boolean[=false] Indicates if the edges should be hidden when zooming manually. * hideNodeTexts(optional) boolean[=false] Indicates if the node texts should be hidden when zooming manually. * hideNodes(optional) boolean[=false] Indicates if the nodes should be hidden when zooming manually. * maxValue(optional) null|[ZoomBoundaryFunction](/api/types/zoomboundaryfunction) Function indicating the maximum possible zoom. By default, it's not possible to zoom so the smallest node takes more than 50% of the view. Set to `null` to remove the limit. * metaKey(optional) 'ctrl'|'alt'|'shift'|'space'[='ctrl/cmd'] Modifier button to use for zooming with the mousewheel or trackpad when `scrollToPan` is enabled. By default it's the `ctrl` (`⌘` on Mac) key. * minValue(optional) null|[ZoomBoundaryFunction](/api/types/zoomboundaryfunction) Function indicating the minimum possible zoom. By default, it's not possible to zoom so the graph takes less than 20% of the view. Set to `null` to remove the limit. * modifier(optional) number[=Math.SQRT2] Indicate the zoom multiplier on the manual zoom. * onDoubleClick(optional) boolean[=false] Indicates if zoom on double click should be enabled. * scrollToPan(optional) boolean[=false] Indicates if the view should be moved when scrolling with mousewheel or trackpad * speed(optional) number[=0.15] The speed of the zoom on mouse wheel. * minimumHeight(optional) number[=300] Minimum container height in pixels. * minimumWidth(optional) number[=300] Minimum container width in pixels. * mouse(optional) object * disableWheelUntilMouseDown(optional) boolean[=false] If true, the canvas will not take the focus of the mouse until the user clicks on it. * doubleClickTimer(optional) boolean[=500] After a click, amount of time after which a second click won't trigger a double click event * enabled(optional) boolean[=true] Indicates if the mouse should be enabled * wheelEnabled(optional) boolean[=true] Indicates if the mouse wheel should be enabled. * renderer(optional) [RendererType](/api/types/renderertype)[="webgl"] Rendering type. If WebGL is selected and not available, Ogma will fallback on Canvas. If no renderer is available (e.g in Node.js), Ogma will fallback on headless mode (`null`). * texts(optional) object * cornerRadius(optional) number[=5] Controls the radius of the rounded corners of text boxes. Set to 0 to get non rounded corners. * hideUntilFontsLoaded(optional) boolean[=true] If `true`, texts & icons won't be displayed until the browser has finished loading the fonts. This prevents texts from showing up with the default font during the short time between Ogma initialization and the moment fonts are loaded. * preventOverlap(optional) boolean[=true] Detect and remove overlapping of texts. * touch(optional) object * enabled(optional) boolean[=true] Indicates if the touch should be enabled ## `Overlay` {#overlay} **Type:** object The layer object containing its properties (overloaded for handling transformed elements). **Properties** * destroy () =\> [Overlay](/api/types/overlay) Destroy the layer (remove it from the layer array, remove its listeners). * element HTMLElement HTML element used by the layer. * getLevel () =\> number Retrieves the index of the layer in the layer array. * getOpacity () =\> number Get the layer opacity, between 0 and 1. * hide () =\> [Overlay](/api/types/overlay) Keep the layer in the layer array but hide its content. * isHidden () =\> boolean Check the layer visibility. * moveDown () =\> [Overlay](/api/types/overlay) Take the layer down a notch (decreases its index by 1). * moveTo (depth: number) =\> [Overlay](/api/types/overlay) Move the layer to the specified index in the layer array. * moveToBottom () =\> [Overlay](/api/types/overlay) Move the layer at the very bottom of the array (index `0`). * moveToTop () =\> [Overlay](/api/types/overlay) Move the layer at the very top of the array (index `length - 1`). * moveUp () =\> [Overlay](/api/types/overlay) Take the layer up a notch (increases its index by 1). * setOpacity (opacity: number) =\> [Overlay](/api/types/overlay) Set the layer opacity. * setPosition (position: {x: number, y: number}) =\> [Overlay](/api/types/overlay) Setter setting the element translation in the graph space. * setSize (size: {width: number, height: number}) =\> [Overlay](/api/types/overlay) Setter setting the element size in the graph space. * show () =\> [Overlay](/api/types/overlay) Show the layer content. ## `OverlayOptions` {#overlayoptions} **Type:** object HTML element provided with its affine transformation in the graph space. **Properties** * element HTMLElement|string HTML element being transformed. You can also provide an HTML string. * position {x: number, y: number} The element translation in the graph space. * scaled(optional) boolean[=true] Whether or not the overlay should be scaled together with the graph. * size(optional) {width: number, height: number} The element size in the graph space. ## `Padding` {#padding} **Type:** object **Properties** * bottom number Bottom padding (in pixels). * left number Left padding (in pixels). * right number Right padding (in pixels). * top number Top padding (in pixels). ## `PixelSize` {#pixelsize} **Type:** number|string Indicates a size in pixels. A string in the format `X%` (e.g "200%") can be specified instead of a number, in which case it is treated as `X percent of the default value`. `X` should be parsable using `parseFloat`. ## `Point` {#point} **Type:** object **Properties** * x number X coordinate. * y number Y coordinate. ## `PredefinedEdgeShape` {#predefinededgeshape} **Type:** "line"|"arrow"|"tapered"|"dashed"|"dotted" These are valid values to ensure retro-compatibility with Ogma < 2.2 ## `PropertyPath` {#propertypath} **Type:** string|Array\ ## `RawEdge` {#rawedge} **Type:** object JSON representation of an edge. **Properties** * attributes(optional) [EdgeAttributes](/api/types/edgeattributes) * data(optional) any * id(optional) [EdgeId](/api/types/edgeid) * source [NodeId](/api/types/nodeid) * target [NodeId](/api/types/nodeid) ## `RawGraph` {#rawgraph} **Type:** object **Properties** * edges Array\<[RawEdge](/api/types/rawedge)\> * nodes Array\<[RawNode](/api/types/rawnode)\> ## `RawNode` {#rawnode} **Type:** object JSON representation of a node. **Properties** * attributes(optional) [NodeAttributes](/api/types/nodeattributes) * data(optional) any * id(optional) [NodeId](/api/types/nodeid) ## `RendererErrorCode` {#renderererrorcode} **Type:** "NO_WEBGL"|"NO_ANGLE_INSTANCED_ARRAYS"|"OTHER"|null A non-null value indicates that an error has occurred and provides information on that error.
"NO_WEBGL" indicates that WebGL is not available, most likely a browser or GPU issue.
"NO_ANGLE_INSTANCED_ARRAYS" indicates that the ANGLE_instanced_arrays WebGL extension is not available. Also most likely a browser or GPU issue.
"OTHER" indicates an unexpected error, most likely due to a specific combination of browser/GPU/OS that was not handled correctly by Ogma. If you happen to encounter this error code , please contact support@linkurio.us and provide the error message along with the browser, operating system and graphics card used. ## `RendererState` {#rendererstate} **Type:** "requested"|"ok"|"error" Indicates a renderer state.
"requested" is fired right after Ogma is initialized or the `renderer` option has been changed, and means that the renderer has not been initialized yet.
"ok" indicates that the renderer has been initialized and runs properly.
"error" indicates that an error has occurred that prevents the renderer from running. ## `RendererType` {#renderertype} **Type:** "webgl"|"canvas"|"svg"|null ## `SVGDrawingFunction` {#svgdrawingfunction} **Type:** (elt: SVGSVGElement) =\> void The function drawing on SVG in the graph space. It is called every time the viewport is updated. ## `SVGLayer` {#svglayer} **Type:** object The layer object containing its properties (overloaded for handling transformed elements). **Properties** * destroy () =\> [SVGLayer](/api/types/svglayer) Destroy the layer (remove it from the layer array, remove its listeners). * element SVGSVGElement SVG element used by the layer. * getLevel () =\> number Retrieves the index of the layer in the layer array. * getOpacity () =\> number Get the layer opacity, between 0 and 1. * hide () =\> [SVGLayer](/api/types/svglayer) Keep the layer in the layer array but hide its content. * isHidden () =\> boolean Check the layer visibility. * moveDown () =\> [SVGLayer](/api/types/svglayer) Take the layer down a notch (decreases its index by 1). * moveTo (depth: number) =\> [SVGLayer](/api/types/svglayer) Move the layer to the specified index in the layer array. * moveToBottom () =\> [SVGLayer](/api/types/svglayer) Move the layer at the very bottom of the array (index `0`). * moveToTop () =\> [SVGLayer](/api/types/svglayer) Move the layer at the very top of the array (index `length - 1`). * moveUp () =\> [SVGLayer](/api/types/svglayer) Take the layer up a notch (increases its index by 1). * refresh [SVGDrawingFunction](/api/types/svgdrawingfunction) Function rerendering the SVG. * setOpacity (opacity: number) =\> [SVGLayer](/api/types/svglayer) Set the layer opacity. * setPosition (position: {x: number, y: number}) =\> [SVGLayer](/api/types/svglayer) Setter setting the element translation in the graph space. * setSize (size: {width: number, height: number}) =\> [SVGLayer](/api/types/svglayer) Setter setting the element size in the graph space. * show () =\> [SVGLayer](/api/types/svglayer) Show the layer content. ## `SVGLayerOptions` {#svglayeroptions} **Type:** object SVG layer options. **Properties** * draw(optional) [SVGDrawingFunction](/api/types/svgdrawingfunction) Drawing function, operates in graph coordinate space. You can render the SVG elements here or change them. * element(optional) SVGSVGElement SVG element to draw on. If not provided, it will be created. ## `ScalingMethod` {#scalingmethod} **Type:** "scaled"|"fixed" ## `SelectionInteractionOptions` {#selectioninteractionoptions} **Type:** object ## `SimpleBoundingBox` {#simpleboundingbox} **Type:** object **Properties** * cx number X coordinate of the center of the bounding box * cy number Y coordinate of the center of the bounding box * height number Height of the bounding box * maxX number Maximum X coordinate of the bounding box * maxY number Maximum Y coordinate of the bounding box * minX number Minimum X coordinate of the bounding box * minY number Minimum Y coordinate of the bounding box * width number Width of the bounding box ## `Size` {#size} **Type:** object **Properties** * height number Height. * width number Width. ## `StyleClassDefinition` {#styleclassdefinition} **Type:** object **Properties** * options(optional) * edgeAttributes(optional) [EdgeAttributesValue](/api/types/edgeattributesvalue) * edgeDependencies(optional) [EdgeDependencies](/api/types/edgedependencies) * edgeOutput(optional) [EdgeOutput](/api/types/edgeoutput) * nodeAttributes(optional) [NodeAttributesValue](/api/types/nodeattributesvalue) * nodeDependencies(optional) [NodeDependencies](/api/types/nodedependencies) * nodeOutput(optional) [NodeOutput](/api/types/nodeoutput) ## `StyleRuleDefinition` {#styleruledefinition} **Type:** object **Properties** * options(optional) * edgeAttributes(optional) [EdgeAttributesValue](/api/types/edgeattributesvalue) * edgeDependencies(optional) [EdgeDependencies](/api/types/edgedependencies) * edgeOutput(optional) [EdgeOutput](/api/types/edgeoutput) * edgeSelector(optional) [EdgeSelector](/api/types/edgeselector) * nodeAttributes(optional) [NodeAttributesValue](/api/types/nodeattributesvalue) * nodeDependencies(optional) [NodeDependencies](/api/types/nodedependencies) * nodeOutput(optional) [NodeOutput](/api/types/nodeoutput) * nodeSelector(optional) [NodeSelector](/api/types/nodeselector) ## `SubGraph` {#subgraph} **Type:** object **Properties** * object(optional) * edges(optional) [EdgeList](/api/edgelist) Edges of the subgraph. * nodes(optional) [NodeList](/api/nodelist) Nodes of the subgraph. ## `SubLayout` {#sublayout} **Type:** object Represents a layout to be applied to a group of nodes. This can be: **Properties** * Custom {layout: string, params: object} An object containing the layout name and its parameters. * Layout Promise\<{x: number, y: number, radius?: number}[]\> A promise that resolves to an array of points. * Nothing null|undefined (indicating not running any layout). ## `TextAlign` {#textalign} **Type:** "left"|"center" ## `TextContent` {#textcontent} **Type:** string|number|null ## `TextPosition` {#textposition} **Type:** 'right' | 'left' | 'top' | 'bottom' | 'center' ## `Theme` {#theme} **Type:** object **Properties** * edgeAttributes(optional) [EdgeAttributes](/api/types/edgeattributes) Default edge attributes * hoveredEdgeAttributes(optional) [HoverEdgeOptions](/api/types/hoveredgeoptions) Hovered edge attributes (you can specify duration and easing for the animation) * hoveredNodeAttributes(optional) [HoverNodeOptions](/api/types/hovernodeoptions) Hovered node attributes (you can specify duration and easing for the animation) * nodeAttributes(optional) [NodeAttributes](/api/types/nodeattributes) Default node attributes * selectedEdgeAttributes(optional) [EdgeAttributes](/api/types/edgeattributes) Selected edge attributes * selectedNodeAttributes(optional) [NodeAttributes](/api/types/nodeattributes) Selected node attributes ## `TooltipOptions` {#tooltipoptions} **Type:** object **Properties** * options(optional) * autoAdjust(optional) boolean[=true] When the mouse is at the edge of the screen, indicates if the tooltip position should be corrected so it fits in the canvas. * className(optional) string If specified, this class name will be added to tooltip. * delay(optional) number[=0] Delay in milliseconds before the tooltip is shown when the node is hovered. * position(optional) "top"|"bottom"|"left"|"right"|"cssDefined"[="top"] Position of the tooltip relative to the mouse. If "cssDefined" is specified, the tooltip will only be added to the graph container without positioning it. ## `TraversalOptions` {#traversaloptions} **Type:** object **Properties** * directed(optional) boolean[=false] Indicates if the graph should be considered as directed. * onEdge(optional) (edge: [Edge](/api/edge)\) =\> void | boolean Edge callback. Called for each edge in the traversal. If you return `false`, the edge will not be followed. * onNode (node: [Node](/api/node)\) =\> void | boolean Node callback. Called for each node in the traversal. If you return `true`, the traversal is stopped, understanding that you have found what you were looking for. * root [Node](/api/node)\|[NodeId](/api/types/nodeid) Traversal root - the node from which the traversal should start. ## `View` {#view} **Type:** object **Properties** * angle number * x number * y number * zoom number ## `VirtualPropertiesOptions` {#virtualpropertiesoptions} **Type:** object **Properties** * options(optional) * edgeDataFunction(optional) function(edge: [Edge](/api/edge)): object Indicates which data properties to add to a edge. If unspecified, no data property will be added to any edge. * edgeSelector(optional) function(edge: [Edge](/api/edge)): boolean Indicates if the transformation should be applied to a given edge. If unspecified, it is applied to all edges. * enabled(optional) boolean[=true] * nodeDataFunction(optional) function(node: [Node](/api/node)): object Indicates which data properties to add to a node. If unspecified, no data property will be added to any node. * nodeSelector(optional) function(node: [Node](/api/node)): boolean Indicates if the transformation should be applied to a given node. If unspecified, it is applied to all nodes. ## `WatcherOptions` {#watcheroptions} **Type:** object|[PropertyPath](/api/types/propertypath) If a string or array is specified, it indicates the `path` property. **Properties** * filter(optional) "visible"|"all"[="visible"] Indicates which elements the watcher takes into account. If "visible" (default), only the non-filtered elements will be taken into account. If "all", all elements will be taken into account regardless of whether they are filtered or not. * path(optional) [PropertyPath](/api/types/propertypath) Path of the data property to watch. If not specified, watch the root property. * unwindArrays(optional) boolean[=false] If `true`, array values will be treated as multiple individual values instead of one ## `ZoomBoundaryFunction` {#zoomboundaryfunction} **Type:** function(params: [ZoomLevelData](/api/types/zoomleveldata)): number This type of functions is passed to the Ogma options to define how to treat the interactive zoom level depending on the node size range, graph extent and the canvas size. ## `ZoomInteractionOptions` {#zoominteractionoptions} **Type:** object **Properties** * duration(optional) number[=150] Indicate the duration of a manual zoom. * easing(optional) [EasingFunction](/api/types/easingfunction)[="cubicOut"] Easing function to use for the zoom. * enabled(optional) boolean[=true] Indicates if zoom on mouse wheel should be enabled. * hideEdgeTexts(optional) boolean[=false] Indicates if the edge texts should be hidden when zooming manually. * hideEdges(optional) boolean[=false] Indicates if the edges should be hidden when zooming manually. * hideNodeTexts(optional) boolean[=false] Indicates if the node texts should be hidden when zooming manually. * hideNodes(optional) boolean[=false] Indicates if the nodes should be hidden when zooming manually. * maxValue(optional) null|[ZoomBoundaryFunction](/api/types/zoomboundaryfunction) Function indicating the maximum possible zoom. By default, it's not possible to zoom so the smallest node takes more than 50% of the view. Set to `null` to remove the limit. * metaKey(optional) 'alt'|'shift'|'space'[='ctrl/cmd'] Modifier button to use for zooming with the mousewheel or trackpad when `scrollToPan` is enabled. * minValue(optional) null|[ZoomBoundaryFunction](/api/types/zoomboundaryfunction) Function indicating the minimum possible zoom. By default, it's not possible to zoom so the graph takes less than 20% of the view. Set to `null` to remove the limit. * modifier(optional) number[=1.8] Indicate the zoom multiplier on the manual zoom. * onDoubleClick(optional) boolean[=false] Indicates if zoom on double click should be enabled. * scrollToPan(optional) boolean[=false] Indicates if the view should be moved when scrolling with mousewheel or trackpad * zoom(optional) object ## `ZoomLevelData` {#zoomleveldata} **Type:** object **Properties** * biggestNodeSize number Diameter of the biggest node (graph space) * graphHeight number Height of the graph (graph space) * graphWidth number Width of the graph (graph space) * smallestNodeSize number Diameter of the smallest node (graph space) * viewWidth number Width of the view (pixels) # Events {#events} ## `addEdges` {#event-addedges} Event triggered when some edges are added to the graph. **Properties** * edges [EdgeList](/api/edgelist) ## `addGraph` {#event-addgraph} Event triggered when a graph is added (using [addGraph](#Ogma-addGraph) method) **Properties** * edges [EdgeList](/api/edgelist) * nodes [NodeList](/api/nodelist) ## `addNodes` {#event-addnodes} Event triggered when some nodes are added to the graph. **Properties** * nodes [NodeList](/api/nodelist) ## `animate` {#event-animate} Triggered when the animation is called on nodes or edges. **Properties** * duration number - The duration of the animation in milliseconds * easing [Easing](/api/types/easing) * elements [NodeList](/api/nodelist)|[EdgeList](/api/edgelist) - The nodes and edges affected by the animation * updatesPositions boolean - Whether the elements are being moved ## `beforeRemoveNodes` {#event-beforeremovenodes} Triggers right before the nodes are removed, but they are still in the graph and their data is accessible. **Properties** * nodes [NodeList](/api/nodelist) ## `clearGraph` {#event-cleargraph} Event triggered when ogma.clearGraph is called. **Properties** * edges [EdgeList](/api/edgelist) * nodes [NodeList](/api/nodelist) ## `click` {#event-click} Event triggered when the user presses and releases a mouse button without moving in between. Also triggers as a left button when the user presses and releases their finger (on touch devices). **Properties** * button [MouseButton](/api/types/mousebutton) * domEvent Event * source [InputSource](/api/types/inputsource) * target [InputTarget](/api/types/inputtarget) * x number * y number ## `connectNodes` {#event-connectnodes} Triggered when two nodes are connected using the module. **Properties** * edge [Edge](/api/edge) * source [Node](/api/node) * target [Node](/api/node) ## `destroy` {#event-destroy} Fired before Ogma instance is destroyed. Can be useful to remove some event listeners. ## `doubleclick` {#event-doubleclick} Event triggered when the user presses and releases a mouse button twice without moving in between. **Properties** * button [MouseButton](/api/types/mousebutton) * domEvent Event * source [InputSource](/api/types/inputsource) * target [InputTarget](/api/types/inputtarget) * x number * y number ## `dragEnd` {#event-dragend} Event triggered when the user releases a mouse button, if a `onDragStart` has been emitted before. **Properties** * button [MouseButton](/api/types/mousebutton) * domEvent Event * source [InputSource](/api/types/inputsource) * target [InputTarget](/api/types/inputtarget) * x number * y number ## `dragProgress` {#event-dragprogress} Event triggered every time the user moves the mouse after a `onDragStart` event has been emitted, as long as the user doesn't release the mouse. If a node or edge was under the cursor when the first `onDragStart` event was emitted, it is passed as the `target` property. **Properties** * button [MouseButton](/api/types/mousebutton) * domEvent Event * source [InputSource](/api/types/inputsource) * target [InputTarget](/api/types/inputtarget) * x number * y number ## `dragStart` {#event-dragstart} Event triggered when the user presses a mouse button and then moves the mouse (without releasing the button). **Properties** * button [MouseButton](/api/types/mousebutton) * domEvent Event * source [InputSource](/api/types/inputsource) * target [InputTarget](/api/types/inputtarget) * x number * y number ## `drop` {#event-drop} Triggered when the user drops an element into the Ogma container. Note that x and y arguments are Graph coordinates. **Properties** * domEvent DragEvent * x number * y number ## `edgeClassAdded_MyClass` {#event-edgeclassadded_myclass} Triggered when the specified class (MyClass) is added to some edges. **Properties** * edges [EdgeList](/api/edgelist) ## `edgeClassRemoved_MyClass` {#event-edgeclassremoved_myclass} Triggered when the specified class (MyClass) is removed from some edges. **Properties** * edges [EdgeList](/api/edgelist) ## `edgesSelected` {#event-edgesselected} Event triggered when edges are selected **Properties** * edges [EdgeList](/api/edgelist) ## `edgesUnSelected` {#event-edgesunselected} Event triggered when edges are unselected **Properties** * edges [EdgeList](/api/edgelist) ## `frame` {#event-frame} Event triggered when a frame is rendered. ## `geoDisabled` {#event-geodisabled} Triggered when the geo mode is switched off ## `geoEnabled` {#event-geoenabled} Triggered when the geo mode is activated ## `geoLoaded` {#event-geoloaded} Triggered when the background map images are loaded ## `gestureEnd` {#event-gestureend} Event triggered when the user stop touching the screen with two fingers. **Properties** * domEvent Event ## `gestureProgress` {#event-gestureprogress} Event triggered when the users moves two fingers. **Properties** * angle number * domEvent Event * dx number * dy number * scale number * x number * y number ## `gestureStart` {#event-gesturestart} Event triggered when the user touch the screen with two fingers. **Properties** * domEvent Event ## `idle` {#event-idle} Triggered when the graph is idle (no more camera movements, no more layout iterations). ## `keydown` {#event-keydown} Event triggered when the user presses the keyboard button. **Properties** * domEvent KeyboardEvent * key string * keyCode number ## `keyup` {#event-keyup} Event triggered when the user releases the keyboard button. **Properties** * domEvent KeyboardEvent * key string * keyCode number ## `layoutComputed` {#event-layoutcomputed} This event is fired after the layout algorithm has finished the calculations, but before the positions are applied. Use it for UI interactions, because if you would add position manipulations into the listener, they can interfere with the layout results. **Properties** * name string ## `layoutEnd` {#event-layoutend} Trigger the specified function when two nodes are connected using the module. **Properties** * ids Array\<[NodeId](/api/types/nodeid)\> * name string * positions { before: [Point](/api/types/point)[], after: [Point](/api/types/point)[]} ## `layoutStart` {#event-layoutstart} Triggered when two nodes are connected using the module. **Properties** * ids Array\<[NodeId](/api/types/nodeid)\> * name string ## `mousedown` {#event-mousedown} Event triggered when the user presses a mouse button. Also triggers as a left button when the user presses their finger (on touch devices). **Properties** * button [MouseButton](/api/types/mousebutton) * domEvent Event * source [InputSource](/api/types/inputsource) * x number * y number ## `mousemove` {#event-mousemove} Event triggered when the user moves the mouse (or their finger in touch devices). **Properties** * domEvent Event * dx number * dy number * source [InputSource](/api/types/inputsource) * x number * y number ## `mouseout` {#event-mouseout} Event triggered when a node or edge stops being hovered. **Properties** * domEvent Event - The original DOM event. * source [InputSource](/api/types/inputsource) - The source of the event. * target [InputTarget](/api/types/inputtarget) - The target of the event. * x number - The x coordinate of the mouse. * y number - The y coordinate of the mouse. ## `mouseover` {#event-mouseover} Event triggered when a node or edge is hovered. **Properties** * domEvent Event * source [InputSource](/api/types/inputsource) * target [InputTarget](/api/types/inputtarget) * x number * y number ## `mouseup` {#event-mouseup} Event triggered when the user releases a mouse button. Also triggers as a left button when the user releases their finger (on touch devices). **Properties** * button [MouseButton](/api/types/mousebutton) * domEvent Event * source [InputSource](/api/types/inputsource) * target [InputTarget](/api/types/inputtarget) * x number * y number ## `mousewheel` {#event-mousewheel} Event triggered when the user uses the mouse wheel. **Properties** * delta number - The delta of the mouse wheel. * domEvent Event - The original DOM event. * source [InputSource](/api/types/inputsource) - The source of the event. * target [InputTarget](/api/types/inputtarget) - The target of the event. * x number - The x coordinate of the mouse. * y number - The y coordinate of the mouse. ## `move` {#event-move} Event triggered when camera is moving. ## `nodeClassAdded_MyClass` {#event-nodeclassadded_myclass} Triggered when the specified class (MyClass) is added to some nodes. **Properties** * nodes [NodeList](/api/nodelist) ## `nodeClassRemoved_MyClass` {#event-nodeclassremoved_myclass} Triggered when the specified class (MyClass) is removed from some nodes. **Properties** * nodes [NodeList](/api/nodelist) ## `nodesDragEnd` {#event-nodesdragend} Triggered when the user stop dragging some nodes. **Properties** * end Array\<{x: number, y: number}\> * nodes [NodeList](/api/nodelist) * start Array\<{x: number, y: number}\> ## `nodesDragProgress` {#event-nodesdragprogress} Triggered when the user drags some nodes. **Properties** * dx number * dy number * nodes [NodeList](/api/nodelist) ## `nodesDragStart` {#event-nodesdragstart} Triggered when the user starts to drag some nodes. **Properties** * nodes [NodeList](/api/nodelist) ## `nodesSelected` {#event-nodesselected} Event triggered when nodes are selected **Properties** * nodes [NodeList](/api/nodelist) ## `nodesUnselected` {#event-nodesunselected} Event triggered when nodes are unselected **Properties** * nodes [NodeList](/api/nodelist) ## `refreshStyleRule` {#event-refreshstylerule} Property {StyleRule} rule Rule that has been applied ## `removeEdges` {#event-removeedges} Event triggered when some edges are removed from the graph. **Properties** * edges [EdgeList](/api/edgelist) ## `removeNodes` {#event-removenodes} Event triggered when some nodes are removed from the graph. **Properties** * nodes [NodeList](/api/nodelist) ## `rendererStateChange` {#event-rendererstatechange} Triggered when the renderer is requested, successfully initialized or encounters an error. **Properties** * code [RendererErrorCode](/api/types/renderererrorcode) * message string * state [RendererState](/api/types/rendererstate) * type [RendererType](/api/types/renderertype) ## `resize` {#event-resize} **Properties** * difHeigh number * difWidth number * height, number * prevHeight number * prevWidth number * width number ## `rotate` {#event-rotate} Event triggered when camera is moving. ## `tooltipHide` {#event-tooltiphide} Event triggered when a tooltip is hidden. **Properties** * tooltip HTMLElement ## `tooltipShow` {#event-tooltipshow} Event triggered when a tooltip is shown. **Properties** * tooltip HTMLElement ## `transformationDestroyed` {#event-transformationdestroyed} Triggered when a transformation is destroyed **Properties** * target [Transformation](/api/transformation) ## `transformationDisabled` {#event-transformationdisabled} Triggered when a transformation is disabled **Properties** * target [Transformation](/api/transformation) ## `transformationEnabled` {#event-transformationenabled} Triggered when a transformation is activated **Properties** * target [Transformation](/api/transformation) ## `transformationRefresh` {#event-transformationrefresh} Triggered when a transformation is refreshed **Properties** * target [Transformation](/api/transformation) ## `transformationSetIndex` {#event-transformationsetindex} Triggered when a transformation index is set **Properties** * target [Transformation](/api/transformation) ## `updateEdgeData` {#event-updateedgedata} **Properties** * changes changes: Array\<{property: [PropertyPath](/api/types/propertypath), edges: [EdgeList](/api/edgelist), previousValues: Array\, newValues: Array\}\> ## `updateNodeData` {#event-updatenodedata} Trigger the specified function when the data of some nodes is updated. **Properties** * changes Array\<{property: [PropertyPath](/api/types/propertypath), nodes: [NodeList](/api/nodelist), previousValues: Array\, newValues: Array\}\> ## `viewChanged` {#event-viewchanged} Event triggered when a camera movement (zoom, panning, rotation) is finished. ## `viewExportStart` {#event-viewexportstart} Event triggered when exporting the graph in png, jpg or svg. **Properties** * camera Camera ## `zoomStart` {#event-zoomstart} Triggered when camera starts zoom. **Properties** * * duration number * easing [Easing](/api/types/easing) * endZoom number Target zoom leve * startZoom number Zoom level at the start of the zoom.