Graphology Types
TypeScript declarations to be used with graphology
.
Installation
npm install graphology-types
TypeScript declaration for graphology.
TypeScript declarations to be used with graphology
.
npm install graphology-types
0.25.1
package semantics to avoid partial ESM-first support issues.types
declaration in package's exports
key.#.hasEdge
methods for multigraphs.#.degreeWithoutSelfLoops
methods for multigraphs.#.inboundDegree
, #.outboundDegree
, #.inboundDegreeWithoutSelfLoops
, #.outboundDegreeWithoutSelfLoops
.#.dropDirectedEdge
& #.dropUndirectedEdge
.#.copy
.#.upgradeToMixed
& #.upgradeToMulti
.#.mergeUndirectedEdgeWithKey
& #.updateUndirectedEdgeWithKey
bug when source & target are given in the reverse order.#.copy
not copying the graph's attributes.#.copy
.#.updateAttributes
.#.updateNodeAttributes
.#.updateEdgeAttributes
.#.getSourceAttribute
, #.getTargetAttribute
, #.getOppositeAttribute
and friends.#.updateEachEdgeAttributes
callback arguments to #.forEachEdge
.#.merge*
and #.update*
function by returning useful information.#.opposite
performance.Migration guide
This release should only affect you in the following cases:
#.mergeEdge
, #.updateEdge
etc. In which case those methods now return a useful tuple containing said key as its first element as well as additional information about whether target elements already existed in the graph or not.#.forEach
, #.find
or #.adjacency
(not to be confused with their node, edge & neighbor counterparts).#.mergeEdge
& #.updateEdge
error messages.#.addEdge
etc. (less deopt).#.inspect
output wrt undirected multi edges.prepublishOnly
script and shipped package.#.mapNodes
, #.filterNodes
, #.reduceNodes
, #.findNode
#.someNode
, #.everyNode
.#.mapEdges
, #.filterEdges
, #.reduceEdges
, #.findEdge
#.someEdge
, #.everyEdge
.#.mapNeighbors
, #.filterNeighbors
, #.reduceNeighbors
, #.findNeighbor
#.someNeighbor
, #.everyNeighbor
.#.degreeWithoutSelfLoops
.#.forEach*Until
methods to #.find*
methods.#.hasGeneratedKey
.generated
last argument to edge & adjacency iterations.edgeKeyGenerator
instantiation option.#.degree
.#.neighbors(source, target)
to #.areNeighbors
.#.exportEdge
will now always return a key.#.copy
.undirected
.undirected
.#.clear
, #.clearEdges
.#.copy
performance.#.areNeighbors
performance.#.forEachNode
performance.obliterator
and improving iterator-based methods.Migration guide
This release should only affect you in the following use-cases:
#.forEach*Until
methods, in which case you should replace them by the relevant #.find*
or #.some*
method.#.degree
methods. Replace those calls by #.degreeWithoutSelfLoops
.#.neighbors
. Replace those calls by #.areNeighbors
.#.removeNodeAttribute
error message.0.20.0
.*Until
methods now return whether they broke.#.forEachNodeUntil
.rollup
bundling.#.dropNode
bug.#.dropNode
.#.forEachUntil
.#.forEachNodeUntil
.#.forEachEdgeUntil
.#.forEachNeighborUntil
.#.updateNode
.#.updateEdge
.attributes
to attributesUpdated
events.attributes
to nodeAttributesUpdated
events.attributes
to edgeAttributesUpdated
events.#.updateEachNodeAttributes
.#.updateEachEdgeAttributes
.undirected
& generatedKey
to #.forEachEdge
callbacks.#.forEach
& #.adjacency
semantics to something actually useful.*AttributesUpdated
events payload.#.edges(A, B)
.#.forEachEdge
.#.mergeEdge
.#.edges
and #.nodes
.#.import
.#.edges(A, B)
with directed self loops.#.mergeEdgeWithKey
edge cases.#.mergeAttributes
event payload.#.edgeEntries
stack overflow with undirected edges.before
and after
from replace
events metadata.value
from set
events metadata.toString
method.nodeAttributesUpdated
event when node is merged.edgeAttributesUpdated
event when edge is merged.graphology-types
is now a peer dependency.#.implementation
.#.hasExtremity
.#.selfLoopCount
, #.directedSelfLoopCount
& #.undirectedSelfLoopCount
.#.hasGeneratedKey
.#.directed
& #.undirected
to #.isDirected
& #.isUndirected
.#.selfLoop
to #.isSelfLoop
.#.from
static methods.#.opposite
.#.forEachEdge
methods.#.nullCopy
& #.emptyCopy
methods.graphology-types
.MultiGraph
export.#.emptyCopy
.#.mergeEdge
for the self loop case.Symbol.iterator
to the prototype.#.nodeEntries
.#.edgeEntries
.#.neighborEntries
.#.forEach
.#.adjacency
.#.clearEdges
.#.forEachEdge
& alii.#.forEachNode
& alii.#.forEachNeighbor
& alii.#.inboundNeighbors
& #.outboundNeighbors
.#.inboundEdges
& #.outboundEdges
.#.addNodesFrom
.#.dropNodes
& #.dropEdges
.defaultNodeAttributes
& defaultEdgeAttributes
.#.inEdges
& #.outEdges
for arity 2.#.mergeNode
.#.dropEdges
.obliterator
dependencies.#.mergeNode
& string coercion.#.edges
for undirected graphs.#.directedSize
& #.undirectedSize
.#.mergeEdge
& undirected edges.#.inspect
.#.hasEdge
& typed graphs.#.nodesIterator
method.#.edge
& variants methods.#.upgradeToMixed
method.#.upgradeToMulti
method.inbound
& outbound
iteration methods.#.from
method & switching constructor paradigm.attributesUpdated
event.#.getEdge
& friends.#.selfLoops
.attributes
in export.#.removeNodeAttribute
& #.removeEdgeAttribute
that was actually missing from earlier versions.nodeUpdated
& edgeUpdated
changing to nodeAttributesUpdated
& edgeAttributesUpdated
respectively.#.hasNodeAttribute
& #.hasEdgeAttribute
.#.removeNodeAttribute
& #.removeEdgeAttribute
.#.mergeNode
.#.mergeEdge
, #.mergeEdgeWithKey
and friends.#.relatedNode
to #.opposite
.onDuplicateNode
& onDuplicateEdge
options.edgeKeyGenerator
function.Initial version compliant to the specs.