Toggle Graph Editor Script



With my workspace I dock the graph editor.

I use the ‘G’ Hotkey to expand the tab, how ever I’m looking for a script that would toggle the Graph Editor by expanding and minimizing my docked tab. Not delete the graph editor panel but just minimize it.

Can this be done?