From 4ed3eb9485583b46894271b887d63e36cb602343 Mon Sep 17 00:00:00 2001 From: Archie Wood <58074498+archiewood@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:05:23 -0500 Subject: [PATCH] tidy a few docs pages --- .../components/charts/sankey-diagram/index.md | 40 ++++++++--------- .../custom/component-queries/index.md | 2 - .../pages/components/inputs/checkbox/index.md | 6 +-- .../pages/components/inputs/slider/index.md | 43 +++++++++++++------ 4 files changed, 51 insertions(+), 40 deletions(-) diff --git a/sites/docs/pages/components/charts/sankey-diagram/index.md b/sites/docs/pages/components/charts/sankey-diagram/index.md index 7174cfe6f5..dd59f0404d 100644 --- a/sites/docs/pages/components/charts/sankey-diagram/index.md +++ b/sites/docs/pages/components/charts/sankey-diagram/index.md @@ -59,7 +59,9 @@ select 'all_traffic' as source, '/about' as target, 75 as count ``` -## Vertical +## Examples + +### Vertical
@@ -77,7 +79,7 @@ select 'all_traffic' as source, '/about' as target, 75 as count ``` -# Echarts Options String +### Echarts Options String
@@ -113,7 +115,7 @@ select 'all_traffic' as source, '/about' as target, 75 as count ``` -# Node Depth Override +### Node Depth Override ```sql apple_income_statement @@ -167,11 +169,9 @@ select 'revenue' as source, 'cost of revenue' as target, 55 as amount_usd -# Labels - -## Node Labels +### Labels -### `nodeLabels=name` (default) +#### `nodeLabels=name` (default)
@@ -198,7 +198,7 @@ select 'revenue' as source, 'cost of revenue' as target, 55 as amount_usd -### `nodeLabels=value` +#### `nodeLabels=value`
@@ -228,7 +228,7 @@ The value labels can be formatted using the `valueFmt` option. -### `nodeLabels=full` +#### `nodeLabels=full`
@@ -256,9 +256,7 @@ The value labels can be formatted using the `valueFmt` option. ``` -## Link Labels - -### `linkLabels=full` (default) +#### `linkLabels=full` (default) Requires `percentCol` to show percentage beside value @@ -288,7 +286,7 @@ Requires `percentCol` to show percentage beside value -### `linkLabels=value` +#### `linkLabels=value`
@@ -317,7 +315,7 @@ Requires `percentCol` to show percentage beside value -### `linkLabels=percent` +#### `linkLabels=percent`
@@ -345,7 +343,7 @@ Requires `percentCol` to show percentage beside value ``` -## Custom Color Palette +### Custom Color Palette
@@ -374,9 +372,9 @@ Requires `percentCol` to show percentage beside value -## Link Colors +### Link Colors -### `linkColor=grey` (default) +#### `linkColor=grey` (default)
@@ -405,7 +403,7 @@ Requires `percentCol` to show percentage beside value -### `linkColor=source` +#### `linkColor=source`
@@ -433,7 +431,7 @@ Requires `percentCol` to show percentage beside value ``` -### `linkColor=target` +#### `linkColor=target`
@@ -462,7 +460,7 @@ Requires `percentCol` to show percentage beside value -### `linkColor=gradient` +#### `linkColor=gradient`
@@ -491,7 +489,7 @@ Requires `percentCol` to show percentage beside value -## Multi-level +### Multi-level The syntax for multi-level sankey diagrams is the same, but the underlying query must represent all the levels using the same diff --git a/sites/docs/pages/components/custom/component-queries/index.md b/sites/docs/pages/components/custom/component-queries/index.md index 3b314ddf1c..1ffa7b86f9 100644 --- a/sites/docs/pages/components/custom/component-queries/index.md +++ b/sites/docs/pages/components/custom/component-queries/index.md @@ -4,8 +4,6 @@ description: Execute SQL queries from inside custom components. sidebar_position: 2 --- -# Component Queries - Component queries allow you to run SQL queries in your component code. Component queries transform how we build data visualizations. Instead of passing data down through props from parent pages, components become self-contained units that can request exactly what they need. This independence makes components more reusable and easier to maintain, as all the logic for both fetching and displaying data lives in one place. diff --git a/sites/docs/pages/components/inputs/checkbox/index.md b/sites/docs/pages/components/inputs/checkbox/index.md index 56550bf128..1d39b3cd54 100644 --- a/sites/docs/pages/components/inputs/checkbox/index.md +++ b/sites/docs/pages/components/inputs/checkbox/index.md @@ -22,6 +22,8 @@ Creates a checkbox with toggleable input. The Title and Name attributes can be d ```` +## Examples + ### Checkbox using Default Value Defining the defaultValue property will set the initial checked value with true and false. @@ -98,10 +100,6 @@ WHERE not ${inputs.exclude_low_value} -- When True, Do not evaluate the next co - - -# Checkbox - ## Options -Min and Max values can be defined, the step property and define the incremental value of the slider +## Examples + +### Step
@@ -50,7 +52,8 @@ Min and Max values can be defined, the step property and define the incremental ```` -showMaxMin property can hide the Max and Min values with false, by default showMaxMin is true +### Hide Min and Max values +
@@ -74,7 +77,7 @@ showMaxMin property can hide the Max and Min values with false, by default showM ```` -The default size of the slider can be altered with the size property using; medium, large or full +### Size
@@ -149,18 +152,22 @@ The default size of the slider can be altered with the size property using; medi -````sql flight_data - SELECT - CAST(fare AS INT) AS fare, - CAST((SELECT MAX(fare) FROM flights) AS INT) AS max_fare, - FROM flights - LIMIT 100 -```` +### Specifying Dynamic Columns -## Specifying Dynamic Columns -Supply data with specified column names for minColumn, maxColumn, and/or defaultValue. The first row’s value in each of these columns will determine the minimum, maximum, or default value, respectively. +```sql flight_data +SELECT +CAST(fare AS INT) AS fare, +CAST((SELECT MAX(fare) FROM flights) AS INT) AS max_fare, +FROM flights +LIMIT 100 +``` + +The first row’s value in each of these columns will determine the minimum, maximum, or default value, respectively. + + +
+
````markdown +```sql flight_data +SELECT +CAST(fare AS INT) AS fare, +CAST((SELECT MAX(fare) FROM flights) AS INT) AS max_fare, +FROM flights +LIMIT 100 +``` + + ```` +
-# Slider ## Options