Implemented a Graph View on My Blog
I liked Obsidian's graph view, so I implemented it on my own website.
What is the graph view

In the graph view, you can represent relationships between items in a graph like a correlation diagram.
The editor I use to write my blog, Obsidian, has a similar feature. Obsidian Publish, which publishes Obsidian notes to the web, also includes this graph view and says it uses the same rendering engine as the graph view.

It seems Obsidian implemented it themselves, but since the source code isn't public, I had no choice but to implement it on my own.
I don't have that many posts, so I didn't need to worry much about performance. I used a package called React-Force-Graph that bundles the d3.js library mentioned in the Reddit post above, and tweaked the force simulation and other settings.
React component for 2D, 3D, VR and AR force directed graphs - vasturiano/react-force-graph
GitHub
There is a similar library called vis.js, but I chose d3.js because it allows more complex interactions (vis.js is easier to get started with). Since many users browse on mobile, I made all features usable without hover interactions.
As the package name suggests, the graph view runs in React. This site is mostly static and uses Astro, so everything except the graph-view component is prebuilt.
At build time, I generate a JSON file that describes all posts and their relationships, and load it when the page loads.
If the number of pages grows a lot, this might become problematic, so I'll use this approach for a while and consider another method if it doesn't work out.
0 people clapped 0 times
Related articles
🔧Exhibiting at Maker Faire Tokyo 2026
Exhibiting at Maker Faire Tokyo 2026
I casually submitted my first piece of hardware and ended up getting accepted!?
⚒️Introduction to Useful Tools for Team Development
Introduction to Useful Tools for Team Development
When starting team development, it's often difficult to decide how to work together. This article summarizes tools that may be useful in such cases.
♻️Super Large Refactoring After Finishing MITOU Junior
Super Large Refactoring After Finishing MITOU Junior
Hello. I'm Souma. :::message This article is part of the MITOU Junior Advent Calendar. ::: Today, I'd like to talk about a large-scale refactoring of the app I
🤖How to Conduct Bitcoin Transactions Without Using Blockchain (Off-Chain)
How to Conduct Bitcoin Transactions Without Using Blockchain (Off-Chain)
How to Conduct Bitcoin Transactions Without Using Blockchain (Off-Chain) This article is a re-upload of an article I wrote a while ago. When people hear the ter