{"id":26334458,"url":"https://github.com/asjadnaqvi/stata-circlepack","last_synced_at":"2026-01-02T17:11:16.112Z","repository":{"id":113395575,"uuid":"534146007","full_name":"asjadnaqvi/stata-circlepack","owner":"asjadnaqvi","description":"A Stata package for circle packing","archived":false,"fork":false,"pushed_at":"2024-05-26T19:08:59.000Z","size":15199,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T06:34:46.283Z","etag":null,"topics":["ado","circlepack","circlepacking","package","stata"],"latest_commit_sha":null,"homepage":"","language":"Stata","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asjadnaqvi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"asjadnaqvi"}},"created_at":"2022-09-08T09:43:55.000Z","updated_at":"2024-07-07T04:05:57.000Z","dependencies_parsed_at":"2024-01-15T23:26:55.500Z","dependency_job_id":null,"html_url":"https://github.com/asjadnaqvi/stata-circlepack","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asjadnaqvi%2Fstata-circlepack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asjadnaqvi%2Fstata-circlepack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asjadnaqvi%2Fstata-circlepack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asjadnaqvi%2Fstata-circlepack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asjadnaqvi","download_url":"https://codeload.github.com/asjadnaqvi/stata-circlepack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806719,"owners_count":20350896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ado","circlepack","circlepacking","package","stata"],"created_at":"2025-03-16T00:19:03.813Z","updated_at":"2026-01-02T17:11:16.074Z","avatar_url":"https://github.com/asjadnaqvi.png","language":"Stata","funding_links":["https://github.com/sponsors/asjadnaqvi"],"categories":[],"sub_categories":[],"readme":"\n![StataMin](https://img.shields.io/badge/stata-2015-blue) ![issues](https://img.shields.io/github/issues/asjadnaqvi/stata-circlepack) ![license](https://img.shields.io/github/license/asjadnaqvi/stata-circlepack) ![Stars](https://img.shields.io/github/stars/asjadnaqvi/stata-circlepack) ![version](https://img.shields.io/github/v/release/asjadnaqvi/stata-circlepack) ![release](https://img.shields.io/github/release-date/asjadnaqvi/stata-circlepack)\n\n[Installation](#Installation) | [Syntax](#Syntax) | [Examples](#Examples) | [Feedback](#Feedback) | [Change log](#Change-log)\n\n---\n\n![circlepack-1](https://github.com/asjadnaqvi/stata-circlepack/assets/38498046/1d215337-0bf6-4b8f-9d00-f338267e631c)\n\n\n# circlepack v1.2\n(15 Jan 2024)\n\nA Stata package for circle packing. It is based on D3's [packEnclose](https://observablehq.com/@d3/d3-packenclose) and Python's [circlify](https://github.com/elmotec/circlify) algorithms.\n\n\n## Installation\n\nThe 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.\n\nThe SSC version (**v1.2**):\n```\nssc install circlepack, replace\n```\n\nOr it can be installed from GitHub (**v1.2**):\n\n```\nnet install circlepack, from(\"https://raw.githubusercontent.com/asjadnaqvi/stata-circlepack/main/installation/\") replace\n```\n\n\nThe `palettes` package is required to run this command:\n\n```\nssc install palettes, replace\nssc install colrspace, replace\n```\n\nEven if you have the package installed, make sure that it is updated `ado update, update`.\n\nIf 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:\n\n```\nssc install schemepack, replace\nset scheme white_tableau  \n```\n\nYou can also push the scheme directly into the graph using the `scheme(schemename)` option. See the help file for details or the example below.\n\nI also prefer narrow fonts in figures with long labels. You can change this as follows:\n\n```\ngraph set window fontface \"Arial Narrow\"\n```\n\n\n## Syntax\n\nThe syntax for the latest version is as follows:\n\n```\ncirclepack numvar [if] [in], by(variables (min=1, max=3)) \n        [ pad(num) points(num) angle(num) circle0 circle0c(str) format(str) palette(string) share \n          labprop titleprop labscale(num) threshold(num) fi(list) addtitles novalues nolabels labsize(num) \n          title(str) subtitle(str) note(str) scheme(str) name(str) ]\n\n```\n\nSee the help file `help circlepack` for details.\n\nThe most basic use is as follows:\n\n```\ncirclepack numvar, over(variable(s))\n```\n\nwhere `numvar` is a numeric variable, and `over()` are upto three variables, defined from more aggregate to finer levels.\n\n\n## Examples\n\nSet up the data:\n\n```\nclear\nset scheme white_tableau\ngraph set window fontface \"Arial Narrow\"\n\nuse \"https://github.com/asjadnaqvi/stata-circlepack/blob/main/data/demo_r_pjangrp3_clean.dta?raw=true\", clear\n```\n\n\n\n```\ncirclepack pop, by(NUTS0) format(%15.0fc) title(\"Population of European countries\")\n```\n\n\u003cimg src=\"/figures/circlepack1.png\" width=\"100%\"\u003e\n\n\n```\ncirclepack pop, by(NUTS0) title(\"Population of European countries\") noval\n```\n\n\u003cimg src=\"/figures/circlepack2.png\" width=\"100%\"\u003e\n\n\n```\ncirclepack pop, by(NUTS0) title(\"Population of European countries\") circle0 noval\n```\n\n\u003cimg src=\"/figures/circlepack3.png\" width=\"100%\"\u003e\n\n\n```\ncirclepack pop, by(NUTS0 NUTS1) format(%15.0fc) noval circle0 \n```\n\n\u003cimg src=\"/figures/circlepack4.png\" width=\"100%\"\u003e\n\n\n```\ncirclepack pop, by(NUTS0 NUTS1) format(%15.0fc) noval addtitles\n```\n\n\u003cimg src=\"/figures/circlepack5.png\" width=\"100%\"\u003e\n\n```\ncirclepack pop, by(NUTS0 NUTS1 NUTS2) format(%15.0fc) nolab pad(0.06)\n```\n\n\u003cimg src=\"/figures/circlepack6.png\" width=\"100%\"\u003e\n\n```\ncirclepack pop if NUTS0==\"AT\", by(NUTS1 NUTS2 NUTS3) ///\n\taddtitles noval format(%15.0fc) circle0 ///\n\ttitle(\"Population of Austria at NUTS2 and NUTS3 level\") \n```\n\n\u003cimg src=\"/figures/circlepack7.png\" width=\"100%\"\u003e\n\n```\ncirclepack pop if NUTS0==\"NL\", by(NUTS2 NUTS3) addtitles ///\n\tformat(%15.0fc) title(\"Population of Netherlands at NUTS2 and NUTS3 level\") \n```\n\n\u003cimg src=\"/figures/circlepack8.png\" width=\"100%\"\u003e\n\n\n```\ncirclepack pop if NUTS0==\"NL\", by(NUTS1 NUTS2 NUTS3) ///\n\taddtitles noval format(%15.0fc) title(\"Population of Netherlands at NUTS1-NUTS3 level\") ///\n\tpalette(CET L10) \n```\n\n\u003cimg src=\"/figures/circlepack9.png\" width=\"100%\"\u003e\n\n```\ncirclepack pop if NUTS0==\"NL\", by(NUTS1 NUTS2 NUTS3)  ///\n\taddtitles noval format(%15.0fc) title(\"Population of Netherlands at NUTS1-NUTS3 level\") ///\n\tpalette(CET L10) points(6) pad(0.3)\n```\n\n\u003cimg src=\"/figures/circlepack10.png\" width=\"100%\"\u003e\n\n```\ncirclepack pop if NUTS0==\"PT\", by(NUTS2 NUTS3) ///\n\taddtitles noval format(%15.0fc) title(\"Population of Portugal at NUTS1-NUTS3 level\") ///\n\tpalette(CET C6) points(12) pad(0.1) \n```\n\n\u003cimg src=\"/figures/circlepack11.png\" width=\"100%\"\u003e\n\n\n### v1.1 updates\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS3) addtitle\n```\n\n\u003cimg src=\"/figures/circlepack12.png\" width=\"100%\"\u003e\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS3) addtitle labprop titleprop\n```\n\n\u003cimg src=\"/figures/circlepack13.png\" width=\"100%\"\u003e\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS3) addtitle labprop titleprop labs(1.5 2.5)\n```\n\n\u003cimg src=\"/figures/circlepack14.png\" width=\"100%\"\u003e\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS3) addtitle labprop titleprop threshold(1000000)\n```\n\n\u003cimg src=\"/figures/circlepack15.png\" width=\"100%\"\u003e\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS3) addtitle labprop titleprop labcond(1000000)\n```\n\n\u003cimg src=\"/figures/circlepack16.png\" width=\"100%\"\u003e\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS2 NUTS3) addtitle labprop titleprop labcond(1000000)\n```\n\n\u003cimg src=\"/figures/circlepack17.png\" width=\"100%\"\u003e\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS2 NUTS3)  nolab fi(10 40 80)\n```\n\n\u003cimg src=\"/figures/circlepack18.png\" width=\"100%\"\u003e\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS2 NUTS3)  nolab fi(40 60 100)\n```\n\n\u003cimg src=\"/figures/circlepack19.png\" width=\"100%\"\u003e\n\n\n```\ncirclepack    pop if NUTS0==\"ES\", by(NUTS1 NUTS3) addtitle labprop titleprop threshold(1000000) share\n```\n\n\u003cimg src=\"/figures/circlepack20.png\" width=\"100%\"\u003e\n\n## Feedback\n\nPlease open an [issue](https://github.com/asjadnaqvi/stata-circlepack/issues) to report errors, feature enhancements, and/or other requests. \n\n\n## Change log\n\n**v1.2 (15 Jan 2024)**\n- Fixed several local bugs.\n- Code clean ups.\n\n**v1.1 (16 May 2023)**\n- Major update with several new options added to align it with the `treemap` package.\n- `labprop`, `titleprop`, `labscale()`, `threshold()`, `fi()`, `share` options added.\n- Minor fixes to the code.\n\n**v1.01 (24 Nov 2022)**\n- Sorting stabilized to prevent random circlemap layouts.\n- Negative and zero values are automatically dropped.\n- Improved precision of variables.\n- Minor fixes in the code.\n\n**v1.0 (08 Sep 2022)**\n- First release\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasjadnaqvi%2Fstata-circlepack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasjadnaqvi%2Fstata-circlepack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasjadnaqvi%2Fstata-circlepack/lists"}