Skip to content

Commit dd3f4c9

Browse files
committed
add docstring for Scatter
1 parent 3e21bcd commit dd3f4c9

File tree

2 files changed

+52
-37
lines changed

2 files changed

+52
-37
lines changed

src/charts/scatter.jl

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,10 @@
1-
SCATTER_DEFAULT = Dict{Symbol, Any}(:x => 0, :y => 0,
2-
:group=>nothing,
3-
:x2axis=>false,
4-
:y2axis=>false,
5-
:opacity=>1,
6-
:opacityresponse=>nothing,
7-
:thickness=>1, # symbol outline thickness
8-
9-
:color=> nothing,
10-
:size=>50,
11-
:symbol=>"circle",
12-
:symbolresponse=>nothing,
13-
:angle=>0,
14-
:angleresponse=>nothing,
15-
:outlinecolor=>nothing,
16-
:colorresponse => nothing,
17-
:colormodel=>:diverging,
18-
:legend => nothing , #user must give a name to this if further customisation is needed for the legend
19-
:jitter=>[0,0], # jitter strength, the first one is the horizontal strength and the second number is the vertical strength
1+
"""
2+
Scatter(args...)
203
21-
#data label
22-
:labelresponse=>nothing,
23-
:labelfont=>nothing,
24-
:labelfontweight=>nothing,
25-
:labelitalic=>nothing,
26-
:labelsize=>nothing,
27-
:labelcolor=>:black,# allow :group, :colorresponse to use their color if available
28-
:labelangle=>0,
29-
:labeldir=>:ltr,
30-
:labellimit=>nothing,
31-
:labelanchor=>[:top, :bottom, :left, :right],
32-
:labelalgorithm=>:naive,
33-
:tooltip => false, # it can be true, only if labelresponse is provided
4+
Represent a Scatter plot with given arguments.
345
35-
:xshift=>0, # between [0,1], useful for discrete axes
36-
:yshift=>0,
37-
38-
:clip=>nothing
39-
)
6+
$(print_doc(SCATTER_DEFAULT))
7+
"""
408
mutable struct Scatter <: SGMarks
419
opts
4210
function Scatter(;opts...)

src/kwds.jl

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,5 +408,52 @@ TEXT_DEFAULT = SGKwds(
408408

409409
:legend => __dic(:default=> nothing, :__ord=>6, :__cat=>"Legend", :__doc=>Kwds_docs[:legend]),
410410

411+
:clip => __dic(:default=> nothing, :__ord=>7, :__cat=>"Miscellaneous", :__doc=>Kwds_docs[:clip]),
412+
)
413+
414+
SCATTER_DEFAULT = SGKwds(
415+
:x => __dic(:default=> 0, :__ord=>0, :__cat => "Required", :__doc=>"The column to be used as x coordinate."),
416+
:y => __dic(:default=> 0, :__ord=>0, :__cat=> "Required", :__doc=>"The column to be used as y coordinate."),
417+
:group => __dic(:default=> nothing, :__ord=>2, :__cat=>"Grouping", :__doc=>"The name of column for grouping observation. Each group of observations will create seperate scatter plot."),
418+
419+
:opacity => __dic(:default=> 1, :__ord=>3, :__cat=>"Scatter appearance", :__doc=>Kwds_docs[:opacity]),
420+
:thickness => __dic(:default=> 1, :__ord=>3, :__cat=>"Scatter appearance", :__doc=>Kwds_docs[:outlinethickness]),
421+
:color => __dic(:default=> nothing, :__ord=>3, :__cat=>"Scatter appearance", :__doc=>Kwds_docs[:color]),
422+
:outlinecolor => __dic(:default=> nothing, :__ord=>3, :__cat=>"Scatter appearance", :__doc=>Kwds_docs[:color]),
423+
:size => __dic(:default=> 50, :__ord=>3, :__cat=>"Scatter appearance", :__doc=>"The symbol size."),
424+
:symbol => __dic(:default=> "circle", :__ord=>3, :__cat=>"Scatter appearance", :__doc=>"The symbol type, e.g. `:circle`, `:square`, ..."),
425+
:angle => __dic(:default=> 0, :__ord=>3, :__cat=>"Scatter appearance", :__doc=>"The symbol angle."),
426+
:colormodel => __dic(:default=> :diverging, :__ord=>3, :__cat=>"Scatter appearance", :__doc=>Kwds_docs[:colormodel]),
427+
428+
429+
430+
:jitter => __dic(:default=> [0,0], :__ord=>1, :__cat=>"Scatter Options", :__doc=>"The jitter strength in the x and y axes direction, respectively."),
431+
432+
:opacityresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"Scatter Options", :__doc=>"The column which its values will be used to determine the opacity of the marks."),
433+
:symbolresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"Scatter Options", :__doc=>"The column which its values will be used to determine the symbol of the marks."),
434+
:angleresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"Scatter Options", :__doc=>"The column which its values will be used to determine the angle of the marks."),
435+
:colorresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"Scatter Options", :__doc=>"The column which its values will be used to determine the fill color of the marks."),
436+
437+
:labelresponse => __dic(:default=> nothing, :__ord=>4, :__cat=>"Scatter Label", :__doc=>"The column which its values will be used to label points."),
438+
:labelfont => __dic(:default=> nothing, :__ord=>4, :__cat=>"Scatter Label", :__doc=>Kwds_docs[:font]),
439+
:labelfontweight => __dic(:default=> nothing, :__ord=>4, :__cat=>"Scatter Label", :__doc=>Kwds_docs[:fontweight]),
440+
:labelitalic => __dic(:default=> nothing, :__ord=>4, :__cat=>"Scatter Label", :__doc=>Kwds_docs[:italic]),
441+
:labelsize => __dic(:default=> nothing, :__ord=>4, :__cat=>"Scatter Label", :__doc=>Kwds_docs[:fontsize]),
442+
:labelcolor => __dic(:default=> :black, :__ord=>4, :__cat=>"Scatter Label", :__doc=>"The label text color, it can also be `:group` or `:colorresponse` for choosing the color based on the points groups."),
443+
:labelangle => __dic(:default=> 0, :__ord=>4, :__cat=>"Scatter Label", :__doc=>Kwds_docs[:fontangle]),
444+
:labeldir => __dic(:default=> :ltr, :__ord=>4, :__cat=>"Scatter Label", :__doc=>Kwds_docs[:fontdir]),
445+
:labellimit => __dic(:default=> nothing, :__ord=>4, :__cat=>"Scatter Label", :__doc=>Kwds_docs[:fontlimit]),
446+
:labelanchor => __dic(:default=> [:top, :bottom, :left, :right], :__ord=>4, :__cat=>"Scatter Label", :__doc=>"The anchors for choosing the location of labels."),
447+
:labelalgorithm => __dic(:default=> :naive, :__ord=>4, :__cat=>"Scatter Label", :__doc=>"The algorithm for placing labels."),
448+
:tooltip => __dic(:default=> false, :__ord=>4, :__cat=>"Scatter Label", :__doc=>Kwds_docs[:tooltip]),
449+
450+
451+
452+
:x2axis => __dic(:default=> false, :__ord=>5, :__cat=>"Axes options", :__doc=>Kwds_docs[:x2axis]),
453+
:y2axis => __dic(:default=> false, :__ord=>5, :__cat=>"Axes options", :__doc=>Kwds_docs[:y2axis]),
454+
:xshift => __dic(:default=> 0, :__ord=>5, :__cat=>"Axes options", :__doc=>"Shift the mark in direction of x. Useful for discrete type axes."),
455+
:yshift => __dic(:default=> 0, :__ord=>5, :__cat=>"Axes options", :__doc=>"Shift the mark in direction of y. Useful for discrete type axes."),
456+
:legend => __dic(:default=> nothing, :__ord=>6, :__cat=>"Legend", :__doc=>Kwds_docs[:legend]),
457+
411458
:clip => __dic(:default=> nothing, :__ord=>7, :__cat=>"Miscellaneous", :__doc=>Kwds_docs[:clip]),
412459
)

0 commit comments

Comments
 (0)