Skip to content

Commit d8367ca

Browse files
committed
actually include docs...
1 parent 4ca2190 commit d8367ca

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

docs/src/saving.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Saving Plots
2+
3+
### Saving Plots As HTML
4+
5+
```julia
6+
p = plot(y=rand(10))
7+
8+
PlotlyLight.save(p, "myplot.html")
9+
```
10+
11+
- Note: call `PlotlyLight.preset.source.standalone!()` first if you want the html file to contain the entire plotly.js script. This enables you to view the plot even without internet access.
12+
13+
14+
### Save Plots as Image via [PlotlyKaleido.jl](https://github.com/JuliaPlots/PlotlyKaleido.jl)
15+
16+
```julia
17+
using PlotlyKaleido
18+
19+
PlotlyKaleido.start()
20+
21+
(;data, layout, config) = p
22+
23+
PlotlyKaleido.savefig((; data, layout, config), "myplot.png")
24+
```

docs/src/settings.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Settings
2+
3+
Occasionally the `PlotlyLight.preset`s aren't enough. Low level user-configurable settings are available in `PlotlyLight.settings`:
4+
5+
```julia
6+
PlotlyLight.settings.src::Cobweb.Node # plotly.js script loader
7+
PlotlyLight.settings.div::Cobweb.Node # The plot-div
8+
PlotlyLight.settings.layout::EasyConfig.Config # default `layout` for all plots
9+
PlotlyLight.settings.config::EasyConfig.Config # default `config` for all plots
10+
PlotlyLight.settings.reuse_preview::Bool # In the REPL, open plots in same page (true, the default) or different pages.
11+
```
12+
13+
Check out e.g. `PlotlyLight.Settings().src` to examine default values.

docs/src/source.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Plotly.js Source Presets
2+
3+
Change how the plotly.js script gets loaded in the produced html via `preset.source.<option>!()`.
4+
5+
```julia
6+
preset.source.none!() # Don't include the script.
7+
preset.source.cdn!() # Use the official plotly.js CDN.
8+
preset.source.local!() # Use a local version of the plotly.js script.
9+
preset.source.standalone!() # Copy-paste the plotly.js script into the html output.
10+
```

0 commit comments

Comments
 (0)