Skip to content

Commit

Permalink
add uoload dataset recommended file naming hover effect (#153)
Browse files Browse the repository at this point in the history
Co-authored-by: YUAN TIAN <[email protected]>
  • Loading branch information
tianyuanzoe and YUAN TIAN authored Nov 19, 2024
1 parent e65f026 commit 0906e89
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/autogluon/assistant/ui/file_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,18 @@ def file_uploader():
"""
Handle file uploads
"""
st.markdown("#### Upload Dataset")
header_html = """
<div class="header-hover">
<h4>Upload Dataset</h4>
<div class="tooltip">
Recommended file naming:<br>
• train.csv/xlsx<br>
• test.csv/xlsx<br>
• sample_dataset.csv/xlsx
</div>
</div>
"""
st.markdown(header_html, unsafe_allow_html=True)
uploaded_files = st.file_uploader(
"Select the dataset", accept_multiple_files=True, label_visibility="collapsed", type=["csv", "xlsx"]
)
Expand Down
30 changes: 29 additions & 1 deletion src/autogluon/assistant/ui/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,32 @@ div[data-testid='stExpanderDetails'] p{
padding-left: 5vw;
padding-top: 2vh;
}
}
}
/* Hover css for uploaded file widget*/
.header-hover {
position: relative;
display: inline-block;
}

.header-hover .tooltip {
visibility: hidden;
position: absolute;
background-color: rgba(0, 0, 0, 0.8);
color: white;
text-align: left;
padding: 8px;
border-radius: 4px;
z-index: 1000;
width: 250px;
top: 100%;
left: 0;
margin-top: 5px;
font-size: 14px;
opacity: 0;
transition: opacity 0.3s;
}

.header-hover:hover .tooltip {
visibility: visible;
opacity: 1;
}

0 comments on commit 0906e89

Please sign in to comment.