Skip to content

Commit

Permalink
docs wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed May 3, 2024
1 parent be247d6 commit a7a67e2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ makedocs(
),
pages = [
"index.md",
"templates.md"
"templates.md",
"traces.md"
]
)

Expand Down
38 changes: 38 additions & 0 deletions docs/src/traces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Traces


- A core concept in Plotly is that of a *trace*, which is the data along with specifications on how to plot it.
- There are many different trace *types* (e.g. "scatter" for scatterplots, "box" for boxplots).


PlotlyLight does some simple "tricks" with the `plot` function so that:

```julia
plot.trace(; kw...) == plot(; type=trace, kw...)
```

**This allows you to tab-autocomplete the trace type:**

```julia
julia> plot.<TAB>
# bar barpolar box candlestick
# carpet choropleth choroplethmapbox cone
# contour contourcarpet densitymapbox funnel
# funnelarea heatmap heatmapgl histogram
# histogram2d histogram2dcontour icicle image
# indicator isosurface mesh3d ohlc
# parcats parcoords pie pointcloud
# sankey scatter scatter3d scattercarpet
# scattergeo scattergl scattermapbox scatterpolar
# scatterpolargl scattersmith scatterternary splom
# streamtube sunburst surface table
# treemap violin volume waterfall
```

**You can chain the dot syntax to add traces to a plot, e.g.**

```julia
y = randn(20)

plot.bar(; y).scatter(; y)
```

0 comments on commit a7a67e2

Please sign in to comment.