I am trying to run the example on the documentation:
App.jl
module App
using GenieFramework, PlotlyBase
@genietools
function gen_numbers(N::Int)
return rand(N)
end
function calc_mean(x::Vector{Float64})
return round(sum(x) / length(x); digits=4)
end
@app begin
@in N = 0
@out m = 0.0
@out trace = []
@out layout = PlotlyBase.Layout(title="Histogram plot")
@onchange N begin
x = gen_numbers(N)
m = calc_mean(x)
trace = [histogram(x=x)]
end
end
function ui()
row([
cell(class="st-col col-3", [
h1("A simple dashboard"),
slider(1:1:1000, :N),
p("The average of {{N}} random numbers is {{m}}", class="st-module"),
])
plot(:trace, layout=:layout)
])
end
@page("/", ui)
end
I have several questions:
- Is it possible to use Plots.jl instead of Plotly ? Is Genie tidy coupled with Plotly or it can render the output of any plot package ?
- During development, how do I modify something within the “app” (a label, a change in layout,…) and show the change on the web page ?
- In production, how do I reduce the first visit latence ?
- How do I choose the port of the server ?