You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/widgets.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,11 @@ SQL queries default to displaying as a table. Other forms of display - called wi
6
6
7
7
A query that returns columns called `bar_label` and `bar_quantity` will be rendered as a simple bar chart, using [Vega-Lite](https://vega.github.io/vega-lite/).
8
8
9
-
For example:
9
+

10
+
11
+
Bar chart live demo: [simonwillison.net/dashboard/by-month/](https://simonwillison.net/dashboard/by-month/)
12
+
13
+
SQL example:
10
14
11
15
```sql
12
16
select
@@ -34,6 +38,10 @@ If you want to display the results as a big number accompanied by a label, you c
34
38
select'Number of states'as label, count(*) as big_number from states;
35
39
```
36
40
41
+

42
+
43
+
Big number live demo: [simonwillison.net/dashboard/big-numbers-demo/](https://simonwillison.net/dashboard/big-numbers-demo/)
44
+
37
45
## Progress bar: total_count, completed_count
38
46
39
47
To display a progress bar, return columns `total_count` and `completed_count`.
@@ -42,6 +50,10 @@ To display a progress bar, return columns `total_count` and `completed_count`.
42
50
select1203as total_count, 755as completed_count;
43
51
```
44
52
53
+

54
+
55
+
Progress bar live demo: [simonwillison.net/dashboard/progress-bar-demo/](https://simonwillison.net/dashboard/progress-bar-demo/)
56
+
45
57
## Word cloud: wordcloud_word, wordcloud_count
46
58
47
59
To display a word cloud, return a column `wordcloud_word` containing words with a corresponding `wordcloud_count` column with the frequency of those words.
@@ -89,6 +101,10 @@ order by
89
101
count(*) desc
90
102
```
91
103
104
+

105
+
106
+
Word cloud live demo: [simonwillison.net/dashboard/tag-cloud/](https://simonwillison.net/dashboard/tag-cloud/)
107
+
92
108
## markdown
93
109
94
110
Return a single column called `markdown` to render the contents as Markdown, for example:
0 commit comments