Skip to content

Commit

Permalink
0.2.15
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Mar 21, 2024
1 parent 46c0bb6 commit e43a8c0
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 8 deletions.
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.2.14",
"version": "0.2.15",
"minAppVersion": "1.1.6",
"description": "A clean, intuitive and editable graph view for Obsidian",
"author": "Zsolt Viczian",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"obsidian-dataview": "^0.5.56",
"obsidian-dataview": "^0.5.65",
"@popperjs/core": "^2.11.6"
},
"devDependencies": {
Expand Down
16 changes: 16 additions & 0 deletions src/Components/PowerFilter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import ExcaliBrain from "src/excalibrain-main";
import { Neighbour } from "src/types";

export class PowerFilter {

constructor(
private plugin: ExcaliBrain,
) {
this.plugin = plugin;
}

isNeighbourHidden(neighbor: Neighbour):boolean {
if(!this.plugin.settings.applyPowerFilter) return false;
return false;
}
}
21 changes: 21 additions & 0 deletions src/Components/ToolsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,27 @@ export class ToolsPanel {
})
);

// ------------
// Power Filter
// ------------
/*this.buttons.push(
new ToggleButton({
plugin: this.plugin,
getVal: () => this.plugin.settings.applyPowerFilter,
setVal: (val: boolean) => {
this.plugin.settings.applyPowerFilter = val;
return true;
},
wrapper: buttonsWrapperDiv,
options: {
display: "V",
icon: getIcon("lucide-filter").outerHTML,
tooltip: t("SHOW_HIDE_POWERFILTER"),
},
updateIndex: false,
})
);*/

// ------------
// Central node as interactive frame
// ------------
Expand Down
1 change: 1 addition & 0 deletions src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ export class Scene {
.filter(x =>
(x.page.path !== centralPage.path) &&
!settings.excludeFilepaths.some(p => x.page.path.startsWith(p)) &&
//tha node either has no primary tag or the tag is not filtered out
(!x.page.primaryStyleTag || !this.toolsPanel.linkTagFilter.selectedTags.has(x.page.primaryStyleTag)))
.slice(0,settings.maxItemCount);
const parentPaths = parents.map(x=>x.page.path);
Expand Down
4 changes: 3 additions & 1 deletion src/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface ExcaliBrainSettings {
showFullTagName: boolean;
maxItemCount: number;
renderSiblings: boolean;
applyPowerFilter: boolean;
baseNodeStyle: NodeStyle;
centralNodeStyle: NodeStyle;
inferredNodeStyle: NodeStyle;
Expand Down Expand Up @@ -112,7 +113,8 @@ export const DEFAULT_SETTINGS: ExcaliBrainSettings = {
showNeighborCount: true,
showFullTagName: false,
maxItemCount: 30,
renderSiblings: true,
renderSiblings: false,
applyPowerFilter: false,
baseNodeStyle: DEFAULT_NODE_STYLE,
centralNodeStyle: {
fontSize: 30,
Expand Down
7 changes: 3 additions & 4 deletions src/excalibrain-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { errorlog, keepOnTop } from './utils/utils';
import { getAPI } from "obsidian-dataview"
import { t } from './lang/helpers';
import { DEFAULT_HIERARCHY_DEFINITION, DEFAULT_LINK_STYLE, DEFAULT_NODE_STYLE, MINEXCALIDRAWVERSION, PLUGIN_NAME, PREDEFINED_LINK_STYLES } from './constants/constants';
import { DvAPIInterface } from 'obsidian-dataview/lib/typings/api';
import { Pages } from './graph/Pages';
import { getEA } from "obsidian-excalidraw-plugin";
import { ExcalidrawAutomate, search } from 'obsidian-excalidraw-plugin/lib/ExcalidrawAutomate';
Expand Down Expand Up @@ -55,7 +54,7 @@ export default class ExcaliBrain extends Plugin {
} = {hidden: [], parents: [], children: [], leftFriends: [], rightFriends: [], previous: [], next: []};
public hierarchyLinkStylesExtended: {[key: string]: LinkStyle}; //including datafields lowercase and "-" instead of " "
public pages: Pages;
public DVAPI: DvAPIInterface;
public DVAPI: any;
public EA: ExcalidrawAutomate;
public scene: Scene = null;
private disregardLeafChangeTimer: NodeJS.Timeout;
Expand Down Expand Up @@ -103,7 +102,7 @@ export default class ExcaliBrain extends Plugin {
});
return;
}
if(!this.DVAPI.version.compare('>=', '0.5.31')) {
/*if(!this.DVAPI.version.compare('>=', '0.5.31')) {
(new WarningPrompt(
this.app,
"⚠ ExcaliBrain Disabled: Dataview upgrade requried",
Expand All @@ -114,7 +113,7 @@ export default class ExcaliBrain extends Plugin {
this.app.plugins.disablePlugin(PLUGIN_NAME)
});
return;
}
}*/

this.EA = getEA();
if(!this.EA) {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/Page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class Page {
if(!invMap) {
return;
}
invMap.forEach(path=>{
invMap.forEach((path: any)=>{
const child = this.pages.get(path);
if(!child) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/lang/locale/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export default {
SHOW_HIDE_INFERRED: "Show/Hide inferred relationships",
SHOW_HIDE_ALIAS: "Show/Hide document alias",
SHOW_HIDE_SIBLINGS: "Show/Hide siblings",
SHOW_HIDE_POWERFILTER: "Enable/Disable Power Filter",
SHOW_HIDE_EMBEDDEDCENTRAL: "Display central node as embedded frame",
SHOW_HIDE_URLS: "Show/Hide URLs in central notes as graph nodes",
SHOW_HIDE_FOLDER: "Show/Hide folder nodes",
Expand Down

0 comments on commit e43a8c0

Please sign in to comment.