Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select and implement node graph component #2459

Open
wesbillman opened this issue Aug 20, 2024 · 2 comments
Open

Select and implement node graph component #2459

wesbillman opened this issue Aug 20, 2024 · 2 comments
Labels
console Web console dx

Comments

@wesbillman
Copy link
Collaborator

We need something better for the current "Console" page which is showing a node graph of the system.

One option might be Apache ECharts.

Ideally, we can view everything about the system visually with some basic interactions to start. I think being able to show a popup window for different nodes, or showing in the right sidebar would be a useful start.

Grafana has a nice "Service Graph" as well, which is nice and simple with popups when clicking on Nodes.
Screenshot 2024-08-20 at 8 22 42 AM
Screenshot 2024-08-20 at 8 22 37 AM

@wesbillman wesbillman added console Web console dx labels Aug 20, 2024
@github-actions github-actions bot added the triage Issue needs triaging label Aug 20, 2024
@ftl-robot ftl-robot mentioned this issue Aug 20, 2024
@wesbillman wesbillman removed the triage Issue needs triaging label Aug 23, 2024
@deniseli
Copy link
Contributor

deniseli commented Nov 1, 2024

Prototyped a bit with https://github.com/hustcc/echarts-for-react. This works pretty well for layout and basic functionality, but it's very difficult to get more complex data into the nodes themselves, so it'd be hard to visualize things like "here are all the decls of type T in each of these modules". It really bakes in the assumption that each node represents a singular numeric value, and each node's label will be a simple string. Link if anyone wants to try it: https://github.com/TBD54566975/ftl/compare/dli/graph-sandbox?expand=1

What was really nice with echarts was having an auto layout mechanism. It looks like there are actually a few options for auto layout with ReactFlow documented here, so I'll take a stab at that next, starting with Dagre. I suspect we could even get subgraphs (i.e. decls as nodes grouped within a module) to lay out nicely by running Dagre recursively, but I'll skip prototyping that since it's such a long-tail sort of feature. Implementation notes for future me: compute size bounds for each subgraph as a function (sqrt?) of node count, make each subgraph a parent node assigned aforementioned size, tell Dagre to lay out the parent nodes, within the full page, and then iterate over each parent node, telling Dagre to lay out the child nodes, but constraining the perimeter to just the space for that parent node.

Rendering nice little popups should be easy enough, compared to all the layout math, so if I can get that working well, we could stick to ReactFlow (which seems like the best of all the options for actually rendering complex nodes).

@deniseli
Copy link
Contributor

deniseli commented Nov 1, 2024

Dagre was nice until I got to laying out the decls within the module. It doesn't support subflows at all. Switching to Elk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console Web console dx
Projects
None yet
Development

No branches or pull requests

2 participants