Skip to content

Commit

Permalink
v1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
asjadnaqvi committed Aug 27, 2024
1 parent 2a189a2 commit 00f00db
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 35 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors:
- family-names: "Colston"
given-names: "Jared"
title: "Stata package ``waffle''"
version: 1.21
date-released: 2024-06-27
version: 1.22
date-released: 2024-08-27
url: "https://github.com/asjadnaqvi/stata-waffle"
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@



# waffle v1.21
(27 June 2024)
# waffle v1.22
(27 Aug 2024)

This package provides the ability to draw waffles Stata. It is based on the [Waffle plots](https://medium.com/the-stata-guide/stata-graphs-waffle-plots-613808b51f73) guide on Medium.

Expand All @@ -20,12 +20,12 @@ The package is still beta and is being constantly improved. It might still be mi

The package can be installed via SSC or GitHub. The GitHub version, *might* be more recent due to bug fixes, feature updates etc, and *may* contain syntax improvements and changes in *default* values. See version numbers below. Eventually the GitHub version is published on SSC.

The SSC version (**v1.2**):
The SSC version (**v1.21**):
```
ssc install waffle, replace
```

Or it can be installed from GitHub (**v1.21**):
Or it can be installed from GitHub (**v1.22**):

```
net install waffle, from("https://raw.githubusercontent.com/asjadnaqvi/stata-waffle/main/installation/") replace
Expand Down Expand Up @@ -353,6 +353,11 @@ Please open an [issue](https://github.com/asjadnaqvi/stata-waffle/issues) to rep

## Change log


**v1.22 (27 Aug 2024)**
- Fixed a bug where labels were not passing correctly under certain conditions.
- Fixed a bug where totals were not showing correctly under certain conditions.

**v1.21 (27 May 2024)**
- Fixed a bug where the program was running into an error if `by()` was not specified.
- Fixed and improved returned locals. See `return list` after running the command.
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.21
v 1.22
d 'WAFFLE': A Stata package for waffle plots
d
d Distribution-Date: 20240627
d Distribution-Date: 20240827
d


38 changes: 21 additions & 17 deletions installation/waffle.ado
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*! waffle v1.21 (27 Jun 2024)
*! waffle v1.22 (27 Aug 2024)
*! Asjad Naqvi and Jared Colston

*v1.22 (27 Aug 2024): fixed label issues for graphs with just one item. Fixed a bug where wrong totals were calculated under certain conditions.
*v1.21 (27 Jun 2024): by _cats bug. Post graph now shows dotval as an output. return locals fixed.
*v1.2 (26 May 2024): Fix long graph normalization bug. better treatment of null shares. r(dot) added.
*v1.11 (05 May 2024): Bug fixes to how data was collapsed under different conditions. normvar now needs to be already the sum value.
Expand Down Expand Up @@ -86,6 +87,7 @@ quietly {

cap ren `by' _cats


fillin _cats `over'
recode `varlist' (.=0)
drop _fillin
Expand All @@ -104,6 +106,8 @@ quietly {
ren y_ _val




egen _grp = group(_cats)


Expand Down Expand Up @@ -131,6 +135,7 @@ quietly {




cap drop `normvar'

gen double _share = .
Expand Down Expand Up @@ -191,6 +196,7 @@ quietly {





levelsof _grp , local(lvls)
levelsof _tag3, local(ovrs)
Expand Down Expand Up @@ -256,15 +262,16 @@ quietly {
levelsof _grp, local(lvls)

foreach x of local lvls {
summ _val if _grp==`x' & _tag2==1, meanonly
replace _label = _temp + " (" + string(r(sum), "`format'") + ")" if _grp==`x'
summ _val if _grp==`x' & _control==0, meanonly
replace _label = _temp + " (" + string(r(sum), "`format'") + ")" if _grp==`x'
}
}
else {
replace _label = _temp + " (" + string(_share_tot * 100, "`format'") + "%)"
replace _label = _temp + " (" + string(_share_tot * 100, "`format'") + "%)"
}




capture drop _i
capture drop _control
capture drop _temp
Expand All @@ -274,16 +281,9 @@ quietly {
if "`mlwidth'" == "" local mlwidth 0.05
if "`ndsymbol'" == "" local ndsymbol square
if "`ndsize'" == "" local ndsize 0.5
if "`legposition'" == "" local legposition 6

if "`ndcolor'" == "" {
if "`normvar'" == "" {
local ndcolor none
}
else {
local ndcolor gs14
}
}
if "`legposition'" == "" local legposition 6
if "`ndcolor'" == "" local ndcolor gs12


if "`palette'" == "" {
local palette tableau
Expand Down Expand Up @@ -365,8 +365,8 @@ quietly {
`dots' ///
(scatter _y _x if _dot==0, msize(`ndsize') msymbol(`ndsymbol') mcolor(`ndcolor')) ///
, ///
ytitle("") yscale(noline) ylabel(, nogrid) ///
xtitle("") xscale(noline) xlabel(, nogrid) ///
ytitle("") yscale(off noline range(1 `coldots')) ylabel(, nogrid) ///
xtitle("") xscale(off noline range(1 `rowdots')) xlabel(, nogrid) ///
by(, noiyaxes noixaxes noiytick noixtick noiylabel noixlabel `myleg2' ) ///
by(_label, `title' `note' rows(`rows') cols(`cols') imargin(`margin') `legswitch' ) ///
`subtitle' ///
Expand All @@ -376,6 +376,10 @@ quietly {

noi display in yellow "Each dot has a value of `dotval'. See {stata return list} for stored values."





*/
}
restore
Expand Down
6 changes: 3 additions & 3 deletions installation/waffle.pkg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v 1.21
v 1.22
d {bf:WAFFLE}: A Stata package for Waffle plots.
d See {helpb waffle} after installation.
d
Expand All @@ -8,9 +8,9 @@ d KW: Stata
d KW: graphs
d KW: waffle
d
d Distribution-Date: 20240627
d Distribution-Date: 20240827
d
d This version: 27 Jun 2024
d This version: 27 Aug 2024
d First version: 01 Mar 2022
d License: MIT
d
Expand Down
14 changes: 7 additions & 7 deletions installation/waffle.sthlp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{smcl}
{* 27Jun2024}{...}
{* 27Aug2024}{...}
{hi:help waffle}{...}
{right:{browse "https://github.com/asjadnaqvi/stata-waffle":waffle v1.21 (GitHub)}}
{right:{browse "https://github.com/asjadnaqvi/stata-waffle":waffle v1.22 (GitHub)}}

{hline}

Expand Down Expand Up @@ -100,8 +100,8 @@ See {browse "https://github.com/asjadnaqvi/stata-waffle":GitHub}.

{title:Package details}

Version : {bf:waffle} v1.21
This release : 27 Jun 2024
Version : {bf:waffle} v1.22
This release : 27 Aug 2024
First release: 01 Mar 2022
Repository : {browse "https://github.com/asjadnaqvi/stata-waffle":GitHub}
Keywords : Stata, graph, waffle
Expand All @@ -121,14 +121,14 @@ Please submit bugs, errors, feature requests on {browse "https://github.com/asja

Suggested citation guidlines for this package:

Naqvi, A. and Colston, J. (2024). Stata package "waffle" version 1.21. Release date 27 June 2024. https://github.com/asjadnaqvi/stata-waffle.
Naqvi, A. and Colston, J. (2024). Stata package "waffle" version 1.22. Release date 27 August 2024. https://github.com/asjadnaqvi/stata-waffle.

@software{waffle,
author = {Naqvi, Asjad AND Colston, Jared},
title = {Stata package ``waffle''},
url = {https://github.com/asjadnaqvi/stata-waffle},
version = {1.21},
date = {2024-06-27}
version = {1.22},
date = {2024-08-27}
}


Expand Down

0 comments on commit 00f00db

Please sign in to comment.