Below is the script to add the Linkedin Share button in HTML5 to a website, that allows sharing of the link to the website, along with og components embedded in the share URL generated.
How can I include this feature within a dash app at the top of the plotly graph along with the other buttons to enable visitors of my app to share the graph on Linkedin if they find it insightful?
It is fine if the button does not fit inside the graph object, and sticks somewhere outside the graph object. I just want this button on my dash app. But if we can include this button within the graph object that would be great too.
Add the JS script as an external script and insert the IN/Share element anywhere in the app where you would like the share button to appear. Here is an MWE,
import dash
import dash_html_components as html
app = dash.Dash(external_scripts=["https://platform.linkedin.com/in.js"])
app.layout = html.Div([html.Script(**{"data-url": "https://platform.linkedin.com/in.js"}, type="IN/Share")])
if __name__ == '__main__':
app.run_server()
Also, I am trying to have one share button under each tab of the app in the shared dash example. Is it possible? How do I translate the HTML to dash python code to achieve this?
I’m not quite sure how to implement this in dash.
Hey Emil, thank you very much for this answer, I was trying to find exactly this solution and after giving up, I found this post hehehe Worked perfectly to my problem;
Do you know how could I use this script to a custom button?
Maybe I could use it as {display=none} inside a button