When I choose one of the built-in visualizers:
I can see the original expression being visualized:
How can I get this information from within my own custom visualizer?
I've looked through the API reference, without finding anything.
(If you haven't found an answer, please upvote the request to support this on Developer Community.)
Update
The linked Developer Community request has been closed for reasons.