Polyglot Notebooks allow users to enrich code with documentation (in Markdown format), output the results and visualize them.
The JavaScript-based tool Mermaid can be used to generate images in Polyglot Notebooks. However, Mermaid does not support variables.