Closed Sebastian-G closed 2 months ago
This issue is not directly related to tsplot
but can increase the developer's experience while using it.
Interesting 🤔. I'll take a look at it and let you know, if there's anything we can do about it.
Thanks for the feedback!
So I've thought a bit about possible solutions from tsplot
side. There's a Mermaid directive called init
or initialize
which lets you configure the Mermaid rendering process from the generated Mermaid output string content.
Example
%%{init: { theme: 'neutral' }}%%
classDiagram
Foo --> Bar
Unfortunately this won't work for most cases in which Mermaid diagrams are embedded. Due to the unsafe nature almost any platform disables it (e.g. Github or IDE Plugins).
So all we can really do here is displaying a warning message during the rendering process of tsplot
which refers to the documentation of the Mermaid configuration describing how to override the default maxTextSize
or maxEdges
limits.
Example
WARN The generated output exceeds the default maximum text size or amount of edges. Make sure to configure
Mermaid properly to allow rendering of larger diagrams (see https://mermaid.js.org/config/schema-docs/config.html)
or consider refining the filter options to reduce the output diagram size (see --help)
@Sebastian-G, do you think that's a feasible enhancement to the CLI experience? Any thoughts on it are highly appreciated.
Edit: I've also added the stats
output to the tsplot diagram
command execution when using --debug
.
I tried the tool to create the graph for my current project, but the
mermaid
could not render the results.Example:
Is there any way to verify the size upfront and let the process fail before it creates an unusable file?
Background info:
Stats:
npx tsplot stats .
returns: