Looking through, I believe the best solution would be to tap into the macroRenderer and create it programatically on some random page and then open this block in the sidebar. I think these two TOC plugins are the best option.
hkgnp/logseq-toc-plugin (github.com)
This is another option.
sethyuan/logseq-plugin-tocgen: Generate a TOC of any page anywhere to quickly access the page’s content. (github.com)
I’d probably follow this general flow.
- User calls macro renderer to render sidebar
- User clicks a button which opens the block in the sidebar
- The renderer shows the graph view, this is the part you need to code
- Use the onPageChanged method or something like this, to identify when this happens
- Use getCurrentPage to get the page or getCurrentPageBlocksTree to get the blocks in the page
- Render this
I hope this is clear. Excited to see what you build!