Font-aware rendering mode for dependency trees (style "dep" render) #13901
HtmlMak
started this conversation in
New Features & Project Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi spaCy team,
I'd like to propose an enhancement for the dependency tree renderer in displaCy.
Idea: Add an optional rendering mode that takes the font size into account when positioning nodes and arcs. This approach is more resource-intensive than the current layout algorithm, but it helps prevent overlapping or poorly spaced words, especially for long tokens in sentences.
Currently, users can mitigate overlap by increasing the distance parameter, but this often reduces overall readability, particularly for complex trees. A font-aware mode would calculate spacing based on actual text dimensions, maintaining clarity without unnecessarily expanding the layout.
I have a couple of screenshots from my prototype showing "before" and "after" layouts, which illustrate the potential improvement.
If this feature sounds useful for the library, I'm happy to adapt the solution from my project.
Beta Was this translation helpful? Give feedback.
All reactions