Skip to content

Commit 7d7dea5

Browse files
committed
add docstring for sggrid
1 parent 2934da3 commit 7d7dea5

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

docs/src/lib/functions.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Plotting functions
44

55
```@docs
6+
sggrid
67
sgplot
78
```
89

src/sggrid.jl

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
mutable struct SGGrid <: SGPlots
22
json_spec
33
end
4-
SGGRID_DEFAULT = Dict{Symbol, Any}(:align => :none, # :all, :each, :none
5-
:columns => nothing,
6-
:backcolor=>nothing,
7-
:center=>[false, false], # for row-column
8-
:bounds=>:full, # :full/:flush see vega docs
9-
:rowspace=>0,
10-
:columnspace=>0,
11-
:bordercolor=>:transparent
4+
SGGRID_DEFAULT = SGKwds(
5+
:align => __dic(:default=> :none, :__ord=>1, :__cat=>"Plot appearance", :__doc=>"Determine how to align plots. It can be one of `:all`, `:each`, or `:none`."),
6+
:columns => __dic(:default=> nothing, :__ord=>1, :__cat=>"Plot appearance", :__doc=>"Number of columns to be created."),
7+
:backcolor => __dic(:default=> nothing, :__ord=>1, :__cat=>"Plot appearance", :__doc=>"The back color."),
8+
:center => __dic(:default=> [false, false], :__ord=>1, :__cat=>"Plot appearance", :__doc=>"The row and column centering, respectively."),
9+
:bounds => __dic(:default=> :full, :__ord=>1, :__cat=>"Plot appearance", :__doc=>"One of `:full` or `:flush`. See `vega` docs for more information."),
10+
:rowspace => __dic(:default=> 0, :__ord=>1, :__cat=>"Plot appearance", :__doc=>"Space between rows."),
11+
:columnspace => __dic(:default=> 0, :__ord=>1, :__cat=>"Plot appearance", :__doc=>"Space between columns."),
12+
:bordercolor => __dic(:default=> :transparent, :__ord=>1, :__cat=>"Plot appearance", :__doc=>"The color for the border of plots."),
1213
)
1314

1415

1516
# sggrid positions a collection of SGPlots within a grid
17+
"""
18+
sggrid(sgps...; opts...)
19+
20+
Position a collection of SG plots within a grid.
21+
The `opts...` refers to extra keyword arguments which can be passed to `sggrid`.
22+
23+
$(print_doc(SGGRID_DEFAULT))
24+
"""
1625
function sggrid(sgp...; opts...)
1726
optsd = val_opts(opts)
1827
global_opts = update_default_opts!(deepcopy(SGGRID_DEFAULT), optsd)

0 commit comments

Comments
 (0)