# Genie/Stipple: hot to use Plots.jl?

**URL:** <https://discourse.julialang.org/t/genie-stipple-hot-to-use-plots-jl/118372>\
**Category:** Web Stack\
**Created:** [August 19, 2024, 12:45pm UTC](https://discourse.julialang.org/t/genie-stipple-hot-to-use-plots-jl/118372 "2024-08-19T12:45:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [August 19, 2024, 12:45pm UTC](https://discourse.julialang.org/t/genie-stipple-hot-to-use-plots-jl/118372/1 "2024-08-19T12:45:08Z")

</div>

I am trying to run the [example on the documentation](https://learn.genieframework.com/framework/stipple.jl/guides/first-dashboard):

> **App.jl**
>
> ```julia
> 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:

1. 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 ?
2. During development, how do I modify something within the “app” (a label, a change in layout,…) and show the change on the web page ?
3. In production, how do I reduce the first visit latence ?
4. How do I choose the port of the server ?

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [August 19, 2024, 2:03pm UTC](https://discourse.julialang.org/t/genie-stipple-hot-to-use-plots-jl/118372/2 "2024-08-19T14:03:46Z")

</div>

Also, “at times” (!!!) I got the following error (Julai 1.11-rc2) when trying to load the app:

```julia
julia> Genie.loadapp()

 ██████╗ ███████╗███╗ ██╗██╗███████╗ ███████╗
██╔════╝ ██╔════╝████╗ ██║██║██╔════╝ ██╔════╝
██║ ███╗█████╗ ██╔██╗ ██║██║█████╗ ███████╗
██║ ██║██╔══╝ ██║╚██╗██║██║██╔══╝ ╚════██║
╚██████╔╝███████╗██║ ╚████║██║███████╗ ███████║
 ╚═════╝ ╚══════╝╚═╝ ╚═══╝╚═╝╚══════╝ ╚══════╝

| Website https://genieframework.com
| GitHub https://github.com/genieframework
| Docs https://learn.genieframework.com
| Discord https://discord.com/invite/9zyZbD6J7H
| Twitter https://twitter.com/essenciary

Active env: DEV

Loading appERROR: InitError: KeyError: key Base.PkgId(Base.UUID("a03496cd-edff-5a9b-9e67-9cda94a718b5"), "PlotlyBase") not found
during initialization of module PlotlyBase
Stacktrace:
 [1] getindex
   @ ./dict.jl:477 [inlined]
 [2] macro expansion
   @ ./lock.jl:273 [inlined]
 [3] root_module(key::Base.PkgId)
   @ Base ./loading.jl:2319
 [4] parse_pkg_files(id::Base.PkgId)
   @ Revise ~/.julia/packages/Revise/W4D4d/src/loading.jl:38
in expression starting at /home/lobianco/CloudFiles/beta-lorraine-sync/Documents/JuliaApressBook/2024Update/bookSrc/julia_source_code/ch13/testGenie/app.jl:7

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/a/aa3da92f67903bbfee0c2c33dd23affd95aa6d9e.png)
