I assume you do not mean “the diagram variable” because you have no global variable for that, but instead you are really asking:
“How can I access the Diagram from an HTMLElement?”
The answer is to call the static function Diagram.fromDiv. I’m assuming you can get to that DIV element.