Created
May 12, 2021 12:27
-
-
Save gerritjandebruin/4cb74d371e84237d48183f79dba8fd05 to your computer and use it in GitHub Desktop.
Plot hip and plotly to a webpage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html = hip.Experiment.from_iterable(df.to_dict(orient='records')).to_html() | |
soup = BeautifulSoup(html, 'html.parser') | |
tag1 = soup.new_tag('div', attrs={'margin-left': 'auto', 'margin-right': 'auto'}) | |
tag1.append(BeautifulSoup(fig1.to_html(include_plotlyjs='cdn', full_html=False))) | |
soup.body.insert(0, tag1) | |
tag2 = soup.new_tag('div', attrs={'margin-left': 'auto', 'margin-right': 'auto'}) | |
tag2.append(BeautifulSoup(fig2.to_html(include_plotlyjs='cdn', full_html=False))) | |
soup.body.insert(1, tag2) | |
with open('docs/run3.html', 'w') as file: | |
file.write(str(soup)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment