tweag / nixpkgs-graph-explorer

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

Add new UI client #37

Closed jlesquembre closed 1 year ago

jlesquembre commented 1 year ago

Built on top of apiUpdates branch. This PR is only about the JS client, I'm not including any of the changes from apiUpdates branch

I think it should work with current main, but I didn't test it (We want to merge apiUpdates anyways, right?)

GuillaumeDesforges commented 1 year ago

Could you update the README to help build/use the new UI?

jlesquembre commented 1 year ago

Could you update the README to help build/use the new UI?

I added instruction about how to run it locally. Once the apiUpdates branch is merged, I'll add build instructions, I want to add a build script to the flake on that branch.

jlesquembre commented 1 year ago

Did you use a formatter? If not I suggest we use Prettier.

I use prettier. Once we have a flake.nix we could add a command to check the format.

dorranh commented 1 year ago

FYI - @jlesquembre, #39 has now been merged. Also, one question about these changes. From what I can tell, these only include the table and graph views and not the query editor which we have in the prototype deployed to https://nixpkgs-graph.app/. Would it be possible to somehow include that as well (e.g. as a tab)? I think having the table view as the default as you have it here is nice though.

GuillaumeDesforges commented 1 year ago

@dorranh I suggest we don't do that in this PR, get this merged ASAP so we can start on all the UI features we want in smaller, short-lived feature branch. WDYT?

dorranh commented 1 year ago

@GuillaumeDesforges, works for me (we've already made some breaking changes with #39). Let's just make sure that the features in this branch are working as expected - I tried running the client locally and it seemed to be unhappy with the latest version of the API.

GuillaumeDesforges commented 1 year ago

@jlesquembre could you rebase and make sure the UI you implemented works?

jlesquembre commented 1 year ago

@dorranh could you provide an example to call the /gremlin endpoint? With the latest API version I always get an empty response. Looks like something is wrong with my query but I don't find the reason.

dorranh commented 1 year ago

Hey, you should be able to any valid Gremlin query, for example here is a request JSON body that works for getting raw data (but not the cytoscape graph input)

{
    "query": "g.V()"
}
{
    "raw": "[]"
}

For getting the cytoscape input you need to submit a query like the default one on nixpkgs-graph.app which returns a path, e.g.

{
   "query": "g.V().filter{it.get().value('pname').matches('auto-multiple-choice')}.repeat(outE().otherV().simplePath()).times(2).path().by('pname').by(label)"
}

where auto-multiple-choice is the package name.

That should return an additional attribute called cyto_data in the response.

jlesquembre commented 1 year ago

could you rebase and make sure the UI you implemented works?

Done, I had to do some changes, now works with the new API