-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init setup for altair chart migration
- Loading branch information
1 parent
20da70d
commit 2a7f484
Showing
6 changed files
with
128 additions
and
33 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
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,29 @@ | ||
import streamlit as st | ||
import pandas as pd | ||
import matplotlib.pyplot as plt | ||
|
||
# Sample data (replace with your actual data) | ||
data = {'day_of_year': ['2022-01-01', '2022-01-02', '2022-01-03'], | ||
'tasks_created': [10, 15, 20], | ||
'tasks_modified': [5, 10, 15], | ||
'tasks_completed': [2, 8, 12]} | ||
|
||
df = pd.DataFrame(data) | ||
|
||
# Convert 'day_of_year' to datetime for proper plotting | ||
df['day_of_year'] = pd.to_datetime(df['day_of_year'].date()) | ||
|
||
# Streamlit App | ||
st.title('Activity Counts Over Time') | ||
|
||
# Line Chart | ||
st.area_chart(df.set_index('day_of_year')) | ||
|
||
# Data Table (optional) | ||
st.write("Activity Data:") | ||
st.dataframe(df) | ||
|
||
# You can add more Streamlit components, sliders, date pickers, etc., for interactivity | ||
|
||
# # Show the app | ||
# st.show() |
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 @@ | ||
with source as ( | ||
|
||
select | ||
fld_folder_name, | ||
l_list_name, | ||
datepart('day',active) as day, | ||
datepart('month',active) as month, | ||
datepart('year',active) as year, | ||
count(*) as cnt | ||
from | ||
( | ||
select | ||
td_completed_time::timestamp as active, | ||
* | ||
from obt) a | ||
group by | ||
fld_folder_name, | ||
l_list_name, | ||
datepart('day',active), | ||
datepart('month',active), | ||
datepart('year',active) | ||
), | ||
|
||
task_level as ( | ||
select count(*) as tasks_completed, day,month,year | ||
|
||
from source group by day,month,year | ||
|
||
|
||
) | ||
|
||
select * | ||
,(year||'-'||month||'-'||day)::date as key | ||
,(year||'-'||month||'-'||day) as day_of_year | ||
from task_level | ||
|
||
|
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 @@ | ||
with source as ( | ||
|
||
select | ||
fld_folder_name, | ||
l_list_name, | ||
datepart('day',active) as day, | ||
datepart('month',active) as month, | ||
datepart('year',active) as year, | ||
count(*) as cnt | ||
from | ||
( | ||
select | ||
td_created_time::timestamp as active, | ||
* | ||
from obt) a | ||
group by | ||
fld_folder_name, | ||
l_list_name, | ||
datepart('day',active), | ||
datepart('month',active), | ||
datepart('year',active) | ||
), | ||
|
||
task_level as ( | ||
select count(*) as tasks_created, day,month,year | ||
|
||
from source group by day,month,year | ||
|
||
|
||
) | ||
|
||
select * | ||
,(year||'-'||month||'-'||day)::date as key | ||
,(year||'-'||month||'-'||day) as day_of_year | ||
from task_level | ||
|
||
|
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
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