Plugin example using sidebar -- with data from current page (like the graph)

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.

  1. User calls macro renderer to render sidebar
  2. User clicks a button which opens the block in the sidebar
  3. The renderer shows the graph view, this is the part you need to code
  4. Use the onPageChanged method or something like this, to identify when this happens
  5. Use getCurrentPage to get the page or getCurrentPageBlocksTree to get the blocks in the page
  6. Render this

I hope this is clear. Excited to see what you build!