2025-03-08 08:49:34 +00:00
|
|
|
import { App, PluginSettingTab, Setting } from "obsidian";
|
|
|
|
|
|
|
|
|
|
import NodeFactor from "./main";
|
|
|
|
|
|
2025-03-13 06:11:27 +00:00
|
|
|
export default class NodeFactorSettingTab extends PluginSettingTab {
|
2025-03-08 08:49:34 +00:00
|
|
|
plugin: NodeFactor;
|
|
|
|
|
|
|
|
|
|
constructor(app: App, plugin: NodeFactor) {
|
|
|
|
|
super(app, plugin);
|
|
|
|
|
this.plugin = plugin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
display(): void {
|
|
|
|
|
const { containerEl } = this;
|
|
|
|
|
containerEl.empty();
|
|
|
|
|
|
|
|
|
|
new Setting(containerEl)
|
|
|
|
|
.setName("Forward link weight multiplier")
|
2025-04-01 18:40:21 +00:00
|
|
|
.setDesc("Multiplier for forward links weight (0 to disable).")
|
2025-03-08 08:49:34 +00:00
|
|
|
.addSlider((slider) =>
|
|
|
|
|
slider
|
|
|
|
|
.setLimits(0, 20, 1)
|
|
|
|
|
.setDynamicTooltip()
|
|
|
|
|
.setValue(this.plugin.settings.fwdMultiplier)
|
|
|
|
|
.onChange(async (value) => {
|
2025-03-28 11:43:56 +00:00
|
|
|
this.plugin.clearSizeCache();
|
2025-03-08 08:49:34 +00:00
|
|
|
this.plugin.settings.fwdMultiplier = value;
|
|
|
|
|
await this.plugin.saveSettings();
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
new Setting(containerEl)
|
|
|
|
|
.setName("Travel forward tree")
|
|
|
|
|
.setDesc("Travel forward tree to calcuate node size.")
|
|
|
|
|
.addToggle((toggle) =>
|
|
|
|
|
toggle
|
|
|
|
|
.setValue(this.plugin.settings.fwdTree)
|
|
|
|
|
.onChange(async (value) => {
|
2025-03-28 11:43:56 +00:00
|
|
|
this.plugin.clearSizeCache();
|
2025-03-08 08:49:34 +00:00
|
|
|
this.plugin.settings.fwdTree = value;
|
|
|
|
|
await this.plugin.saveSettings();
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
new Setting(containerEl)
|
|
|
|
|
.setName("Backward link weight multiplier")
|
2025-04-01 18:40:21 +00:00
|
|
|
.setDesc("Multiplier for backward links weight (0 to disable).")
|
2025-03-08 08:49:34 +00:00
|
|
|
.addSlider((slider) =>
|
|
|
|
|
slider
|
|
|
|
|
.setLimits(0, 20, 1)
|
|
|
|
|
.setDynamicTooltip()
|
|
|
|
|
.setValue(this.plugin.settings.bwdMultiplier)
|
|
|
|
|
.onChange(async (value) => {
|
2025-03-28 11:43:56 +00:00
|
|
|
this.plugin.clearSizeCache();
|
2025-03-08 08:49:34 +00:00
|
|
|
this.plugin.settings.bwdMultiplier = value;
|
|
|
|
|
await this.plugin.saveSettings();
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
new Setting(containerEl)
|
|
|
|
|
.setName("Character per weight")
|
|
|
|
|
.setDesc(
|
|
|
|
|
"Add 1 weight to node size per no of given Character (0 to disable).",
|
|
|
|
|
)
|
|
|
|
|
.addSlider((slider) =>
|
|
|
|
|
slider
|
|
|
|
|
.setLimits(0, 5000, 100)
|
|
|
|
|
.setDynamicTooltip()
|
|
|
|
|
.setValue(this.plugin.settings.lettersPerWt)
|
|
|
|
|
.onChange(async (value) => {
|
|
|
|
|
this.plugin.settings.lettersPerWt = value;
|
|
|
|
|
await this.plugin.saveSettings();
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|