feat(calc): add letter count as factor effecting node size

This commit is contained in:
Kritagya Bhattarai (CalfMoon) 2025-03-10 19:42:53 +05:45
parent 9155817954
commit 7998b23ea4

View file

@ -68,7 +68,18 @@ export default class NodeFactor extends Plugin {
weight += Object.keys(node.forward).length * settings.fwdMultiplier;
}
return weight;
if (settings.lettersPerWt != 0) {
weight += this.letterCount(node) / settings.lettersPerWt;
}
return Math.round(weight);
}
private letterCount(node: ObsidianNode): number {
const file = this.app.vault.getFileByPath(node.id);
if (!file || file.extension != "md") return 0;
return file.stat.size;
}
private fwdNodeTreeSize(