Skip to content

Commit a7a67e2

Browse files
committed
docs wip
1 parent be247d6 commit a7a67e2

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ makedocs(
99
),
1010
pages = [
1111
"index.md",
12-
"templates.md"
12+
"templates.md",
13+
"traces.md"
1314
]
1415
)
1516

docs/src/traces.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Traces
2+
3+
4+
- A core concept in Plotly is that of a *trace*, which is the data along with specifications on how to plot it.
5+
- There are many different trace *types* (e.g. "scatter" for scatterplots, "box" for boxplots).
6+
7+
8+
PlotlyLight does some simple "tricks" with the `plot` function so that:
9+
10+
```julia
11+
plot.trace(; kw...) == plot(; type=trace, kw...)
12+
```
13+
14+
**This allows you to tab-autocomplete the trace type:**
15+
16+
```julia
17+
julia> plot.<TAB>
18+
# bar barpolar box candlestick
19+
# carpet choropleth choroplethmapbox cone
20+
# contour contourcarpet densitymapbox funnel
21+
# funnelarea heatmap heatmapgl histogram
22+
# histogram2d histogram2dcontour icicle image
23+
# indicator isosurface mesh3d ohlc
24+
# parcats parcoords pie pointcloud
25+
# sankey scatter scatter3d scattercarpet
26+
# scattergeo scattergl scattermapbox scatterpolar
27+
# scatterpolargl scattersmith scatterternary splom
28+
# streamtube sunburst surface table
29+
# treemap violin volume waterfall
30+
```
31+
32+
**You can chain the dot syntax to add traces to a plot, e.g.**
33+
34+
```julia
35+
y = randn(20)
36+
37+
plot.bar(; y).scatter(; y)
38+
```

0 commit comments

Comments
 (0)