vault backup: 2026-01-10 13:26:01
This commit is contained in:
40
HomePage.md
40
HomePage.md
@@ -312,7 +312,7 @@ dv.paragraph(md);
|
||||
```
|
||||
---
|
||||
|
||||
![[Veranstaltungen - 2025]]
|
||||
![[Veranstaltungen - 2026]]
|
||||
|
||||
---
|
||||
|
||||
@@ -484,10 +484,10 @@ if (tagEntries.length === 0) {
|
||||
window.renderChart(chartData, wrapper);
|
||||
}
|
||||
```
|
||||
|
||||
```dataviewjs
|
||||
// === Config ===
|
||||
const splitOnSlash = false; // true -> merge hierarchical tags (#project/obsidian -> project)
|
||||
const topN = 20; // show top N tags (null for all)
|
||||
|
||||
// === Catppuccin Mocha Palette ===
|
||||
const catppuccin = {
|
||||
@@ -527,6 +527,9 @@ const catppuccinColors = [
|
||||
catppuccin.mauve
|
||||
];
|
||||
|
||||
// Set topN to match the number of available colors
|
||||
const topN = catppuccinColors.length;
|
||||
|
||||
// === Helpers ===
|
||||
function flattenTags(input, out = []) {
|
||||
if (!input) return out;
|
||||
@@ -576,11 +579,9 @@ const tagEntries = Object.entries(counts);
|
||||
if (tagEntries.length === 0) {
|
||||
dv.el("p", "⚠️ No tags found in your vault.");
|
||||
} else {
|
||||
// === Sort + limit ===
|
||||
// === Sort + limit to color array length ===
|
||||
tagEntries.sort((a, b) => b[1] - a[1]);
|
||||
const limited = (topN && tagEntries.length > topN)
|
||||
? tagEntries.slice(0, topN)
|
||||
: tagEntries;
|
||||
const limited = tagEntries.slice(0, topN);
|
||||
|
||||
const labels = limited.map(e => toTitleCase(e[0].replace(/[-_]/g, ' ')));
|
||||
const dataValues = limited.map(e => e[1]);
|
||||
@@ -589,7 +590,7 @@ if (tagEntries.length === 0) {
|
||||
// === Colors ===
|
||||
const bgColors = [], borderColors = [];
|
||||
for (let i = 0; i < labels.length; i++) {
|
||||
const color = catppuccinColors[i % catppuccinColors.length];
|
||||
const color = catppuccinColors[i];
|
||||
bgColors.push(color + "aa");
|
||||
borderColors.push(color);
|
||||
}
|
||||
@@ -603,18 +604,19 @@ if (tagEntries.length === 0) {
|
||||
wrapper.style.padding = '8px';
|
||||
wrapper.style.overflow = 'auto';
|
||||
|
||||
// === Center label ===
|
||||
const centerLabel = document.createElement('div');
|
||||
centerLabel.style.position = 'absolute';
|
||||
centerLabel.style.top = '50%';
|
||||
centerLabel.style.left = '44%';
|
||||
centerLabel.style.transform = 'translate(-50%, -50%)';
|
||||
centerLabel.style.color = catppuccin.text;
|
||||
centerLabel.style.fontSize = '14px';
|
||||
centerLabel.style.fontWeight = '600';
|
||||
centerLabel.style.textAlign = 'center';
|
||||
centerLabel.innerText = 'Tag Usage';
|
||||
wrapper.appendChild(centerLabel);
|
||||
// === Center label ===
|
||||
const centerLabel = document.createElement('div');
|
||||
centerLabel.style.position = 'absolute';
|
||||
centerLabel.style.top = '55%';
|
||||
centerLabel.style.left = '45%';
|
||||
centerLabel.style.transform = 'translate(-50%, -50%)';
|
||||
centerLabel.style.color = catppuccin.text;
|
||||
centerLabel.style.fontSize = '14px';
|
||||
centerLabel.style.fontWeight = '600';
|
||||
centerLabel.style.textAlign = 'center';
|
||||
centerLabel.style.pointerEvents = 'none';
|
||||
centerLabel.innerText = 'Tag Usage';
|
||||
wrapper.appendChild(centerLabel);
|
||||
|
||||
// === Chart.js config ===
|
||||
const chartData = {
|
||||
|
||||
Reference in New Issue
Block a user