How to display a tree view on hover?

Here’s what I currently have:

The ASCII tree doesn’t quite fit in with the rest of the UI. I want to display an interactive (and lazy, if possible, since dependencies may be circular) tree like that of the project view or the Hierarchy tool window. How can I do that?

I’m using platform.backend.documentation.targetProvider. DocumentationResult’s methods don’t seem to help, since they expect HTML strings.