mysterious-toddler-20573
12/12/2020, 3:39 PMmysterious-toddler-20573
12/12/2020, 3:39 PMmysterious-toddler-20573
12/12/2020, 3:39 PMmysterious-toddler-20573
12/12/2020, 3:39 PMmysterious-toddler-20573
12/12/2020, 3:40 PMmysterious-toddler-20573
12/12/2020, 3:40 PMmysterious-toddler-20573
12/12/2020, 3:40 PMmysterious-toddler-20573
12/12/2020, 3:40 PMevent.data
object looks like...mysterious-toddler-20573
12/12/2020, 3:40 PMfuture-boots-43048
12/12/2020, 3:40 PMfuture-boots-43048
12/12/2020, 3:41 PMmysterious-toddler-20573
12/12/2020, 3:41 PMmysterious-toddler-20573
12/12/2020, 3:41 PMfuture-boots-43048
12/12/2020, 3:42 PMfuture-boots-43048
12/12/2020, 3:43 PMfuture-boots-43048
12/12/2020, 3:43 PMwith html.div(
_class = ('shadow-xl',
'rounded-3xl',
'bg-yellow-50',
'text-gray-900',
'hover:bg-yellow-500',
'hover:text-white',
'p-5')) as datacard:
jscript = """function(id, evt) {
//d3.select(evt.detail.elt).html(evt.detail.data);
console.log(evt.detail.elt);
}"""
html.inline_script('window.xact_{id} = {js}'.format(id = id_res,
js = jscript))
with html.div(id = id_res,
data_hx_trigger = 'sse:{id}'.format(id = id_res),
data_hx_sse = 'forward:{id}'.format(id = id_res),
data_script = ('on {id} call window.xact_{id}'
'("{id}", event)').format(
id = id_res)):
svg.svg(width = 100,
height = 100,
style = 'background: red')
return datacard
future-boots-43048
12/12/2020, 3:43 PMlively-beach-14291
12/12/2020, 3:43 PMlively-beach-14291
12/12/2020, 3:43 PMfuture-boots-43048
12/12/2020, 3:44 PMfuture-boots-43048
12/12/2020, 3:44 PMfuture-boots-43048
12/12/2020, 3:44 PMlively-beach-14291
12/12/2020, 3:44 PMHyperscript.jl
.future-boots-43048
12/12/2020, 3:44 PMfuture-boots-43048
12/12/2020, 3:45 PMfuture-boots-43048
12/12/2020, 3:46 PMlively-beach-14291
12/12/2020, 3:46 PMHypertextLiteral.jl
is that you're using string interpolation to build HTML.lively-beach-14291
12/12/2020, 3:46 PMlively-beach-14291
12/12/2020, 3:47 PMhtl"<span>My Name is $name</span>"
would know to pull the contents of the name
variable from current scope, escape it for content, and return the collected stringmysterious-toddler-20573
12/12/2020, 3:48 PM