From c7d39a51bf9e807bc0ae5354dea205bbb69c8f8c Mon Sep 17 00:00:00 2001 From: Asjad Naqvi Date: Sun, 12 Nov 2023 23:54:33 +0100 Subject: [PATCH] v1.23 fix #10 --- CITATION.cff | 4 ++-- LICENSE | 2 +- README.md | 14 +++++++++----- installation/spider.ado | 14 ++++++++------ installation/spider.pkg | 6 +++--- installation/spider.sthlp | 18 +++++++++--------- installation/stata.toc | 4 ++-- 7 files changed, 34 insertions(+), 28 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 1b49986..b8e4f57 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -3,6 +3,6 @@ authors: - family-names: "Naqvi" given-names: "Asjad" title: "Stata package ``spider''" -version: 1.22 -date-released: 2023-07-03 +version: 1.23 +date-released: 2023-11-12 url: "https://github.com/asjadnaqvi/stata-spider" diff --git a/LICENSE b/LICENSE index 569353b..fb09ad3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Asjad Naqvi +Copyright (c) 2023 Asjad Naqvi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6562308..0cda739 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ --- -# spider v1.22 -(03 Jul 2023) +# spider v1.23 +(12 Nov 2023) This package provides the ability to draw spiders Stata. It is based on the [Spider plots](https://medium.com/the-stata-guide/stata-graphs-spider-plots-613808b51f73) guide on Medium @@ -24,7 +24,7 @@ The SSC version (**v1.21**): ssc install spider, replace ``` -Or it can be installed from GitHub (**v1.22**): +Or it can be installed from GitHub (**v1.23**): ``` net install spider, from("https://raw.githubusercontent.com/asjadnaqvi/stata-spider/main/installation/") replace @@ -58,7 +58,7 @@ graph set window fontface "Arial Narrow" ## Syntax -The syntax for v1.22 is as follows: +The syntax for the latest version is as follows: ``` spider varlist [if] [in], over(cat var) @@ -68,7 +68,7 @@ spider varlist [if] [in], over(cat var) msize(str) mlwidth(str) displacelab(num) displacespike(num) ccolor(str) cwidth(str) scolor(str) swidth(str) slabsize(str) nolegend legpositon(num) legpositon(num) legcolumns(num) legsize(num) - title(str) subtitle(str) note(str) scheme(str) xsize(num) ysize(num) name(str) ] + title(str) subtitle(str) note(str) scheme(str) xsize(num) ysize(num) name(str) saving(str) ] ``` See the help file `help spider` for details. @@ -251,6 +251,10 @@ Please open an [issue](https://github.com/asjadnaqvi/stata-spider/issues) to rep ## Change log +**v1.23 (12 Nov 2023)** +- Added support for `slabcolor()` (requested by Christian Gessinger). +- Added `saving()`. + **v1.22 (07 Jul 2023)** - Fixed a bug where labeled `over()` categories were not passing correctly (reported by Kamala Kaghoma). diff --git a/installation/spider.ado b/installation/spider.ado index 33386b4..6d3d833 100644 --- a/installation/spider.ado +++ b/installation/spider.ado @@ -1,6 +1,7 @@ -*! spider v1.22 (03 Jul 2023) +*! spider v1.23 (12 Nov 2023) *! Asjad Naqvi (asjadnaqvi@gmail.com) +* v1.23 (12 Nov 2023): Added slabcolor(), saving() * v1.22 (03 Jul 2023): Fixed bug with numerical variables not passing correctly. * v1.21 (10 Jun 2023): Options added: ralabcolor() ralabangle(). * v1.2 (20 May 2023): Major fixes to the legend. @@ -26,9 +27,9 @@ version 15 [ RAnge(numlist min=2 max=2) cuts(real 6) smooth(numlist max=1 >=0 <=1) raformat(string) RALABSize(string) ] /// [ LWidth(string) MSYMbol(string) MSize(string) MLWIDth(string) ] /// // spider properties [ CColor(string) CWidth(string) SColor(string) SWidth(string) SLABSize(string) ] /// // circle = C, spikes = S - [ title(passthru) subtitle(passthru) note(passthru) scheme(passthru) name(passthru) ] /// + [ title(passthru) subtitle(passthru) note(passthru) scheme(passthru) name(passthru) saving(passthru) ] /// [ NOLEGend LEGPOSition(real 6) LEGCOLumns(real 5) LEGSize(real 2.2) xsize(real 1) ysize(real 1) ] /// // v1.2 updates. - [ RALABColor(string) RALABAngle(string) ] // v1.21 options + [ RALABColor(string) RALABAngle(string) SLABColor(string) ] // v1.2X options // TODO: // ROTATELABel: allow label rotations @@ -220,7 +221,8 @@ preserve // labels // ///////////////// - if "`slabsize'" == "" local slabsize 2.2 + if "`slabsize'" == "" local slabsize 2.2 + if "`slabcolor'" == "" local slabcolor black gen double markerx = (100 + `displacelab') * cos(angle) gen double markery = (100 + `displacelab') * sin(angle) @@ -234,7 +236,7 @@ preserve local angle = (r(mean) * (180 / _pi)) + 255 } - local labs `labs' (scatter markery markerx in `i', mc(none) mlab(`over') mlabpos(0) mlabcolor(black) mlabangle(`angle') mlabsize(`slabsize')) /// // + local labs `labs' (scatter markery markerx in `i', mc(none) mlab(`over') mlabpos(0) mlabcolor(`slabcolor') mlabangle(`angle') mlabsize(`slabsize')) /// // } @@ -332,7 +334,7 @@ preserve xscale(off) yscale(off) /// xlabel(, nogrid) ylabel(, nogrid) /// `mylegend' /// - `title' `subtitle' `note' `scheme' `name' + `title' `subtitle' `note' `scheme' `name' `saving' diff --git a/installation/spider.pkg b/installation/spider.pkg index 6e0043c..3d5858c 100644 --- a/installation/spider.pkg +++ b/installation/spider.pkg @@ -1,4 +1,4 @@ -v 1.21 +v 1.23 d {bf:SPIDER}: A Stata package for spider plots. d See {bf:help spider} after installation. d @@ -9,9 +9,9 @@ d KW: graphs d KW: spider plot d d -d Distribution-Date: 20230610 +d Distribution-Date: 20231112 d -d This version: 10 Jun 2023 +d This version: 12 Nov 2023 d First version: 13 Oct 2022 d License: MIT d diff --git a/installation/spider.sthlp b/installation/spider.sthlp index 9902d46..0cce2bd 100644 --- a/installation/spider.sthlp +++ b/installation/spider.sthlp @@ -1,7 +1,7 @@ {smcl} -{* 03Jul2023}{...} +{* 12Nov2023}{...} {hi:help spider}{...} -{right:{browse "https://github.com/asjadnaqvi/stata-spider":spider v1.22 (GitHub)}} +{right:{browse "https://github.com/asjadnaqvi/stata-spider":spider v1.23 (GitHub)}} {hline} @@ -18,9 +18,9 @@ The command is based on the following guide on Medium: {browse "https://medium.c {cmdab:ra:nge}({it:val1 val2}) {cmd:cuts}({it:num}) {cmdab:lw:idth}({it:str}) {cmdab:msym:bol}({it:str}) {cmd:raformat}({it:fmt}) {cmdab:ralabs:ize}({it:str}) {cmdab:ralabc:olor}({it:str}) {cmdab:ralaba:ngle}({it:str}) {cmdab:ms:ize}({it:str}) {cmdab:mlw:idth}({it:str}) {cmdab:displacel:ab}({it:num}) {cmdab:displaces:pike}({it:num}) - {cmdab:cc:olor}({it:str}) {cmdab:cw:idth}({it:str}) {cmdab:sc:olor}({it:str}) {cmdab:sw:idth}({it:str}) {cmdab:slabs:ize}({it:str}) + {cmdab:cc:olor}({it:str}) {cmdab:cw:idth}({it:str}) {cmdab:sc:olor}({it:str}) {cmdab:sw:idth}({it:str}) {cmdab:slabs:ize}({it:str}) {cmdab:slabc:olor}({it:str}) {cmdab:noleg:end} {cmdab:legpos:iton}({it:num}) {cmdab:legpos:iton}({it:num}) {cmdab:legcol:umns}({it:num}) {cmdab:legs:ize}({it:num}) {cmd:xsize}({it:num}) {cmd:ysize}({it:num}) - {cmd:title}({it:str}) {cmd:subtitle}({it:str}) {cmd:note}({it:str}) {cmd:scheme}({it:str}) {cmd:name}({it:str}) {cmd:]} + {cmd:title}({it:str}) {cmd:subtitle}({it:str}) {cmd:note}({it:str}) {cmd:scheme}({it:str}) {cmd:name}({it:str}) {cmd:saving}({it:str}) {cmd:]} {p 4 4 2} @@ -96,7 +96,9 @@ The default value is {opt displaces(2)} for 2%.{p_end} {p2coldent : {opt sw:idth(str)}}The width of the spikes. Default is {opt sw(0.1)}.{p_end} -{p2coldent : {opt slabs:ize(str)}}The width of the spikes. Default is {opt slabs(2.2)}.{p_end} +{p2coldent : {opt slabs:ize(str)}}The width of the spike labels. Default is {opt slabs(2.2)}.{p_end} + +{p2coldent : {opt slabc:olor(str)}}The color of the spike labels. Default is {opt slabc(black)}.{p_end} {p2coldent : {opt xsize(num)}, {opt ysize(num)}}Dimensions of the graph. Defaults are {opt xsize(1)} and {opt ysize(1)}.{p_end} @@ -127,8 +129,8 @@ See {browse "https://github.com/asjadnaqvi/stata-spider":GitHub} for examples. {title:Package details} -Version : {bf:spider} v1.22 -This release : 03 Jul 2023 +Version : {bf:spider} v1.23 +This release : 12 Nov 2023 First release: 13 Oct 2022 Repository : {browse "https://github.com/asjadnaqvi/stata-spider":GitHub} Keywords : Stata, graph, spider plot @@ -146,8 +148,6 @@ Please submit bugs, errors, feature requests on {browse "https://github.com/asja {title:References} -{p 4 8 2}Pisati, B. (2018). {browse "help spmap":spmap} v1.3.2. - {p 4 8 2}Jann, B. (2018). {browse "https://www.stata-journal.com/article.html?article=gr0075":Color palettes for Stata graphics}. The Stata Journal 18(4): 765-785. {p 4 8 2}Jann, B. (2022). {browse "https://ideas.repec.org/p/bss/wpaper/43.html":Color palettes for Stata graphics: An update}. University of Bern Social Sciences Working Papers No. 43. diff --git a/installation/stata.toc b/installation/stata.toc index 8cade03..7b99313 100644 --- a/installation/stata.toc +++ b/installation/stata.toc @@ -1,7 +1,7 @@ -v 1.22 +v 1.23 d 'SPIDER': A Stata package for spider plots d -d Distribution-Date: 20230703 +d Distribution-Date: 20231112 d d Asjad Naqvi d asjadnaqvi@gmail.com