aws / graph-explorer

React-based web application that enables users to visualize both property graph and RDF data and explore connections between data without having to write graph queries.
https://github.com/aws/graph-explorer
Apache License 2.0
299 stars 46 forks source link

[Bug] Neighbor expansion paging does not show all neighbors #462

Open kmcginnes opened 1 week ago

kmcginnes commented 1 week ago

Description

If we have this simple graph in Graph Explorer

A -> B -> C

And C has the neighbors:

Now let's say we expand C with a limit of 2.

Graph Explorer already knows C is neighbors with B, so 1 neighbor is already expanded. So to get the "next" neighbors we skip 1 and take the next 2 neighbors.

The issue is that the database is unaware of what nodes are in the graph and which are not. So the neighbor we skip happens to be A.

Our result includes:

Since B is already in the graph, we add one new node D to the graph

A -> B -> C -> D

We expand again with our limit of 2. Graph Explorer has 2 neighbors visible. So we skip 2 neighbors and take 2, resulting in:

Since D is already in the graph, we add one new node E to the graph

A -> B -> C -> D
          | -> E

Expanding again with our limit of 2, Graph Explorer has 3 neighbors of C visible. Skip 3 & take 2 results in

Which is already in our graph. So nothing appears to happen in the UI.

Environment

Steps to Reproduce

Expected Behavior

Limited expansions should always include new neighbors. The full set of neighbors should be able to be expanded if enough expansions occur.


[!IMPORTANT] If you are interested in working on this issue or have submitted a pull request, please leave a comment.

[!TIP] Please use a 👍 reaction to provide a +1/vote.

This helps the community and maintainers prioritize this request.