Hi, lets say i have an app.jl that have this variables
app.jl
:
...
@app begin
@out firstX = [1, 2, 3, 4, 5]
@out firstY = [5, 0, 3, -1, 2]
...
@page("/", "public/index_ui.jl.html", layout = "public/index_layout.jl")
Then in index_ui.jl.html
i can use this two variables for example like this:
<plotly :data="[
{
x: firstX,
y: firstY,
mode: 'lines',
type: 'scatter',
My question is, how can i use this two variables in script.js
, that is being used for this html file. Shoud script.js just see them, or should I do something different. I have this as an example right now:
<div id="tester"></div>
(index_ui.jl.html)
script.js
:
TESTER = document.getElementById('tester');
Plotly.plot( TESTER, [{
x: [1, 2, 3, 4, 5],
y: [1, 2, 4, 8, 16] }], {
margin: { t: 0 } }, {showSendToCloud:true} );
When i change this to x: firstX,
- it does not draw a graph anymore, so it does not know what a firstX
is.
Any help,
thanks