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

Visualize FlowNode graph #134

Merged
merged 6 commits into from
Feb 26, 2024
Merged

Visualize FlowNode graph #134

merged 6 commits into from
Feb 26, 2024

Conversation

danvk
Copy link
Contributor

@danvk danvk commented Feb 26, 2024

This is significantly easier to understand than the antecedent tree view:

image

This does a BFS on the FlowNode graph (via antecedent / antecedents) and produces a graph spec using dot format. It then uses viz-js to turn this into an SVG for display.

If this is of interest, we can work on tuning the display, options and interactivity.

cc @JoshuaKGoldberg, who was interested in this

Copy link
Owner

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool. Let's try it. Thanks, Dan!

@dsherret dsherret merged commit afd5c72 into dsherret:main Feb 26, 2024
1 check passed
@Andarist
Copy link

Oh my god. This is glorious 😍 I was dumping flowNode.__debugToString and interpreting ASCII diagrams for mooonths.

Thank you ❤️

@danvk
Copy link
Contributor Author

danvk commented Feb 28, 2024

Thanks @Andarist! Regardless of what happens to microsoft/TypeScript#57465, this is at least a nice, tangible win that came out of it. I found flow nodes completely incomprehensible until I did this :)

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

Successfully merging this pull request may close these issues.

3 participants