Skip to content

Commit 3e21bcd

Browse files
committed
add docstring for TextPlot
1 parent 21b5152 commit 3e21bcd

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed

src/charts/textplot.jl

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
TEXT_DEFAULT = Dict{Symbol,Any}(:x => nothing, :y => nothing, :text => nothing,
2-
:group => nothing,
3-
:x2axis => false,
4-
:y2axis => false, :opacity => 1,
5-
:opacityresponse => nothing, :size => 10,
6-
:font => nothing,
7-
:fontweight => nothing,
8-
:italic => nothing,
9-
:limit => nothing,
10-
:dir => :ltr, :align => :left, :textbaseline => :alphabetic, :angle => 0,
11-
:angleresponse => nothing, :color => :black,
12-
:colorresponse => nothing,
13-
:colormodel => :diverging, :legend => nothing, #user must give a name to this if further customisation is needed for the legend
14-
:clip => nothing
15-
)
1+
"""
2+
TextPlot(args...)
3+
4+
Represent a Text plot with given arguments.
5+
6+
$(print_doc(TEXT_DEFAULT))
7+
"""
168
mutable struct TextPlot <: SGMarks # we have to use TextPlot instead of Text, since Julia has a Text type already (although it is deprecated)
179
opts
1810
function TextPlot(; opts...)

src/kwds.jl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,39 @@ HISTOGRAM_DEFAULT = SGKwds(
373373
:scale => __dic(:default=> :pdf, :__ord=>1, :__cat=>"Histogram Options", :__doc=>"The scale to use for the bar heights, e.g. `:pdf`, `:cdf`, `:count`."),
374374

375375

376+
:legend => __dic(:default=> nothing, :__ord=>6, :__cat=>"Legend", :__doc=>Kwds_docs[:legend]),
377+
378+
:clip => __dic(:default=> nothing, :__ord=>7, :__cat=>"Miscellaneous", :__doc=>Kwds_docs[:clip]),
379+
)
380+
381+
TEXT_DEFAULT = SGKwds(
382+
:x => __dic(:default=> nothing, :__ord=>0, :__cat => "Required", :__doc=>"The column to be used as x coordinate."),
383+
:y => __dic(:default=> nothing, :__ord=>0, :__cat=> "Required", :__doc=>"The column to be used as y coordinate."),
384+
:text => __dic(:default=> nothing, :__ord=>0, :__cat=> "Required", :__doc=>"The column to be used as text values for each point."),
385+
386+
:group => __dic(:default=> nothing, :__ord=>2, :__cat=>"Grouping", :__doc=>"The name of column for grouping observation. Each group of observations will create seperate text plot."),
387+
388+
:x2axis => __dic(:default=> false, :__ord=>5, :__cat=>"Axes options", :__doc=>Kwds_docs[:x2axis]),
389+
:y2axis => __dic(:default=> false, :__ord=>5, :__cat=>"Axes options", :__doc=>Kwds_docs[:y2axis]),
390+
391+
:opacity => __dic(:default=> 1, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:opacity]),
392+
393+
:opacityresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"TextPlot Options", :__doc=>"The column which its values will be used to determine the opacity of text."),
394+
:angleresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"TextPlot Options", :__doc=>"The column which its values will be used to determine the angle of text."),
395+
:colorresponse => __dic(:default=> nothing, :__ord=>1, :__cat=>"TextPlot Options", :__doc=>"The column which its values will be used to determine the color of text."),
396+
397+
:size => __dic(:default=> 10, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:fontsize]),
398+
:font => __dic(:default=> nothing, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:font]),
399+
:fontweight => __dic(:default=> nothing, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:fontweight]),
400+
:italic => __dic(:default=> nothing, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:italic]),
401+
:limit => __dic(:default=> nothing, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:fontlimit]),
402+
:dir => __dic(:default=> :ltr, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:fontdir]),
403+
:align => __dic(:default=> :left, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:fontalign]),
404+
:textbaseline => __dic(:default=> :alphabetic, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:fontbaseline]),
405+
:angle => __dic(:default=> 0, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:fontangle]),
406+
:color => __dic(:default=> :black, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:fontcolor]),
407+
:colormodel => __dic(:default=> :diverging, :__ord=>3, :__cat=>"TextPlot appearance", :__doc=>Kwds_docs[:colormodel]),
408+
376409
:legend => __dic(:default=> nothing, :__ord=>6, :__cat=>"Legend", :__doc=>Kwds_docs[:legend]),
377410

378411
:clip => __dic(:default=> nothing, :__ord=>7, :__cat=>"Miscellaneous", :__doc=>Kwds_docs[:clip]),

0 commit comments

Comments
 (0)