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

Model Visualization Improvements #42

Open
aaguiarz opened this issue Jan 10, 2024 · 2 comments
Open

Model Visualization Improvements #42

aaguiarz opened this issue Jan 10, 2024 · 2 comments

Comments

@aaguiarz
Copy link
Member

No description provided.

@aaguiarz aaguiarz converted this from a draft issue Jan 10, 2024
@PatrickMunsey
Copy link

I'm not sure what you have planned for the model visualization improvements but I though I'd add some ideas here.

I use NX to manage my monorepos and it has some really good tooling for visualising the project dependancy graph which could be a good reference for an improved implementation in the playground. Their implementation handles displaying really large graphs nicely.

Current playground displaying a 150 line model can get a bit crowded

Image

Example project graph visualisation using the nx graph

Image

Some feature Ideas:

  • Being able to group nodes by type or module similar to nx graph's 'group by folder'
  • Hiding and unhiding all type relation nodes or only those related to specific types
  • Extracting the graph from the playground and exporting via something like a npm installable react ui component that can easily be dropped into an application to visualise a model or different cli query responses similar to the graph view in the playground e.g.
import {OpenFGAGraph} from 'openfga'
<OpenFGAGraph model=${model} query=${cliQueryResponse} viewType='check'/>

@rhamzeh
Copy link
Member

rhamzeh commented Feb 18, 2025

Thanks for sharing @PatrickMunsey

Being able to group nodes by type or module similar to nx graph's 'group by folder'
Hiding and unhiding all type relation nodes or only those related to specific types
Noted - thanks for the example!

Extracting the graph from the playground and exporting via something like a npm installable

We don't currently have an installable react module, not sure if we will - if we do, maybe for something more low level like web components rather than react, however the logic for creating the graph for visjs.org is here and can be coupled with any react component for Vis.js, e.g. react-graph-vis:

https://github.com/openfga/frontend-utils/blob/main/src/utilities/graphs/model-graph.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants