Socket
Socket
Sign inDemoInstall

@antv/graphlib

Package Overview
Dependencies
Maintainers
57
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/graphlib

> The typescript rewrite version of @dagrejs/graphlib, because graphlib was old and lacked typescript annotations, which led to inconsistent typescript files and even compilation failure or failure due to the typescript of Graphlib, antv team has rewritte


Version published
Weekly downloads
65K
increased by6.71%
Maintainers
57
Weekly downloads
 
Created
Source

Graphlib

The typescript rewrite version of @dagrejs/graphlib, because graphlib was old and lacked typescript annotations, which led to inconsistent typescript files and even compilation failure or failure due to the typescript of Graphlib, antv team has rewritten it;

build status coverage status

Improvements and break changes

  • Graph has a type that accepts four parameters <NodeIDType,NodeType, EdgeType, GraphType> to make it easier for users to customize it themselves, no longer stuck to the original single number/string type, now because of the use of Map and Set, you can use any type (including reference Now, because of Map and Set, you can use any type (including reference type) as the index of a point.
  • no longer accept the same node ID string, 1 and "1" are two different points, no automatic type conversion of NodeIDType comparison. 1.
  • Graph's edge-related methods edge setEdge removeEdge no longer accept type overloading.
    • edge setEdgeObj removeEdgeObj accepts an edgeObj
    • edgeFromArgs setEdge removeEdge accepts specific parameters (v, w, name, value)

Benchmark

test\performance(ops/s)@dagre/graphlib@antv/graphlibtimes
nodes(100,0.2)353,396.953,429,316.129.7
sources(100,0.2)10,521.67392,493.7737
sinks(100,0.2)10,959.91386,649.1935
filterNodes all(100,0.2)153.71309.452.0
filterNodes none(100,0.2)2,519.819,639.133.83
setNode(100,0.2)12,312,125.1346,866,922.243.81
node(100,0.2)28,205,461.6547,093,921.571.67
set + removeNode(100,0.2)1,272,331.16391,557.000.31
predecessors(100,0.2)1,307,177.147,508,958.215.7
successors(100,0.2)1,485,256.817,448,177.235.0
neighbors(100,0.2)250,082.05326,744.331.31
edges(100,0.2)4,594.50195,840.5643
setPath(100,0.2)1,056,189.241,579,308.801.5
setEdge(100,0.2)4,483,547.205,541,620.411.24
edge(100,0.2)3,254,316.177,126,976.062.2
set + removeEdge(100,0.2)557,579.8876,798.230.14
inEdges(100,0.2)710,823.703,856,353.975.4
outEdges(100,0.2)690,512.543,756,590.815.4
nodeEdges(100,0.2)309,098.911,263,443.144.1
components(100,0.2)1,729.795,321.203.1
dijkstraAll(100,0.2)30.8347.731.55

Test Coverage

File% Stmts% Branch% Funcs% Lines
All files100100100100
src100100100100
enum.ts0000
index.ts0000
util.ts100100100100
src/Graph100100100100
index.ts100100100100
src/PriorityQueue100100100100
index.ts100100100100
src/algorithm100100100100
components.ts100100100100
dfs.ts100100100100
dijkstra-all.ts100100100100
dijkstra.ts100100100100
find-cycles.ts100100100100
floyd-warshall.ts100100100100
index.ts0000
is-acyclic.ts100100100100
postorder.ts100100100100
preorder.ts100100100100
prim.ts100100100100
tarjan.ts100100100100
topsort.ts100100100100

FAQs

Package last updated on 21 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc