I'm glad you mentioned Foam - turns out Foam is also written in JS/Typescript as a VSCode plugin.
I'm thinking, rather than implementing these feature myself, I'd rather investigating re-using the graph built for Foam and just turning my plugin into a compatibility layer between Joplin and the Foam graph library.
I don't really have the time or JS skills to build all this in a reasonable amount of time.