Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -109,20 +109,23 @@ st.write(
|
|
109 |
"See more in our public [GitHub repository](https://github.com/streamlit/example-app-time-series-annotation)"
|
110 |
)
|
111 |
|
112 |
-
|
113 |
-
f"""
|
114 |
import altair as alt
|
115 |
import pandas as pd
|
116 |
import streamlit as st
|
117 |
from vega_datasets import data
|
|
|
118 |
@st.experimental_memo
|
119 |
def get_data():
|
120 |
source = data.stocks()
|
121 |
source = source[source.date.gt("2004-01-01")]
|
122 |
return source
|
123 |
source = get_data()
|
|
|
124 |
# Original time series chart. Omitted `get_chart` for clarity
|
|
|
125 |
chart = get_chart(source)
|
|
|
126 |
# Input annotations
|
127 |
ANNOTATIONS = [
|
128 |
("Mar 01, 2008", "Pretty good day for GOOG"),
|
@@ -144,6 +147,7 @@ annotation_layer = (
|
|
144 |
)
|
145 |
.interactive()
|
146 |
)
|
|
|
147 |
# Display both charts together
|
148 |
st.altair_chart((chart + annotation_layer).interactive(), use_container_width=True)
|
149 |
""",
|
|
|
109 |
"See more in our public [GitHub repository](https://github.com/streamlit/example-app-time-series-annotation)"
|
110 |
)
|
111 |
|
112 |
+
|
|
|
113 |
import altair as alt
|
114 |
import pandas as pd
|
115 |
import streamlit as st
|
116 |
from vega_datasets import data
|
117 |
+
|
118 |
@st.experimental_memo
|
119 |
def get_data():
|
120 |
source = data.stocks()
|
121 |
source = source[source.date.gt("2004-01-01")]
|
122 |
return source
|
123 |
source = get_data()
|
124 |
+
|
125 |
# Original time series chart. Omitted `get_chart` for clarity
|
126 |
+
|
127 |
chart = get_chart(source)
|
128 |
+
|
129 |
# Input annotations
|
130 |
ANNOTATIONS = [
|
131 |
("Mar 01, 2008", "Pretty good day for GOOG"),
|
|
|
147 |
)
|
148 |
.interactive()
|
149 |
)
|
150 |
+
|
151 |
# Display both charts together
|
152 |
st.altair_chart((chart + annotation_layer).interactive(), use_container_width=True)
|
153 |
""",
|