Skip to content

Commit

Permalink
0.1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Jun 4, 2023
1 parent a1d369b commit 4179227
Show file tree
Hide file tree
Showing 14 changed files with 588 additions and 118 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

ExcaliBrain is inspired by [TheBrain](https://www.thebrain.com) and [Breadcrumbs](https://github.com/SkepticMystic/breadcrumbs). It is an interactive, structured mind-map of your Obsidian Vault generated based on the folders and files in your Vault by interpreting the links, dataview fields, tags and YAML front matter in your markdown files.

ExcaliBrain distinguishes 4 type of relationships between your notes:
ExcaliBrain distinguishes 5 type of relationships between your notes:
- Children
- Parents
- Friends
- Other Friends (lateral relationships on the right side)
- Siblings

Relationships are derived based on the following logic
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "excalibrain",
"name": "ExcaliBrain",
"version": "0.1.13",
"version": "0.1.14",
"minAppVersion": "0.15.6",
"description": "A clean, intuitive and editable graph view for Obsidian",
"author": "Zsolt Viczian",
Expand Down
33 changes: 31 additions & 2 deletions src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,14 @@ export class Scene {
(!x.page.primaryStyleTag || !this.toolsPanel.linkTagFilter.selectedTags.has(x.page.primaryStyleTag)))
.slice(0,this.plugin.settings.maxItemCount);

const friends = centralPage.getFriends()
const friends = centralPage.getLeftFriends()
.filter(x =>
(x.page.path !== centralPage.path) &&
!this.plugin.settings.excludeFilepaths.some(p => x.page.path.startsWith(p)) &&
(!x.page.primaryStyleTag || !this.toolsPanel.linkTagFilter.selectedTags.has(x.page.primaryStyleTag)))
.slice(0,this.plugin.settings.maxItemCount);

const nextFriends = centralPage.getRightFriends()
.filter(x =>
(x.page.path !== centralPage.path) &&
!this.plugin.settings.excludeFilepaths.some(p => x.page.path.startsWith(p)) &&
Expand All @@ -373,6 +380,7 @@ export class Scene {
!(parents.some(p=>p.page.path === s.page.path) ||
children.some(c=>c.page.path === s.page.path) ||
friends.some(f=>f.page.path === s.page.path) ||
nextFriends.some(f=>f.page.path === s.page.path) ||
//or not exluded via folder path in settings
this.plugin.settings.excludeFilepaths.some(p => s.page.path.startsWith(p))
) &&
Expand All @@ -394,6 +402,7 @@ export class Scene {
this.links = new Links(this.plugin);
this.layouts = [];
const manyFriends = friends.length >= 10;
const manyNextFriends = nextFriends.length >= 10;
const baseStyle = this.plugin.settings.baseNodeStyle;
const siblingsCols = siblings.length >= 20
? 3
Expand Down Expand Up @@ -449,6 +458,17 @@ export class Scene {
});
this.layouts.push(lFriends);

const lNextFriends = new Layout({
origoX: (((manyNextFriends?1:0)+Math.max(childrenCols,parentCols)+1.9)/2.4) * this.nodeWidth, // (manyChildren ? -3 : -2) * this.nodeWidth,
origoY: 0,
top: null,
bottom: null,
columns: 1,
columnWidth: this.nodeWidth,
rowHeight: this.nodeHeight
});
this.layouts.push(lNextFriends);

const lParents = new Layout({
origoX: 0,
origoY: -2.5 * this.nodeHeight,
Expand Down Expand Up @@ -516,6 +536,14 @@ export class Scene {
friendGateOnLeft: false
});

this.addNodes({
neighbours: nextFriends,
layout: lNextFriends,
isCentral: false,
isSibling: false,
friendGateOnLeft: true
});

if(this.plugin.settings.renderSiblings) {
this.addNodes({
neighbours: siblings,
Expand Down Expand Up @@ -550,7 +578,8 @@ export class Scene {
Array.from(this.nodesMap.values()).forEach(nodeA => {
addLinks(nodeA, nodeA.page.getChildren(),Role.CHILD);
addLinks(nodeA, nodeA.page.getParents(),Role.PARENT);
addLinks(nodeA, nodeA.page.getFriends(),Role.FRIEND);
addLinks(nodeA, nodeA.page.getLeftFriends(),Role.FRIEND);
addLinks(nodeA, nodeA.page.getRightFriends(),Role.NEXT);
});

//-------------------------------------------------------
Expand Down
Loading

0 comments on commit 4179227

Please sign in to comment.