Skip to content

Commit 4ca2190

Browse files
committed
move all readme docs to documenter
1 parent 1e8cce3 commit 4ca2190

File tree

2 files changed

+3
-106
lines changed

2 files changed

+3
-106
lines changed

README.md

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -34,109 +34,3 @@ p # `display(p)` to see the updated plot
3434
<p align="center">
3535
<img width=650 src="https://user-images.githubusercontent.com/8075494/213164013-3ba1a108-122a-4339-a0a2-fa2175fa06e3.png">
3636
</p>
37-
38-
<br><br>
39-
40-
## 📈 Traces
41-
42-
- A core concept in Plotly is that of a *trace*, which is the data along with specifications on how to plot it.
43-
- There are many different trace *types* (e.g. "scatter" for scatterplots, "box" for boxplots).
44-
45-
46-
PlotlyLight does some simple "tricks" with the `plot` function so that:
47-
48-
```julia
49-
plot.trace(; kw...) == plot(; type=trace, kw...)
50-
```
51-
52-
**This lets you tab-autocomplete the trace type:**
53-
54-
```julia
55-
julia> plot.<TAB>
56-
# bar barpolar box candlestick
57-
# carpet choropleth choroplethmapbox cone
58-
# contour contourcarpet densitymapbox funnel
59-
# funnelarea heatmap heatmapgl histogram
60-
# histogram2d histogram2dcontour icicle image
61-
# indicator isosurface mesh3d ohlc
62-
# parcats parcoords pie pointcloud
63-
# sankey scatter scatter3d scattercarpet
64-
# scattergeo scattergl scattermapbox scatterpolar
65-
# scatterpolargl scattersmith scatterternary splom
66-
# streamtube sunburst surface table
67-
# treemap violin volume waterfall
68-
```
69-
70-
**You can chain the dot syntax to add traces to a plot, e.g.**
71-
72-
```julia
73-
y = randn(20)
74-
75-
plot.bar(; y).scatter(; y)
76-
```
77-
78-
<br><br>
79-
80-
## 📄 Saving Plots
81-
82-
### Saving Plots As HTML
83-
84-
```julia
85-
p = plot(y=rand(10))
86-
87-
PlotlyLight.save(p, "myplot.html")
88-
```
89-
90-
- Note: call `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.
91-
92-
93-
### Save Plots as Image via [PlotlyKaleido.jl](https://github.com/JuliaPlots/PlotlyKaleido.jl)
94-
95-
```julia
96-
using PlotlyKaleido
97-
98-
PlotlyKaleido.start()
99-
100-
(;data, layout, config) = p
101-
102-
PlotlyKaleido.savefig((; data, layout, config), "myplot.png")
103-
```
104-
105-
<br><br>
106-
107-
## 🎛️ Presets
108-
109-
### Theme Presets
110-
111-
Set a theme/template via `preset.template.<option>!()`. Note that options are tab-autocomplete-able. These are borrowed from the [built-in themes](https://plotly.com/python/templates/) in the plotly python package.
112-
113-
```julia
114-
preset.template.ggplot2!()
115-
```
116-
117-
### Source Presets
118-
119-
Change how the plotly.js script gets loaded in the produced html via `preset.source.<option>!()`.
120-
121-
```julia
122-
preset.source.none!() # Don't include the script.
123-
preset.source.cdn!() # Use the official plotly.js CDN.
124-
preset.source.local!() # Use a local version of the plotly.js script.
125-
preset.source.standalone!() # Copy-paste the plotly.js script into the html output.
126-
```
127-
128-
<br><br>
129-
130-
## ⚙️ Settings
131-
132-
Occasionally `preset`s aren't enough. Lower level user-configurable settings are available in `PlotlyLight.settings`:
133-
134-
```julia
135-
PlotlyLight.settings.src::Cobweb.Node # plotly.js script loader
136-
PlotlyLight.settings.div::Cobweb.Node # The plot-div
137-
PlotlyLight.settings.layout::EasyConfig.Config # default `layout` for all plots
138-
PlotlyLight.settings.config::EasyConfig.Config # default `config` for all plots
139-
PlotlyLight.settings.reuse_preview::Bool # In the REPL, open plots in same page (true, the default) or different pages.
140-
```
141-
142-
Check out e.g. `PlotlyLight.Settings().src` to examine default values.

docs/make.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ makedocs(
1111
"index.md",
1212
"plotly_basics.md",
1313
"templates.md",
14+
"saving.md",
15+
"source.md",
16+
"settings.md",
1417
]
1518
)
1619

0 commit comments

Comments
 (0)