Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions assets/gh_sponsor_button_white.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<html lang="en" data-color-mode="light" data-light-theme="light" data-dark-theme="dark">
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="https://assets-git.f3mw1.com">
<link rel="dns-prefetch" href="https://avatars.githubusercontent.com">
<link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
<link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link crossorigin="anonymous" media="all"
integrity="sha512-asWzZPGAVyBJV9QUsWjnig4Pr9eg/5G8dgl2TXT7oceXZmA6ZEYP1KtXsD1awUJL0PDDIknQATXYT8Gpggv3jw=="
rel="stylesheet"
href="https://assets-git.f3mw1.com/assets/sponsors-embed-6ac5b364f18057204957d414b168e78a.css" />
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">

<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">

<meta name="browser-optimizely-client-errors-url"
content="https://api.github.com/_private/browser/optimizely_client/errors">

<link rel="mask-icon" href="https://assets-git.f3mw1.com/pinned-octocat.svg" color="#000000">
<link rel="alternate icon" class="js-site-favicon" type="image/png"
href="https://assets-git.f3mw1.com/favicons/favicon.png">
<link rel="icon" class="js-site-favicon" type="image/svg+xml"
href="https://assets-git.f3mw1.com/favicons/favicon.svg">

<meta name="theme-color" content="#fafafa">
<meta name="color-scheme" content="light" />

<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">

<meta name="enabled-homepage-translation-languages" content="ko">
</head>

<body style="word-wrap: break-word;">
<main>
<a class="btn btn-block" style="box-shadow: none;" aria-label="Sponsor @astrochun" target="_blank"
href="https://github.com/sponsors/astrochun?o=esb">
<svg aria-hidden="true" viewBox="0 0 16 16" version="1.1" data-view-component="true"
height="16" width="16" class="octicon octicon-heart icon-sponsor text-pink mr-2">
<path fill-rule="evenodd" d="M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"></path>
</svg>
<span>Sponsor</span>
</a>
</main>

</body>
</html>
20 changes: 13 additions & 7 deletions salary_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import re
import streamlit as st
from streamlit.components.v1 import html

import pandas as pd
import numpy as np

Expand Down Expand Up @@ -31,13 +33,8 @@ def load_data():


def main(bokeh=True):
st.markdown(
'''
<div style="text-align: right">
<iframe src="https://github.com/sponsors/astrochun/button"
title="Sponsor astrochun" height="35" width="116" style="border: 0;"></iframe>
</div>
''', unsafe_allow_html=True)

html(sponsor_button(), width=116, height=35)

st.title('University of Arizona Salary Data')

Expand Down Expand Up @@ -94,6 +91,15 @@ def main(bokeh=True):
subset_select_data_page(df, 'Department', 'department', bokeh=bokeh)


def sponsor_button() -> str:
"""Return white-background version of GitHub Sponsor button"""
file_name = "assets/gh_sponsor_button_white.html"
with open(file_name, 'r', encoding='utf-8') as f:
button_html = f.read().replace('\n', '')

return button_html


def get_summary_data(df: pd.DataFrame, pd_loc_dict: dict, style: str):
"""Gather pandas describe() dataframe and write to streamlit"""

Expand Down