EwenQuim / renpy-graphviz

Draws a flowchart graph of any Visual Novel from Renpy .rpy files !
https://ewenquim.github.io/renpy-graphviz/
GNU Affero General Public License v3.0
124 stars 3 forks source link

Option to wrap edge (choice label) text over multiple lines (or clip it with ellipsis) #74

Open hsandt opened 1 month ago

hsandt commented 1 month ago

I noticed that long choice labels are displayed on one line and tend to overlap over choices, making text unreadable:

renpy-graphviz

I can -hide-edges but the choices are still useful.

An option to wrap the choice labels over multiple lines would make this more readable (either by max character count, or some clever auto-detect of space available between nodes.

According to https://stackoverflow.com/questions/5277864/text-wrapping-with-dot-graphviz there is no way to auto-wrap text though, only dot2tex may be able to do so but the given example has text inside a bubble, not on an edge. However it may be possible to add a manual \n line break (in this case only the max character count solution seems doable).

Alternatively, long text (again, compared to max character count) could be clipped with an ellipsis .... I only need the choice label beginning to understand what the choice is about (obviously this may not work with some choices that start with the same text, but then the name of the target node will complete missing information).

Btw, thanks for making this, I was just looking for a program like this, I have written myself some dotgraph generator to detect C++ include deps (well, that already existed but I needed it to detect particular includes only) and I didn't like writing another one for Renpy!

EwenQuim commented 1 month ago

Very interesting, thank you for your research!

I might work on it if I have the time, but I won't guarantee it will be done anytime soon. Don't hesitate to open a PR if you can! I'll be happy to review it