tweag / nixpkgs-graph-explorer

Explore the nixpkgs dependency graph
MIT License
15 stars 0 forks source link

Update default Gremlin query #100

Closed zz1874 closed 1 year ago

zz1874 commented 1 year ago

This PR updates the default Gremlin query by:

g.V()
    .has(
    'package',
    'pname',
    'python3'  // Package name goes here
    )
.repeat(outE().otherV().simplePath())
.until(
    outE().count().is(0).or().loops().is(gte(2)) // The value in gte() limits the depth of the traversal
)
.path()
.by('pname')
.by('label')
.limit(20) // This limits the number of "paths" returned (where a path = [vertex, edge, vertex])

In this way, the query will return data no matter how many layers of dependencies the package has.

Fixed #78