Return to home
🗺️

Implemented a Graph View on My Blog

I liked Obsidian's graph view, so I implemented it on my own website.

This article is machine-translated.
10/29/2025

What is the graph view

Image from Gyazo

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.

Image from Gyazo

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.

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

8/17/2026

I casually submitted my first piece of hardware and ended up getting accepted!?

0 times clapped
Read article

⚒️

Introduction to Useful Tools for Team Development

10/5/2025

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.

0 times clapped
Read article

♻️

Super Large Refactoring After Finishing MITOU Junior

12/14/2024

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

0 times clapped
Read article

🤖

How to Conduct Bitcoin Transactions Without Using Blockchain (Off-Chain)

5/9/2023

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

0 times clapped
Read article
Return to home