-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add filter spec implementation (#276)
Add support for filter spec. Add Title and Description for Filters based on filter spec. Add support for DateRange filter. Add support for Single Select filter. Add support for Filters linked with multiple visualization widgets. Resolves: #246 #252 #168 #171 ![image](https://github.com/user-attachments/assets/c17405a8-4f9a-400f-a48c-f7e074b90108)
- Loading branch information
1 parent
7a4dc19
commit d88bb65
Showing
7 changed files
with
402 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tests/integration/dashboards/filter_spec_basic/00_0_date.filter.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"columns": ["sales_date", "inventory_date"], | ||
"title": "Date", | ||
"description": "Filter by date", | ||
"type": "DATE_RANGE_PICKER" | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/integration/dashboards/filter_spec_basic/00_1_category.filter.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"columns": ["product_category", "category"], | ||
"title": "Category", | ||
"description": "Filter by category" | ||
} |
37 changes: 37 additions & 0 deletions
37
tests/integration/dashboards/filter_spec_basic/01_0_product_sales.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* --title 'Product Sales' */ | ||
SELECT | ||
CAST(sales_date AS DATE) AS sales_date, | ||
product_category, | ||
sales_amount | ||
FROM VALUES | ||
('2023-01-01', 'Electronics', 1000.00), | ||
('2023-01-02', 'Furniture', 1200.00), | ||
('2023-01-03', 'Clothing', 1100.00), | ||
('2023-01-04', 'Electronics', 1050.00), | ||
('2023-01-05', 'Furniture', 1250.00), | ||
('2023-01-06', 'Clothing', 1150.00), | ||
('2023-01-07', 'Electronics', 1300.00), | ||
('2023-01-08', 'Furniture', 1400.00), | ||
('2023-01-09', 'Clothing', 1200.00), | ||
('2023-01-10', 'Electronics', 1350.00), | ||
('2023-01-11', 'Furniture', 1500.00), | ||
('2023-01-12', 'Clothing', 1250.00), | ||
('2023-01-13', 'Electronics', 1400.00), | ||
('2023-01-14', 'Furniture', 1550.00), | ||
('2023-01-15', 'Clothing', 1300.00), | ||
('2023-01-16', 'Electronics', 1450.00), | ||
('2023-01-17', 'Furniture', 1600.00), | ||
('2023-01-18', 'Clothing', 1350.00), | ||
('2023-01-19', 'Electronics', 1500.00), | ||
('2023-01-20', 'Furniture', 1650.00), | ||
('2023-01-21', 'Clothing', 1400.00), | ||
('2023-01-22', 'Electronics', 1550.00), | ||
('2023-01-23', 'Furniture', 1700.00), | ||
('2023-01-24', 'Clothing', 1450.00), | ||
('2023-01-25', 'Electronics', 1600.00), | ||
('2023-01-26', 'Furniture', 1750.00), | ||
('2023-01-27', 'Clothing', 1500.00), | ||
('2023-01-28', 'Electronics', 1650.00), | ||
('2023-01-29', 'Furniture', 1800.00), | ||
('2023-01-30', 'Clothing', 1550.00), | ||
('2023-01-31', 'Electronics', 1700.00) AS tab(sales_date, product_category, sales_amount) |
38 changes: 38 additions & 0 deletions
38
tests/integration/dashboards/filter_spec_basic/01_1_product_inventory.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* --title 'Product Inventory' */ | ||
SELECT | ||
CAST(inventory_date AS DATE) AS inventory_date, | ||
category, | ||
product_name, | ||
quantity | ||
FROM VALUES | ||
('2023-01-01', 'Electronics', 'Smartphone', 120), | ||
('2023-01-02', 'Furniture', 'Office Chair', 45), | ||
('2023-01-03', 'Clothing', 'T-Shirt', 200), | ||
('2023-01-04', 'Electronics', 'Laptop', 75), | ||
('2023-01-05', 'Furniture', 'Desk', 30), | ||
('2023-01-06', 'Clothing', 'Jeans', 150), | ||
('2023-01-07', 'Electronics', 'Headphones', 80), | ||
('2023-01-08', 'Furniture', 'Bookshelf', 25), | ||
('2023-01-09', 'Clothing', 'Jacket', 90), | ||
('2023-01-10', 'Electronics', 'Tablet', 65), | ||
('2023-01-11', 'Furniture', 'Dining Table', 20), | ||
('2023-01-12', 'Clothing', 'Sweater', 110), | ||
('2023-01-13', 'Electronics', 'Smartwatch', 130), | ||
('2023-01-14', 'Furniture', 'Sofa', 10), | ||
('2023-01-15', 'Clothing', 'Hoodie', 140), | ||
('2023-01-16', 'Electronics', 'Smartphone', 125), | ||
('2023-01-17', 'Furniture', 'Office Chair', 50), | ||
('2023-01-18', 'Clothing', 'T-Shirt', 210), | ||
('2023-01-19', 'Electronics', 'Laptop', 80), | ||
('2023-01-20', 'Furniture', 'Desk', 35), | ||
('2023-01-21', 'Clothing', 'Jeans', 160), | ||
('2023-01-22', 'Electronics', 'Headphones', 85), | ||
('2023-01-23', 'Furniture', 'Bookshelf', 30), | ||
('2023-01-24', 'Clothing', 'Jacket', 95), | ||
('2023-01-25', 'Electronics', 'Tablet', 70), | ||
('2023-01-26', 'Furniture', 'Dining Table', 25), | ||
('2023-01-27', 'Clothing', 'Sweater', 115), | ||
('2023-01-28', 'Electronics', 'Smartwatch', 135), | ||
('2023-01-29', 'Furniture', 'Sofa', 15), | ||
('2023-01-30', 'Clothing', 'Hoodie', 145), | ||
('2023-01-31', 'Electronics', 'Smartphone', 130) AS inventory_data(inventory_date, category, product_name, quantity) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.