dominiquegarmier / notion-graph

graph view of your notion pages
MIT License
28 stars 5 forks source link

Graph based upon database relations #33

Open MrCredible opened 4 months ago

MrCredible commented 4 months ago

It would be nice to see relations between both page references and database relations.

Most of my notion links are from database relations. This could help visualize project sizes and effort for those utilize notion as a project management tool.

dominiquegarmier commented 4 months ago

I currently don't have time to make these changes, maybe later... But here are my thoughts:

When parsing the result form the Notion API the parser generates an attribute called link_type (I just made a commit https://github.com/dominiquegarmier/notion-graph/commit/4cbaeb5779ebcfcf06f158d70286a5ce7d5c8fd4 to distinguish database and page, there was a bug previously).

https://github.com/dominiquegarmier/notion-graph/blob/f538864722d848026a0afeed8337f0a26a5f348b/graph.py#L123

We would have to pass this property to the frontend and render it. I.e. we have to change:

https://github.com/dominiquegarmier/notion-graph/blob/f538864722d848026a0afeed8337f0a26a5f348b/graph.py#L248

https://github.com/dominiquegarmier/notion-graph/blob/f538864722d848026a0afeed8337f0a26a5f348b/graph.py#L268

and we have to change index.html to then render this data (different colors for each link type?). It would be nice to have the colors be configurable (via a constant in graph.py for now) so we would have to use a jinja template instead of just raw html.

Feel free to make changes and create a PR.

dominiquegarmier commented 4 months ago

also you will have to re-parse all your notes since the graph format changed. Maybe we could make this smarter in the future.