Spaces:
Build error
Build error
Vlad Bastina commited on
Commit ·
c934cc9
1
Parent(s): 388906c
styles
Browse files- app_generated.py +24 -9
- style.css +28 -1
app_generated.py
CHANGED
|
@@ -353,14 +353,6 @@ st.title("Data Analysis Agent Interface")
|
|
| 353 |
|
| 354 |
st.write(" In this demo, you'll explore a sample CSV file containing sales data—such as product names, regions, dates, and revenue figures. Simply type in natural language questions like “What were the best-selling products in March?” or “How did sales vary by region?” and the tool will instantly generate clear reports and visualizations. No technical skills needed—just ask and explore.")
|
| 355 |
|
| 356 |
-
st.sidebar.markdown(
|
| 357 |
-
f"""
|
| 358 |
-
<div style="text-align: center;">
|
| 359 |
-
Powered by <img src="data:image/png;base64,{get_zega_logo_base64()}" style="height: 100px;">
|
| 360 |
-
</div>
|
| 361 |
-
""",
|
| 362 |
-
unsafe_allow_html=True,
|
| 363 |
-
)
|
| 364 |
st.sidebar.header("Sample Questions")
|
| 365 |
|
| 366 |
sample_questions = [
|
|
@@ -517,4 +509,27 @@ if "chat_response" in st.session_state:
|
|
| 517 |
mime="application/pdf",
|
| 518 |
)
|
| 519 |
except Exception as e:
|
| 520 |
-
st.error(f"PDF generation failed: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
|
| 354 |
st.write(" In this demo, you'll explore a sample CSV file containing sales data—such as product names, regions, dates, and revenue figures. Simply type in natural language questions like “What were the best-selling products in March?” or “How did sales vary by region?” and the tool will instantly generate clear reports and visualizations. No technical skills needed—just ask and explore.")
|
| 355 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
st.sidebar.header("Sample Questions")
|
| 357 |
|
| 358 |
sample_questions = [
|
|
|
|
| 509 |
mime="application/pdf",
|
| 510 |
)
|
| 511 |
except Exception as e:
|
| 512 |
+
st.error(f"PDF generation failed: {e}")
|
| 513 |
+
|
| 514 |
+
import streamlit.components.v1 as components
|
| 515 |
+
components.html(
|
| 516 |
+
"""
|
| 517 |
+
<script>
|
| 518 |
+
function sendHeightWhenReady() {
|
| 519 |
+
const el = window.parent.document.getElementsByClassName('st-emotion-cache-b95f0i')[0];
|
| 520 |
+
if (el) {
|
| 521 |
+
const height = el.scrollHeight;
|
| 522 |
+
console.log("Sending height to parent:", height);
|
| 523 |
+
window.parent.parent.postMessage({ type: 'setHeight', height: height }, '*');
|
| 524 |
+
} else {
|
| 525 |
+
// Retry in 100ms until the element appears
|
| 526 |
+
setTimeout(sendHeightWhenReady, 1000);
|
| 527 |
+
}
|
| 528 |
+
}
|
| 529 |
+
|
| 530 |
+
window.onload = sendHeightWhenReady;
|
| 531 |
+
window.addEventListener('resize', sendHeightWhenReady);
|
| 532 |
+
setInterval(sendHeightWhenReady, 1000);
|
| 533 |
+
</script>
|
| 534 |
+
"""
|
| 535 |
+
)
|
style.css
CHANGED
|
@@ -94,4 +94,31 @@ body {
|
|
| 94 |
.st-emotion-cache-t1wise {
|
| 95 |
padding: 0 54px !important;
|
| 96 |
}
|
| 97 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
.st-emotion-cache-t1wise {
|
| 95 |
padding: 0 54px !important;
|
| 96 |
}
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
[data-testid="stSidebarContent"] {
|
| 100 |
+
border: 1px solid #C0CDF5 !important;
|
| 101 |
+
background: white !important;
|
| 102 |
+
border-radius: 18px;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.st-emotion-cache-11ig4q4 {
|
| 106 |
+
background-color: transparent !important;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.st-emotion-cache-mtjnbi {
|
| 110 |
+
padding: 0 !important;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.st-ba {
|
| 114 |
+
border-bottom-color: rgba(49, 51, 63, 0.2) !important;
|
| 115 |
+
}
|
| 116 |
+
.st-b9 {
|
| 117 |
+
border-top-color: rgba(49, 51, 63, 0.2) !important;
|
| 118 |
+
}
|
| 119 |
+
.st-b8 {
|
| 120 |
+
border-right-color: rgba(49, 51, 63, 0.2) !important;
|
| 121 |
+
}
|
| 122 |
+
.st-b7 {
|
| 123 |
+
border-left-color: rgba(49,51,63,0.2) !important;
|
| 124 |
+
}
|