Spaces:
Runtime error
Runtime error
Tomatolinn
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,17 @@
|
|
1 |
# start with the setup
|
2 |
|
3 |
# supress warnings about future deprecations
|
4 |
-
import warnings
|
5 |
-
warnings.simplefilter(action='ignore', category=FutureWarning)
|
6 |
-
|
7 |
import pandas as pd
|
8 |
import altair as alt
|
9 |
import numpy as np
|
10 |
import pprint
|
11 |
import datetime as dt
|
12 |
from vega_datasets import data
|
13 |
-
import
|
|
|
14 |
|
15 |
# Solve a javascript error by explicitly setting the renderer
|
16 |
-
|
17 |
#load data
|
18 |
df2=pd.read_csv("https://raw.githubusercontent.com/dallascard/SI649_public/main/altair_hw3/approval_topline.csv")
|
19 |
# Import panel and vega datasets
|
@@ -22,7 +20,10 @@ import panel as pn
|
|
22 |
import vega_datasets
|
23 |
|
24 |
# Enable Panel extensions
|
25 |
-
pn.extension()
|
|
|
|
|
|
|
26 |
maincol = pn.Column()
|
27 |
# Define a function to create and return a plot
|
28 |
|
@@ -76,6 +77,6 @@ maincol.append(subgroup_widget)
|
|
76 |
maincol.append(date_slider)
|
77 |
maincol.append(window_widget)
|
78 |
maincol.append(bound_plot)
|
79 |
-
|
80 |
# set the app to be servable
|
81 |
-
|
|
|
1 |
# start with the setup
|
2 |
|
3 |
# supress warnings about future deprecations
|
|
|
|
|
|
|
4 |
import pandas as pd
|
5 |
import altair as alt
|
6 |
import numpy as np
|
7 |
import pprint
|
8 |
import datetime as dt
|
9 |
from vega_datasets import data
|
10 |
+
import panel as pn
|
11 |
+
import vega_datasets
|
12 |
|
13 |
# Solve a javascript error by explicitly setting the renderer
|
14 |
+
|
15 |
#load data
|
16 |
df2=pd.read_csv("https://raw.githubusercontent.com/dallascard/SI649_public/main/altair_hw3/approval_topline.csv")
|
17 |
# Import panel and vega datasets
|
|
|
20 |
import vega_datasets
|
21 |
|
22 |
# Enable Panel extensions
|
23 |
+
pn.extension(design='bootstrap')
|
24 |
+
template = pn.template.BootstrapTemplate(
|
25 |
+
title='SI649 Lab7',
|
26 |
+
)
|
27 |
maincol = pn.Column()
|
28 |
# Define a function to create and return a plot
|
29 |
|
|
|
77 |
maincol.append(date_slider)
|
78 |
maincol.append(window_widget)
|
79 |
maincol.append(bound_plot)
|
80 |
+
template.main.append(maincol)
|
81 |
# set the app to be servable
|
82 |
+
template.servable(title="SI649 Lab7")
|