Looking for more detailed documentation of `PlotlyLight.jl`

I found that the PlotlyLight package is very good and very useful to me, but its documentation is currently a bit brief (or I didn’t find it in the right place). Is there any more detailed instructions on its use? Thanks in advance!

PlotlyLight author here!

You’re meant to use Plotly’s Javascript docs (Plotly javascript graphing library in JavaScript) directly, as PlotlyLight is a fairly minimal “layer” over the Javascript.

That being said, it would be a good idea to find a good tutorial to link to in the README.

2 Likes

Thanks! :handshake: :handshake:

Although it is helpful to point to the Plotly javascript docs, that doesn’t explain syntax translation. What Julia syntax (and data structures) correspond to the construction of data and layout? What PlotlyLight function is used to create a plot from data and layout? From what I can tell, plot() has minimal functionality for creating a plot of a single data set, but Plot() corresponds to the JavaScript newPlot(). This is what I have figured out so far:

import PlotlyLight as PL
x = collect(range(0.0, 2.0, length=50))
data = [PL.Config(x=x, y=x, mode="lines", name="series A")
       PL.Config(x=x, y=sqrt.(x), mode="lines", name="series B")]
layout = PL.Config(width=800, height=600, title = Dict(:text=>"title text"))
PL.Plot(data, layout) 

Your example corresponds to these instructions of the Plotly JS docs and it works also for me. To generate the same plot in the style as shown here:

p = plot(x=x, y=x, mode="lines", name="series A");
p(x=x, y=sqrt.(x), mode="lines", name="series B"); # <-- this part has disappeared from the 'PlotllyLight.jl' documentation
p.layout.width=800
p.layout.height=600
p.layout.title.text="title text"

So to add traces to your plot created with a 1st trace as p=plot(...), call the plot object p(x=..., y=,..., type="...", ...)