Skip to content

Commit

Permalink
v1.23 fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
asjadnaqvi committed Nov 12, 2023
1 parent 876670c commit c7d39a5
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 28 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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.
Expand Down Expand Up @@ -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).

Expand Down
14 changes: 8 additions & 6 deletions installation/spider.ado
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*! spider v1.22 (03 Jul 2023)
*! spider v1.23 (12 Nov 2023)
*! Asjad Naqvi ([email protected])

* 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.
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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')) /// //

}

Expand Down Expand Up @@ -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'



Expand Down
6 changes: 3 additions & 3 deletions installation/spider.pkg
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions installation/spider.sthlp
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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}

Expand Down Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions installation/stata.toc
Original file line number Diff line number Diff line change
@@ -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 [email protected]
Expand Down

0 comments on commit c7d39a5

Please sign in to comment.