stata-circlepack

A Stata package for circle packing

https://github.com/asjadnaqvi/stata-circlepack

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.2%) to scientific vocabulary

Keywords

ado circlepack circlepacking package stata
Last synced: 6 months ago · JSON representation ·

Repository

A Stata package for circle packing

Basic Info
  • Host: GitHub
  • Owner: asjadnaqvi
  • License: mit
  • Language: Stata
  • Default Branch: main
  • Homepage:
  • Size: 14.5 MB
Statistics
  • Stars: 6
  • Watchers: 2
  • Forks: 0
  • Open Issues: 3
  • Releases: 4
Topics
ado circlepack circlepacking package stata
Created over 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Funding License Citation

README.md

StataMin issues license Stars version release

Installation | Syntax | Examples | Feedback | Change log


circlepack-1

circlepack v1.2

(15 Jan 2024)

A Stata package for circle packing. It is based on D3's packEnclose and Python's circlify algorithms.

Installation

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): ssc install circlepack, replace

Or it can be installed from GitHub (v1.2):

net install circlepack, from("https://raw.githubusercontent.com/asjadnaqvi/stata-circlepack/main/installation/") replace

The palettes package is required to run this command:

ssc install palettes, replace ssc install colrspace, replace

Even if you have the package installed, make sure that it is updated ado update, update.

If you want to make a clean figure, then it is advisable to load a clean scheme. These are several available and I personally use the following:

ssc install schemepack, replace set scheme white_tableau

You can also push the scheme directly into the graph using the scheme(schemename) option. See the help file for details or the example below.

I also prefer narrow fonts in figures with long labels. You can change this as follows:

graph set window fontface "Arial Narrow"

Syntax

The syntax for the latest version is as follows:

``` circlepack numvar [if] [in], by(variables (min=1, max=3)) [ pad(num) points(num) angle(num) circle0 circle0c(str) format(str) palette(string) share labprop titleprop labscale(num) threshold(num) fi(list) addtitles novalues nolabels labsize(num) title(str) subtitle(str) note(str) scheme(str) name(str) ]

```

See the help file help circlepack for details.

The most basic use is as follows:

circlepack numvar, over(variable(s))

where numvar is a numeric variable, and over() are upto three variables, defined from more aggregate to finer levels.

Examples

Set up the data:

``` clear set scheme white_tableau graph set window fontface "Arial Narrow"

use "https://github.com/asjadnaqvi/stata-circlepack/blob/main/data/demorpjangrp3_clean.dta?raw=true", clear ```

circlepack pop, by(NUTS0) format(%15.0fc) title("Population of European countries")

circlepack pop, by(NUTS0) title("Population of European countries") noval

circlepack pop, by(NUTS0) title("Population of European countries") circle0 noval

circlepack pop, by(NUTS0 NUTS1) format(%15.0fc) noval circle0

circlepack pop, by(NUTS0 NUTS1) format(%15.0fc) noval addtitles

circlepack pop, by(NUTS0 NUTS1 NUTS2) format(%15.0fc) nolab pad(0.06)

circlepack pop if NUTS0=="AT", by(NUTS1 NUTS2 NUTS3) /// addtitles noval format(%15.0fc) circle0 /// title("Population of Austria at NUTS2 and NUTS3 level")

circlepack pop if NUTS0=="NL", by(NUTS2 NUTS3) addtitles /// format(%15.0fc) title("Population of Netherlands at NUTS2 and NUTS3 level")

circlepack pop if NUTS0=="NL", by(NUTS1 NUTS2 NUTS3) /// addtitles noval format(%15.0fc) title("Population of Netherlands at NUTS1-NUTS3 level") /// palette(CET L10)

circlepack pop if NUTS0=="NL", by(NUTS1 NUTS2 NUTS3) /// addtitles noval format(%15.0fc) title("Population of Netherlands at NUTS1-NUTS3 level") /// palette(CET L10) points(6) pad(0.3)

circlepack pop if NUTS0=="PT", by(NUTS2 NUTS3) /// addtitles noval format(%15.0fc) title("Population of Portugal at NUTS1-NUTS3 level") /// palette(CET C6) points(12) pad(0.1)

v1.1 updates

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS3) addtitle

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS3) addtitle labprop titleprop

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS3) addtitle labprop titleprop labs(1.5 2.5)

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS3) addtitle labprop titleprop threshold(1000000)

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS3) addtitle labprop titleprop labcond(1000000)

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS2 NUTS3) addtitle labprop titleprop labcond(1000000)

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS2 NUTS3) nolab fi(10 40 80)

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS2 NUTS3) nolab fi(40 60 100)

circlepack pop if NUTS0=="ES", by(NUTS1 NUTS3) addtitle labprop titleprop threshold(1000000) share

Feedback

Please open an issue to report errors, feature enhancements, and/or other requests.

Change log

v1.2 (15 Jan 2024) - Fixed several local bugs. - Code clean ups.

v1.1 (16 May 2023) - Major update with several new options added to align it with the treemap package. - labprop, titleprop, labscale(), threshold(), fi(), share options added. - Minor fixes to the code.

v1.01 (24 Nov 2022) - Sorting stabilized to prevent random circlemap layouts. - Negative and zero values are automatically dropped. - Improved precision of variables. - Minor fixes in the code.

v1.0 (08 Sep 2022) - First release

Owner

  • Name: Asjad Naqvi
  • Login: asjadnaqvi
  • Kind: user
  • Location: Vienna
  • Company: WIFO

Vienna, Austria

Citation (CITATION.cff)

cff-version: 1.2.0
authors:
- family-names: "Naqvi"
  given-names: "Asjad"
title: "Stata package ``circlepack''"
version: 1.2
date-released: 2024-01-15
url: "https://github.com/asjadnaqvi/stata-circlepack"

GitHub Events

Total
  • Issues event: 2
Last Year
  • Issues event: 2

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 4
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 4
  • Total pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • iahmed116 (1)
  • piumatti (1)
  • asjadnaqvi (1)
  • ericmelse (1)
Pull Request Authors
Top Labels
Issue Labels
enhancement (3)
Pull Request Labels