mirror of
https://github.com/calfmoon/node-factor.git
synced 2026-07-22 05:42:24 +00:00
feat(calc): add letter count as factor effecting node size
This commit is contained in:
parent
9155817954
commit
7998b23ea4
1 changed files with 12 additions and 1 deletions
13
src/main.ts
13
src/main.ts
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue