From 0d441db2a88bcb70fb280588f032185ec7e05700 Mon Sep 17 00:00:00 2001 From: xhlulu Date: Mon, 30 Aug 2021 21:28:16 -0400 Subject: [PATCH 1/4] Add buttons to pileup demo --- .../assets/general-app-page.css | 4 ++-- apps/dash-pileup-demo/layout_helper.py | 20 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/dash-pileup-demo/assets/general-app-page.css b/apps/dash-pileup-demo/assets/general-app-page.css index ef35deedd..c39499d10 100644 --- a/apps/dash-pileup-demo/assets/general-app-page.css +++ b/apps/dash-pileup-demo/assets/general-app-page.css @@ -58,7 +58,7 @@ margin-right: 10px; transition-duration: 500ms; } -#gh-link { +.gh-link { text-decoration: none; font-size: 10pt; font-family: sans-serif; @@ -77,7 +77,7 @@ margin-left: 0px; transition-duration: 400ms; } -#gh-link:hover { +.gh-link:hover { color: #dfe8f3 !important; border-color: #dfe8f3 !important; } diff --git a/apps/dash-pileup-demo/layout_helper.py b/apps/dash-pileup-demo/layout_helper.py index 5db1871ba..cca033e22 100644 --- a/apps/dash-pileup-demo/layout_helper.py +++ b/apps/dash-pileup-demo/layout_helper.py @@ -70,12 +70,20 @@ 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="http://github.com/plotly/dash-bio/", + 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", style={ "color": "white" if light_logo else "black", "border": "solid 1px white" From e9a05f8f216d6083bdf28d47db022febf34c756d Mon Sep 17 00:00:00 2001 From: xhlulu Date: Mon, 30 Aug 2021 21:30:15 -0400 Subject: [PATCH 2/4] Fix link for get-demo --- apps/dash-pileup-demo/layout_helper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dash-pileup-demo/layout_helper.py b/apps/dash-pileup-demo/layout_helper.py index cca033e22..8224d82b8 100644 --- a/apps/dash-pileup-demo/layout_helper.py +++ b/apps/dash-pileup-demo/layout_helper.py @@ -72,7 +72,8 @@ def app_page_layout( html.A( children=["Enterprise Demo"], className="gh-link", - href="http://github.com/plotly/dash-bio/", + href="https://plotly.com/get-demo/", + target="_blank", style={ "color": "white" if light_logo else "black", "border": "solid 1px white" @@ -84,6 +85,7 @@ def app_page_layout( 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" From 155c589ae2c274cfff9c58ccabd2c671e777c69d Mon Sep 17 00:00:00 2001 From: xhlulu Date: Mon, 30 Aug 2021 21:51:33 -0400 Subject: [PATCH 3/4] Add enterprise demo and source code buttons --- apps/dash-airfoil-design/app.py | 48 +++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/apps/dash-airfoil-design/app.py b/apps/dash-airfoil-design/app.py index fadf923d2..3a5b84dd7 100644 --- a/apps/dash-airfoil-design/app.py +++ b/apps/dash-airfoil-design/app.py @@ -19,6 +19,8 @@ ) server = app.server +btn_style = {"margin-top": "13px"} + app.layout = dbc.Container( [ dbc.Row( @@ -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", @@ -319,4 +351,4 @@ def display_graph( if __name__ == "__main__": - app.run_server(debug=False) + app.run_server(debug=True) From 4063574f9a96af9d1c94726387e59bc8ea277477 Mon Sep 17 00:00:00 2001 From: xhlulu Date: Mon, 30 Aug 2021 21:52:47 -0400 Subject: [PATCH 4/4] Trigger codecarbon update --- apps/codecarbon-demo/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/codecarbon-demo/README.md diff --git a/apps/codecarbon-demo/README.md b/apps/codecarbon-demo/README.md new file mode 100644 index 000000000..e69de29bb