mirror of
https://github.com/calfmoon/node-factor.git
synced 2026-07-22 05:42:24 +00:00
feat(calc): read manually added weights
This commit is contained in:
parent
fd824ea406
commit
d212d1f57f
1 changed files with 14 additions and 4 deletions
18
src/main.ts
18
src/main.ts
|
|
@ -11,10 +11,12 @@ export default class NodeFactor extends Plugin {
|
|||
this.addSettingTab(new NodeFactorSettingTab(this.app, this));
|
||||
|
||||
this.registerEvent(
|
||||
this.app.workspace.on("active-leaf-change", () => {
|
||||
// we can still use cache when only active leaf changes
|
||||
this.updateGraph();
|
||||
}),
|
||||
this.app.workspace.on("active-leaf-change", () =>
|
||||
this.updateGraph(),
|
||||
),
|
||||
);
|
||||
this.registerEvent(
|
||||
this.app.workspace.on("layout-change", () => this.updateGraph()),
|
||||
);
|
||||
|
||||
// clear cache when there is change in the vault
|
||||
|
|
@ -71,6 +73,14 @@ export default class NodeFactor extends Plugin {
|
|||
const settings = this.settings;
|
||||
let weight = 0;
|
||||
|
||||
let manualFileData = settings.manual.find(
|
||||
(manualFileData) => manualFileData.id == node.id,
|
||||
);
|
||||
if (manualFileData != null) {
|
||||
console.log(manualFileData);
|
||||
return manualFileData.weight;
|
||||
}
|
||||
|
||||
weight += Object.keys(node.reverse).length * settings.bwdMultiplier;
|
||||
if (settings.fwdTree) {
|
||||
weight +=
|
||||
|
|
|
|||
Loading…
Reference in a new issue