Welcome to note-graph 👋
Note Graph is a generic visualization tool designed to show the structure of the document space and the relations between each doc.
It aims to be a handy tool for anyone who's interested in building a graph view for document spaces.
It depends on D3.js and force-graph, written in Typescript and can be used in the browser.
Inspired by Foam.
Demo and docs 🚀
See the demo on vercel.
Usage
(1) Use in html
Make sure runtime dependencies d3 and force-graph are loaded before constructing NOTE_GRAPH.NoteGraphView
.
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/d3@6.2.0/dist/d3.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/force-graph@1.35.1/dist/force-graph.js"></script>
<script src="https://cdn.jsdelivr.net/npm/note-graph@latest/dist/note-graph.umd.js"></script>
</head>
<body>
<div id="note-graph-container"></div>
<script>
function initGraphView() {
const notes = [
{
id: '1',
title: 'Note Graph',
linkTo: [],
referencedBy: [],
},
]
const graphModel = new NOTE_GRAPH.NoteGraphModel(notes)
const graphView = new NOTE_GRAPH.NoteGraphView({
container: document.getElementById('note-graph-container'),
graphModel,
enableNodeDrag: true,
})
}
window.onload = function () {
initGraphView()
}
</script>
</body>
</html>
(2) Use in your project that has a bundler
Install the dependency:
yarn add note-graph
import { NoteGraphModel, NoteGraphView } from 'note-graph'
Develop
Install dependendies:
yarn && yarn bootstrap
Start development:
yarn dev
Author
👤 hikerpig
Show your support
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator