Skip to content

Commit 1052b33

Browse files
committed
add docstring for Polygon
1 parent 8a2bfbd commit 1052b33

File tree

2 files changed

+34
-23
lines changed

2 files changed

+34
-23
lines changed

src/charts/polygon.jl

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
1-
POLYGON_DEFAULT = Dict{Symbol,Any}(:x => nothing, :y => nothing, :id => nothing,
2-
3-
:x2axis => false,
4-
:y2axis => false,
5-
:opacity=>1, # fill opacity
6-
:opacityresponse=>nothing,
7-
:color=>:steelblue,
8-
9-
:interpolate=>:linear, # we change it to linear-closed
10-
11-
:outline => true,
12-
:outlinethickness=>1,
13-
:outlinedash=>[0],
14-
:outlinecolor=>:steelblue,
15-
:outlineopacity=>1,
16-
17-
:group => nothing,
18-
:colorresponse => nothing,
19-
:colormodel => :diverging,
20-
21-
:legend => nothing,
22-
:clip=>nothing
23-
)
1+
"""
2+
Polygon(args...)
3+
4+
Represent a Polygon with given arguments.
5+
6+
$(print_doc(POLYGON_DEFAULT))
7+
"""
248
mutable struct Polygon <: SGMarks
259
opts
2610
function Polygon(;opts...)

src/kwds.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,5 +299,32 @@ REFLINE_DEFAULT = SGKwds(
299299
:thickness => __dic(:default=> 1, :__ord=>3, :__cat=>"Refline appearance", :__doc=>"The line thickness."),
300300
:color => __dic(:default=> :grey, :__ord=>3, :__cat=>"Refline appearance", :__doc=>Kwds_docs[:color_grad]),
301301
:dash => __dic(:default=> [0], :__ord=>3, :__cat=>"Refline appearance", :__doc=>"The line dash style."),
302+
:clip => __dic(:default=> nothing, :__ord=>7, :__cat=>"Miscellaneous", :__doc=>Kwds_docs[:clip]),
303+
)
304+
305+
POLYGON_DEFAULT = SGKwds(
306+
:x => __dic(:default=> nothing, :__ord=>0, :__cat => "Required", :__doc=>"The x coordinate of the polygon."),
307+
:y => __dic(:default=> nothing, :__ord=>0, :__cat => "Required", :__doc=>"The y coordinate of the polygon."),
308+
:id => __dic(:default=> nothing, :__ord=>0, :__cat => "Required", :__doc=>"The function draw a seperate polygon for each unique value of `id`."),
309+
310+
:opacity => __dic(:default=> 1, :__ord=>3, :__cat=>"Polygon appearance", :__doc=>Kwds_docs[:opacity]),
311+
:color => __dic(:default=> :steelblue, :__ord=>3, :__cat=>"Polygon appearance", :__doc=>Kwds_docs[:color_grad]),
312+
:interpolate => __dic(:default=> :linear, :__ord=>1, :__cat=>"Polygon Options", :__doc=>Kwds_docs[:interpolate]),
313+
:outline => __dic(:default=>true, :__ord=>1, :__cat=>"Polygon Options", :__doc=>"If `true` an outline will be drawn for each polygon."),
314+
:outlinethickness => __dic(:default=> 1, :__ord=>3, :__cat=>"Polygon appearance", :__doc=>"The outline thickness."),
315+
:outlinedash => __dic(:default=> [0], :__ord=>3, :__cat=>"Polygon appearance", :__doc=>"The outline dash style."),
316+
:outlinecolor => __dic(:default=> :steelblue, :__ord=>3, :__cat=>"Polygon appearance", :__doc=>Kwds_docs[:color_grad]),
317+
:outlineopacity => __dic(:default=>1, :__ord=>3, :__cat=>"Polygon appearance", :__doc=>"The ouline opacity."),
318+
319+
:opacityresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"Polygon Options", :__doc=>"The column which its values will be used to determine the opacity of polygons."),
320+
:colorresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"Polygon Options", :__doc=>"The column which its values will be used to determine the fill color of polygons."),
321+
322+
:colormodel => __dic(:default=>:diverging, :__ord=>3, :__cat=>"Polygon appearance", :__doc=>"The color model which will be used for fill color when `colorresponse` is passed. It can be an scheme or a vector of colors."),
323+
324+
:group => __dic(:default=> nothing, :__ord=>2, :__cat=>"Grouping", :__doc=>"The name of column for grouping observation. Each group of observations will create seperate polygon and polygons in each group will have different color."),
325+
:x2axis => __dic(:default=> false, :__ord=>5, :__cat=>"Axes options", :__doc=>Kwds_docs[:x2axis]),
326+
:y2axis => __dic(:default=> false, :__ord=>5, :__cat=>"Axes options", :__doc=>Kwds_docs[:y2axis]),
327+
:legend => __dic(:default=> nothing, :__ord=>6, :__cat=>"Legend", :__doc=>Kwds_docs[:legend]),
328+
302329
:clip => __dic(:default=> nothing, :__ord=>7, :__cat=>"Miscellaneous", :__doc=>Kwds_docs[:clip]),
303330
)

0 commit comments

Comments
 (0)