Skip to content

Commit

Permalink
Merge pull request #676 from plotly/add-buttons
Browse files Browse the repository at this point in the history
Add "Enterprise Demo" and "Source code" buttons
  • Loading branch information
Xing Han Lu authored Aug 31, 2021
2 parents a92a6db + 4063574 commit 75a3ba6
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 16 deletions.
Empty file added apps/codecarbon-demo/README.md
Empty file.
48 changes: 40 additions & 8 deletions apps/dash-airfoil-design/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
)
server = app.server

btn_style = {"margin-top": "13px"}

app.layout = dbc.Container(
[
dbc.Row(
Expand All @@ -29,21 +31,51 @@
"""
# Airfoil Analysis with [AeroSandbox](https://github.com/peterdsharpe/AeroSandbox) and [Dash](https://plotly.com/dash/)
By [Peter Sharpe](https://peterdsharpe.github.io/). Uses potential flow theory (viscous effects neglected, for now). [Source code here](https://github.com/peterdsharpe/Automotive-Airfoil-Design).
By [Peter Sharpe](https://peterdsharpe.github.io/). Uses potential flow theory (viscous effects neglected, for now). [Original repository here](https://github.com/peterdsharpe/Automotive-Airfoil-Design).
"""
)
],
width=True,
width=8,
),
dbc.Col(
[
html.Img(
src="assets/MIT-logo-red-gray-72x38.svg",
alt="MIT Logo",
height="30px",
html.Div(
[
html.A(
dbc.Button(
"Enterprise Demo",
color="primary",
size="md",
className="mr-1",
),
href="https://plotly.com/get-demo/",
target="_blank",
style=btn_style,
),
html.A(
dbc.Button(
"Source Code",
size="md",
className="mr-1",
color="secondary",
),
href="https://github.com/plotly/dash-sample-apps/tree/main/apps/dash-airfoil-design",
),
html.Img(
src="assets/MIT-logo-red-gray-72x38.svg",
alt="MIT Logo",
height="100%",
style={"margin-left": "15px"},
),
],
style={
"float": "right",
"height": "80px",
"padding-bottom": "20px",
},
),
],
width=1,
width=4,
),
],
align="end",
Expand Down Expand Up @@ -319,4 +351,4 @@ def display_graph(


if __name__ == "__main__":
app.run_server(debug=False)
app.run_server(debug=True)
4 changes: 2 additions & 2 deletions apps/dash-pileup-demo/assets/general-app-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
margin-right: 10px;
transition-duration: 500ms;
}
#gh-link {
.gh-link {
text-decoration: none;
font-size: 10pt;
font-family: sans-serif;
Expand All @@ -77,7 +77,7 @@
margin-left: 0px;
transition-duration: 400ms;
}
#gh-link:hover {
.gh-link:hover {
color: #dfe8f3 !important;
border-color: #dfe8f3 !important;
}
Expand Down
22 changes: 16 additions & 6 deletions apps/dash-pileup-demo/layout_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,22 @@ def app_page_layout(
),
html.H2(app_title),
html.A(
id="gh-link",
children=["View on GitHub"],
href="http://github.com/plotly/dash-bio/"
"blob/master/tests/dashbio_demos/dash-{}/app.py".format(
app_name
),
children=["Enterprise Demo"],
className="gh-link",
href="https://plotly.com/get-demo/",
target="_blank",
style={
"color": "white" if light_logo else "black",
"border": "solid 1px white"
if light_logo
else "solid 1px black",
},
),
html.A(
className="gh-link",
children=["Source Code"],
href="https://github.com/plotly/dash-sample-apps/tree/main/apps/dash-pileup-demo",
target="_blank",
style={
"color": "white" if light_logo else "black",
"border": "solid 1px white"
Expand Down

0 comments on commit 75a3ba6

Please sign in to comment.