Refine Dataview dashboard layout rules
This commit is contained in:
parent
363e8396b7
commit
70978a3642
|
|
@ -78,7 +78,14 @@ TABLE rows.file.link AS 文章
|
|||
GROUP BY journal
|
||||
```
|
||||
|
||||
It creates one huge list per table cell and makes journal rows look sparse. Prefer:
|
||||
Also avoid the same pattern with other short grouping fields such as `year`, `status`, or `rating`:
|
||||
|
||||
```dataview
|
||||
TABLE rows.file.link AS 文章, rows.journal AS 期刊
|
||||
GROUP BY year
|
||||
```
|
||||
|
||||
These queries create one huge list per table cell. Short columns such as `year` then waste a large amount of horizontal space while the article list still wraps badly. Prefer a compact count table:
|
||||
|
||||
```dataview
|
||||
TABLE WITHOUT ID
|
||||
|
|
@ -90,7 +97,19 @@ GROUP BY journal
|
|||
SORT length(rows) DESC, key ASC
|
||||
```
|
||||
|
||||
Then add a separate detail table:
|
||||
For year grouping, use the same compact pattern:
|
||||
|
||||
```dataview
|
||||
TABLE WITHOUT ID
|
||||
key AS 年份,
|
||||
length(rows) AS 篇数
|
||||
FROM "01 文献阅读/00 AI总结笔记"
|
||||
WHERE contains(tags, "literature") AND year
|
||||
GROUP BY year
|
||||
SORT key DESC
|
||||
```
|
||||
|
||||
Then add a separate one-row-per-paper detail table:
|
||||
|
||||
```dataview
|
||||
TABLE WITHOUT ID
|
||||
|
|
@ -102,6 +121,17 @@ WHERE contains(tags, "literature") AND journal
|
|||
SORT journal ASC, year DESC, file.name ASC
|
||||
```
|
||||
|
||||
If the page is already organized by a short field such as `year`, use that field for sorting but do not repeat it as a wide table column:
|
||||
|
||||
```dataview
|
||||
TABLE WITHOUT ID
|
||||
file.link AS 文章,
|
||||
journal AS 期刊
|
||||
FROM "01 文献阅读/00 AI总结笔记"
|
||||
WHERE contains(tags, "literature") AND year
|
||||
SORT year DESC, journal ASC, file.name ASC
|
||||
```
|
||||
|
||||
## Dataview Table Width
|
||||
|
||||
Keep main dashboard tables narrow. Put wide fields such as DOI, authors, and file modification times into separate detail pages.
|
||||
|
|
|
|||
Loading…
Reference in New Issue