Skip to content

Commit b1f2b5b

Browse files
committed
Add example
1 parent 77009ac commit b1f2b5b

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
select
2+
'chart' as component,
3+
'Quarterly Revenue' as title,
4+
'area' as type,
5+
'indigo' as color,
6+
5 as marker,
7+
TRUE as time;
8+
select
9+
'2022-01-01T00:00:00Z' as x,
10+
15 as y;
11+
select
12+
'2022-04-01T00:00:00Z' as x,
13+
46 as y;
14+
select
15+
'2022-07-01T00:00:00Z' as x,
16+
23 as y;
17+
select
18+
'2022-10-01T00:00:00Z' as x,
19+
70 as y;
20+
select
21+
'2023-01-01T00:00:00Z' as x,
22+
35 as y;
23+
select
24+
'2023-04-01T00:00:00Z' as x,
25+
106 as y;
26+
select
27+
'2023-07-01T00:00:00Z' as x,
28+
53 as y;
29+
30+
31+

examples/official-site/sqlpage/migrations/31_card_docs_update.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
3030
the output of other sql files rendered by SQLPage. For the latter case you can pass the
3131
`?_sqlpage_embed` query parameter, which will skip the shell layout', 'TEXT', FALSE, TRUE)
3232
) x;
33-
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
INSERT INTO example(component, description, properties) VALUES
2+
('card', 'The most basic card', json('[{"component":"card"},{"description":"A"},{"description":"B"},{"description":"C"}]')),
3+
('card', 'A card with a Markdown description',
4+
json('[{"component":"card", "columns": 2}, {"title":"A card with a Markdown description", "description_md": "This is a card with a **Markdown** description. \n\n'||
5+
'This is useful if you want to display a lot of text in the card, with many options for formatting, such as '||
6+
'\n - **bold**, \n - *italics*, \n - [links](index.sql), \n - etc."}]')),
7+
('card', 'A beautiful card grid with bells and whistles, showing examples of SQLPage features.',
8+
json('[{"component":"card", "title":"Popular SQLPage features", "columns": 2},
9+
{"title": "Download as spreadsheet", "link": "?component=csv#component", "description": "Using the CSV component, you can download your data as a spreadsheet.", "icon":"file-plus", "color": "green", "footer_md": "SQLPage can both [read](?component=form#component) and [write](?component=csv#component) **CSV** files."},
10+
{"title": "Custom components", "link": "/custom_components.sql", "description": "If you know some HTML, you can create your own components for your application.", "icon":"code", "color": "orange", "footer_md": "You can look at the [source of the official components](https://github.com/lovasoa/SQLpage/tree/main/sqlpage/templates) for inspiration."}
11+
]')),
12+
('card', 'A gallery of images.',
13+
json('[
14+
{"component":"card", "title":"My favorite animals in pictures", "columns": 3},
15+
{"title": "Lynx", "description_md": "The **lynx** is a medium-sized **wild cat** native to Northern, Central and Eastern Europe to Central Asia and Siberia, the Tibetan Plateau and the Himalayas.", "top_image": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d8/Lynx_lynx-4.JPG/640px-Lynx_lynx-4.JPG", "icon":"star" },
16+
{"title": "Squirrel", "description_md": "The **chipmunk** is a small, striped rodent of the family Sciuridae. Chipmunks are found in North America, with the exception of the Siberian chipmunk which is found primarily in Asia.", "top_image": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Tamias-rufus-001.jpg/640px-Tamias-rufus-001.jpg" },
17+
{"title": "Spider", "description_md": "The **jumping spider family** (_Salticidae_) contains more than 600 described genera and about *6000 described species*, making it the largest family of spiders with about 13% of all species.", "top_image": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Jumping_spiders_%28Salticidae%29.jpg/640px-Jumping_spiders_%28Salticidae%29.jpg" }
18+
]')),
19+
('card', 'Cards with remote content',
20+
json('[
21+
{"component":"card", "title":"Card with embedded remote content", "columns": 2},
22+
{"title": "Embedded Chart", "embed": "/embeds/chart.sql?_sqlpage_embed" },
23+
{"title": "Description", "description_md": "You can find the sql file that generates the chart [here](https://github.com/lovasoa/SQLpage/tree/main/examples/embeds/chart.sql)" }
24+
]'));
25+
26+
27+

0 commit comments

Comments
 (0)