The [diagrams library](https://diagrams.mingrammer.com/) uses GraphViz and seems to support [flowchart notion too](https://diagrams.mingrammer.com/docs/nodes/programming), no need to mess with JavaScript