Hi fellow Dash users,
Apologies in advance if this is too simple of a question as I’m a beginner in Dash.
I’m trying to add a javascript from an online widget onto my Dash app. The widget provider is a FX broker and has kindly provided the code to embed as below (I had to delete some “<” notations to allow the code to show as block quotes)
script type=“text/javascript”>DukascopyApplet = {“type”:“economic_calendar_new”,“params”:{“showHeader”:false,“tableBorderColor”:“#D92626”,“defaultTimezone”:0,“defaultCountries”:“c:AU,CA,CH,CN,EU,GB,JP,NZ,US,DE,FR,IT,ES”,“impacts”:[1,2],“dateTab”:2,“dateFrom”:1459036800000,“dateTo”:1459555200000,“showColCountry”:true,“showColCurrency”:true,“showColImpact”:true,“showColPrevious”:true,“showColForecast”:true,“width”:“100%”,“height”:“500”,“adv”:“popup”}};/script>script type=“text/javascript” src=“https://freeserv-static.dukascopy.com/2.0/core.js”>/script>
I’ve read through the documentation for Dash and I’ve written the below code, in attempt to conform to the format listed in the documentation
external_scripts =[
{
‘src’: ‘https://freeserv-static.dukascopy.com/2.0/core.js’,
‘type’:“economic_calendar_new”,
‘params’:{“showHeader”:False,“tableBorderColor”:“#D92626”,“defaultTimezone”:0,“defaultCountries”:“c:AU,CA,CH,CN,EU,GB,JP,NZ,US,DE,FR,IT,ES”,“impacts”:[1,2],“dateTab”:2,“dateFrom”:1459036800000,“dateTo”:1459555200000,“showColCountry”:True,“showColCurrency”:True,“showColImpact”:True,“showColPrevious”:True,“showColForecast”:True,“width”:“100%”,“height”:“500”,“adv”:“popup”}
}]
I’m wondering if firstly what I wrote is correct, and also how to then add the widget to my app via the “add.layout” code block.
Many thanks
Felton