datopian / flowershow

💐 Publish your obsidian digital garden or any markdown site easily and elegantly.
https://flowershow.app/
MIT License
751 stars 92 forks source link

Visualize knowledge graph of notes (network graph) #37

Open olayway opened 1 year ago

olayway commented 1 year ago

NB: this depends on having a database of links (especially backlinks) - see #5 for research on this.

PKM tools like obsidian and logseq have a network graph like the below. We want to be able to provide something like this in Flowershow.

image

image

stephenreid321 commented 1 year ago

Yes please!

thoughtship commented 1 year ago

Rather than build from scratch, there are other projects that have built this feature and open-sourced it. Which might help?

Here's one example. The graph button is on the top right. It can also be embedded as a pinned window which updates based on your focus, similar to how the feature works in obsidian.

https://github.com/mathieudutour/gatsby-digital-garden Example: https://mathieudutour.github.io/gatsby-digital-garden/

Maybe search 'graph' in the repo and see what was done?

Their might even be some other problems/features already solved in this repo as well, like issue #5.

olayway commented 1 year ago

Hi @thoughtship! Thank you for the hint! We'll definitely look into this solution when we start working on this feature.

rufuspollock commented 1 year ago

@thoughtship thank-you very much for the suggestions.

The main blocker right now is not the display but having the network of links - which is issue #5. (once we have the network doing a network graph is very quick in e.g. d3 etc)

The example you link gets the network links here https://github.com/mathieudutour/gatsby-digital-garden/tree/master/packages/gatsby-transformer-markdown-references and these are then queryable via gatsby's graphql API:

{
  allMdx {
    outboundReferences {
      ... on Mdx {
        id
        parent {
          id
        }
      }
    }
    inboundReferences {
      ... on Mdx {
        id
        parent {
          id
          ... on RoamPage {
            title
          }
        }
      }
    }
  }
}
thoughtship commented 1 year ago

Hey @rufuspollock,

I just responded on issue 5. Excalibrain is another plugin that has code showing how to extract the network of links between nodes. And shows how to query for related nodes. https://github.com/flowershow/flowershow/issues/5#issuecomment-1465068397

rufuspollock commented 1 year ago

Now we have resolved #5 this is next up.

blacklightpy commented 7 months ago

What's the status? This is in Ready, but looks different from Done..

rufuspollock commented 7 months ago

@blacklightpy we now have everything we need in markdowndb so it's a question of porting that over and doing the viz

@mohamedsalem401 i think this could be one for you to look at next ...