{"id":13425808,"url":"https://github.com/SkepticMystic/graph-analysis","last_synced_at":"2025-03-15T20:31:15.183Z","repository":{"id":39890184,"uuid":"384962118","full_name":"SkepticMystic/graph-analysis","owner":"SkepticMystic","description":"Analyse the structure of your Obsidian graph using various analysis techniques","archived":false,"fork":false,"pushed_at":"2022-05-23T08:15:58.000Z","size":32216,"stargazers_count":437,"open_issues_count":25,"forks_count":19,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-15T03:01:38.491Z","etag":null,"topics":["graph-algorithms","obsidian-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SkepticMystic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-11T13:59:35.000Z","updated_at":"2025-03-10T05:10:56.000Z","dependencies_parsed_at":"2022-07-31T17:38:54.720Z","dependency_job_id":null,"html_url":"https://github.com/SkepticMystic/graph-analysis","commit_stats":null,"previous_names":[],"tags_count":87,"template":false,"template_full_name":"obsidianmd/obsidian-sample-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkepticMystic%2Fgraph-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkepticMystic%2Fgraph-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkepticMystic%2Fgraph-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkepticMystic%2Fgraph-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SkepticMystic","download_url":"https://codeload.github.com/SkepticMystic/graph-analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243790943,"owners_count":20348378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-algorithms","obsidian-plugin"],"created_at":"2024-07-31T00:01:19.358Z","updated_at":"2025-03-15T20:31:15.150Z","avatar_url":"https://github.com/SkepticMystic.png","language":"JavaScript","readme":"# Graph Analysis\r\n\r\nGraph analysis adds the **analysis view** to Obsidian which implements a set of\r\nalgorithms that computes useful relations between the notes in your vault! Our\r\nflagship algorithm is the **Co-citations** panel, that we describe as a _2nd\r\norder backlinks panel_.\r\n\r\nThe Graph Analysis view shows a table of note names and numbers, each\r\nrepresenting the value of some graph analysis algorithm on that note in relation\r\nto the current note.\r\n\r\ne.g.\r\n\r\n- `[[A]] is 0.9 Similar to [[B]]`\r\n- `[[A]] has a 0.6 chance of being connected to [[B]]`\r\n- `[[A]] is co-cited with [[B]] 6 times`\r\n\r\n## Analysis Types\r\n\r\nGraph Analysis currently has 4 different analysis types:\r\n\r\n1. Similarity\r\n2. Link Prediction\r\n3. Co-Citations\r\n4. Community Detection\r\n\r\nEach implement different algorithms with different purposes.\r\n\r\n### Co-Citations\r\n\r\nCo-Citations counts the number of time two notes are cited together in the same\r\nnote and gives extra weight when the two notes are cited close together.\r\n\r\nThink of co-citations as a **2nd-order backlinks** panel: Instead of showing\r\n_where_ something is cited, it shows _why_, or with _whom_ or _what_ it is\r\ncited!\r\n\r\nFor example, if `[[C]]` has `[[A]] and [[B]]` in its content, then `[[A]]` and\r\n`[[B]]` will each have a co-citation of one.\r\n\r\nEach note with co-citations \u003e 0 is given a drop down menu. Inside each drop\r\ndown, you can see which note co-cites those two notes, and the sentence in which\r\nthey are co-cited (if in the same sentence), otherwise just the sentence with\r\nthe other link.\r\n\r\n![](https://i.imgur.com/9yspOkN.png)\r\n\r\n#### Example use case with daily notes\r\n\r\nAn example why this is useful is given by @HEmile:\r\n\r\n\u003e I use a lot of daily notes, in which I journal and write about the news of the\r\n\u003e day. This makes the backlinks panel a bit boring: It only shows on what dates\r\n\u003e I wrote about some note. The Co-Citations algorithm shows me much more! For\r\n\u003e example, the `Joe Biden` note shows me I usually write about Biden together\r\n\u003e with `Donald Trump`. But if I want to know what I wrote about the relations\r\n\u003e between Joe Biden and `China`, I can just look in the co-citations panel and\r\n\u003e expand the relation to see the story!\r\n\r\n![](https://i.imgur.com/udPkuV3.png)\r\n\r\n#### Video Tutorial\r\nThis video gives a longer and in depth overview for why Co-Citations is so useful!\r\n[![Watch the video](https://yt-embed.herokuapp.com/embed?v=rK6JVDrGERA)](https://youtu.be/rK6JVDrGERA)\r\n\r\n### Similarity\r\n\r\nSimilarity is a measure of how similar two notes are based on their\r\nconnectedness in the graph (ie. note content is not considered). Currently, only\r\nthe Jaccard Similarity measure is implemented.\r\n\r\n#### Jaccard Similarity\r\n\r\n**Formula**:\r\n\r\n![image](https://user-images.githubusercontent.com/70717676/139872572-93504295-6d29-4722-bdb1-3fbeb7bc22ec.png)\r\n\r\n[Source](https://neo4j.com/docs/graph-data-science/current/alpha-algorithms/jaccard/#alpha-algorithms-similarity-jaccard-context)\r\n\r\nWhere\r\n\r\n- `|x|` is the number of neighbours the node `x` has (links going in or out).\r\n- `|x \u0026 y|` is the number of neighbours that both `x` and `y` have in common\r\n\r\n### Link Prediction\r\n\r\nLink Prediction is a measure of the probability that two notes should be\r\nconnected based on their other connections in the graph. The implemented Link\r\nPrediction algorithms are Adamic Adar and Common Neighbours.\r\n\r\n#### Adamic Adar\r\n\r\n**Formula**:\r\n\r\n![image](https://user-images.githubusercontent.com/70717676/139873180-c870e072-843c-42a9-83fc-87205b408754.png)\r\n\r\n[Source](https://neo4j.com/docs/graph-data-science/current/alpha-algorithms/adamic-adar/)\r\n\r\nWhere:\r\n\r\n- `N(x)` is the number of neighbours of `x`\r\n\r\n#### Common Neighbours\r\n\r\n**Formula**:\r\n\r\n![image](https://user-images.githubusercontent.com/70717676/139873406-d0542335-3b8c-4d08-8a5b-4510408ebd4e.png)\r\n\r\n[Source](https://neo4j.com/docs/graph-data-science/current/alpha-algorithms/common-neighbors/)\r\n\r\nWhere:\r\n\r\n- `N(x)` is the numbers of neighbours of `x`\r\n\r\n### Community Detection\r\n\r\nThese algorithms try to find groups of similar notes.\r\n\r\n#### Label Propagation\r\n\r\nStart by giving each node a unique label (its own name). Then, look at each node's neighbours, and change it's label to the most common among it's neighbours. \r\nRepeat this process `iterations` number of times. \r\n\r\nAt the end, show the nodes grouped by the last label they had.\r\n\r\n#### Clustering Coefficient\r\n\r\nGives the ratio of the number of _triangles_ the `u` is a part of, to the number of triangles it possibly _could have_ been a part of:\r\n\r\n![image](https://user-images.githubusercontent.com/70717676/140610147-0a05201f-d9c7-4c0c-b423-6bbeeb81253b.png)\r\n\r\n## Utility Classes\r\n\r\nEach row in the graph analysis tables (or co-citations dropdowns) has a class:\r\n`analysis-linked` or `analysis-not-linked`, indicating if the current note is\r\nlinked to the note in that row. This gives you the ability to style a table row\r\nbased on whether it's connectedness.\r\n\r\nFor example, you can make linked notes have a lower opacity:\r\n\r\n```css\r\ntr.analysis-linked {\r\n  opacity: 0.3;\r\n}\r\n```\r\n\r\n![image](https://user-images.githubusercontent.com/70717676/139862955-75284ff5-0ced-4548-bf6e-caa353a16fe0.png)\r\n\r\nYou could even go so far as to hide linked rows completely:\r\n\r\n```css\r\ntr.analysis-linked {\r\n  display: none;\r\n}\r\n```\r\n\r\n## Settings\r\n\r\nIn the analysis view, you have the option to choose between different\r\n`Analysis Types`, and different `Algorithms` within those types. You can set the\r\ndefault analysis type in the plugin settings.\r\n\r\nThere is also the option to hide `Infinity` and `Zero` values.\r\n\r\n![image](https://user-images.githubusercontent.com/70717676/138652879-d8b0e4a7-d70a-44e8-ba3c-67e04f6a8edd.png)\r\n\r\n## Documentation on Algorithms\r\n\r\nYou can read more about the implemented algorithms, or let us know which you\r\nwant us to add, over\r\n[here](https://neo4j.com/docs/graph-data-science/current/algorithms/) 👀.\r\nInformation on co-citations can mostly be found on\r\n[Wikipedia](https://en.wikipedia.org/wiki/Co-citation). In particular, we\r\nimplement a variation of\r\n[Co-citatition Proximity Analysis](https://en.wikipedia.org/wiki/Co-citation_Proximity_Analysis).\r\n\r\n\r\n## Buy Us a Coffee\r\n\r\nSkepticMystic: [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G454TZF)\r\n\r\nEmile: [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Emile)\r\n","funding_links":["https://ko-fi.com/G2G454TZF","https://ko-fi.com/Emile"],"categories":["JavaScript","TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSkepticMystic%2Fgraph-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSkepticMystic%2Fgraph-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSkepticMystic%2Fgraph-analysis/lists"}