vault backup: 2026-04-17 22:55:10
This commit is contained in:
65
🏡HOME.md
65
🏡HOME.md
@@ -8,25 +8,52 @@ aliases:
|
||||
日期: 2026/4/16
|
||||
---
|
||||
## 准备将这个页面作为导航页,还没想好怎么做
|
||||
```heatmap-tracker
|
||||
heatmapTitle: 笔记活跃度
|
||||
heatmapSubtitle: "全库动态追踪"
|
||||
# 核心修改:使用 file.mday (修改日期) 或 file.cday (创建日期)
|
||||
property: file.mday
|
||||
# 范围修改:留空代表统计全库,或者写 "/"
|
||||
folderPath: "/"
|
||||
year: 2026
|
||||
separateMonths: true
|
||||
showCurrentDayBorder: true
|
||||
# 颜色修改:使用经典绿色系
|
||||
colorScheme:
|
||||
paletteName: green
|
||||
# 这里的 intensity 决定了颜色深浅的阈值
|
||||
intensity:
|
||||
- 1
|
||||
- 3
|
||||
- 5
|
||||
- 10
|
||||
```dataviewjs
|
||||
// 1. 获取全库页面 (排除附件和模板,避免干扰)
|
||||
const pages = dv.pages('!"Template" and !"Attachments"');
|
||||
|
||||
// 2. 统计每天的数据
|
||||
const activityMap = new Map();
|
||||
|
||||
pages.forEach(p => {
|
||||
// 获取创建日期和修改日期
|
||||
const dates = [
|
||||
window.moment(p.file.cday.ts).format("YYYY-MM-DD"),
|
||||
window.moment(p.file.mday.ts).format("YYYY-MM-DD")
|
||||
];
|
||||
|
||||
// 获取权重:使用文件大小 (Bytes),这是反映“活跃度”最稳健的指标
|
||||
const weight = p.file.size || 0;
|
||||
|
||||
// 对创建和修改日期都进行打点
|
||||
dates.forEach(d => {
|
||||
activityMap.set(d, (activityMap.get(d) || 0) + weight);
|
||||
});
|
||||
});
|
||||
|
||||
// 3. 转换为渲染条目
|
||||
const entries = [];
|
||||
for (let [date, value] of activityMap) {
|
||||
entries.push({
|
||||
date: date,
|
||||
intensity: value,
|
||||
content: "" // 关键修改:设为空,彻底去除格子上的文字
|
||||
});
|
||||
}
|
||||
|
||||
// 4. 渲染
|
||||
renderHeatmapTracker(this.container, {
|
||||
year: 2026,
|
||||
entries: entries,
|
||||
colors: "green",
|
||||
showValue: true, // 鼠标悬停时依然能看到数值,但格子表面是干净的
|
||||
// 根据你的库大小,调整颜色深浅的阈值(单位:字节)
|
||||
intensity: [
|
||||
{ min: 1, color: "#9be9a8" }, // 有轻微改动
|
||||
{ min: 100, color: "#40c463" }, // 中度活跃
|
||||
{ min: 1000, color: "#30a14e" }, // 深度编辑
|
||||
{ min: 5000, color: "#216e39" } // 爆更状态
|
||||
]
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user