From 61e9322eb889cf477bc7c226ef6ace7254a4d6ae Mon Sep 17 00:00:00 2001 From: PowerPlop Date: Thu, 5 Jun 2025 11:10:50 +0200 Subject: [PATCH 1/3] Update searchparameters in docs --- .../docs/pages/core-concepts/filters/index.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sites/docs/pages/core-concepts/filters/index.md b/sites/docs/pages/core-concepts/filters/index.md index 9e45cfe2c8..bd70b195ec 100644 --- a/sites/docs/pages/core-concepts/filters/index.md +++ b/sites/docs/pages/core-concepts/filters/index.md @@ -83,4 +83,21 @@ group by 1 x=month y=sales_usd /> -```` \ No newline at end of file +```` + +## Filtering a query with a search parameter in URL + +Every search parameter defined in the URL can be accessed and used as filter by using `{$page.url.searchParams.get('myParam')}` + +The search parameter should be defined as `.../pagename/?myParam=...` +``` + +``` + + + +URL parameters can be useful to share a specific page or present a view with predefined filters. + + + + From a5d4768751e07d5f69c1d6d09e347a7d6cbac4c0 Mon Sep 17 00:00:00 2001 From: PowerPlop Date: Thu, 5 Jun 2025 11:56:04 +0200 Subject: [PATCH 2/3] Add docs small multiple --- .../components/charts/small-multiple/index.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sites/docs/pages/components/charts/small-multiple/index.md diff --git a/sites/docs/pages/components/charts/small-multiple/index.md b/sites/docs/pages/components/charts/small-multiple/index.md new file mode 100644 index 0000000000..22a493dab2 --- /dev/null +++ b/sites/docs/pages/components/charts/small-multiple/index.md @@ -0,0 +1,45 @@ +--- +title: Small Multiple +description: Display a series of similar graphs or charts using the same scale and axes +sidebar_position: 96 +--- + +Use a small multiple to display a series of similar graphs or charts using the same scale and axes. +A small multiple can be created by using the grid, loop and query functions option in combination with a unique list of horizontal and vertical axes. + + 1. Define unique lists for axes + 2. Define grid + 3. Define loops for horizontal and/or veritical grid + 4. Filter chart value with query function + + +# Example + +```sql categories +select distinct category as name from needful_things.orders +``` + +```sql orders_by_category +select category, order_month as month, sum(sales) as sales_usd0k, count(1) as orders from needful_things.orders +group by all +``` + + +{#each categories as category} + + + +{/each} + + + + + + From 55f0e20bc817845e2e87d2327b79f0731cc4bcb6 Mon Sep 17 00:00:00 2001 From: PowerPlop Date: Tue, 29 Jul 2025 06:52:09 +0000 Subject: [PATCH 3/3] add doctab and change subtitle to category name --- .../components/charts/small-multiple/index.md | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sites/docs/pages/components/charts/small-multiple/index.md b/sites/docs/pages/components/charts/small-multiple/index.md index 22a493dab2..873c11d2cb 100644 --- a/sites/docs/pages/components/charts/small-multiple/index.md +++ b/sites/docs/pages/components/charts/small-multiple/index.md @@ -15,6 +15,7 @@ A small multiple can be created by using the grid, loop and query functions opti # Example + ```sql categories select distinct category as name from needful_things.orders ``` @@ -24,22 +25,36 @@ select category, order_month as month, sum(sales) as sales_usd0k, count(1) as or group by all ``` + + {#each categories as category} - {/each} +```markdown + +{#each categories as category} - - + +{/each} + +``` +