{"id":16619242,"url":"https://github.com/grahamgower/demesdraw","last_synced_at":"2025-03-16T22:30:39.017Z","repository":{"id":37978487,"uuid":"344898187","full_name":"grahamgower/demesdraw","owner":"grahamgower","description":"Drawing functions for Demes demographic models","archived":false,"fork":false,"pushed_at":"2024-04-08T08:36:25.000Z","size":196937,"stargazers_count":18,"open_issues_count":11,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-08T10:00:32.576Z","etag":null,"topics":["demes","drawing","figures","python"],"latest_commit_sha":null,"homepage":"https://grahamgower.github.io/demesdraw/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grahamgower.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-03-05T18:23:44.000Z","updated_at":"2024-04-15T09:46:13.975Z","dependencies_parsed_at":"2023-10-16T18:34:26.435Z","dependency_job_id":"33766c9c-199b-43b6-b79b-cc6c601a5b90","html_url":"https://github.com/grahamgower/demesdraw","commit_stats":{"total_commits":185,"total_committers":4,"mean_commits":46.25,"dds":0.4648648648648649,"last_synced_commit":"0b7d85003d7d61b56705e80acfd5eefa2688f06e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahamgower%2Fdemesdraw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahamgower%2Fdemesdraw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahamgower%2Fdemesdraw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahamgower%2Fdemesdraw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grahamgower","download_url":"https://codeload.github.com/grahamgower/demesdraw/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221668377,"owners_count":16860631,"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":["demes","drawing","figures","python"],"created_at":"2024-10-12T02:24:42.355Z","updated_at":"2024-10-27T11:25:34.891Z","avatar_url":"https://github.com/grahamgower.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DemesDraw\n\n`demesdraw` is a Python package that contains drawing functions for\n[Demes](https://popsim-consortium.github.io/demes-spec-docs/main/)\ndemographic models, using `matplotlib` to create the figures.\nDemesDraw offers both a command line interface, and a Python API.\nFeedback is very welcome.\n\n\n# Installation\n\nInstall with pip:\n```\n$ python3 -m pip install demesdraw\n```\n\nOr with conda:\n```\n$ conda install -c conda-forge demesdraw\n```\n\n# Example usage\n\n## Command line interface (CLI)\n\nThe CLI can be used to quickly plot a Demes YAML file.\nAny file format supported by matplotlib can be specified,\nbut a vector format such as svg or pdf is recommended.\n\n```\n$ demesdraw tubes --log-time \\\n\texamples/stdpopsim/HomSap__AmericanAdmixture_4B11.yaml \\\n\tAmericanAdmixture_4B11_tubes.svg\n```\n\n![stdpopsim/AmericanAdmixture_4B11 as tubes](https://raw.githubusercontent.com/grahamgower/demesdraw/main/docs/_static/AmericanAdmixture_4B11_tubes.svg)\n\n\n## Python API\n\nCompared with the CLI, the Python API provides additional control.\nIn the following example, the horizontal positions of the demes\nare chosen manually and the names of extinct demes are moved to\na legend.\n\n```python\nimport demes\nimport demesdraw\n\ngraph = demes.load(\"examples/stdpopsim/HomSap__AmericanAdmixture_4B11.yaml\")\nw = demesdraw.utils.separation_heuristic(graph)\npositions = dict(ancestral=0, AMH=0, AFR=0, OOA=1.5 * w, EAS=1 * w, EUR=2 * w, ADMIX=-w)\nax = demesdraw.tubes(graph, log_time=True, positions=positions, labels=\"xticks-legend\")\nax.figure.savefig(\"AmericanAdmixture_4B11_tubes_custom.svg\")\n```\n\n![stdpopsim/AmericanAdmixture_4B11 tubes_custom](https://raw.githubusercontent.com/grahamgower/demesdraw/main/docs/_static/AmericanAdmixture_4B11_tubes_custom.svg)\n\n# Documentation\n\nComplete API and CLI details are available in the \n[DemesDraw documentation](https://grahamgower.github.io/demesdraw).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahamgower%2Fdemesdraw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrahamgower%2Fdemesdraw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahamgower%2Fdemesdraw/lists"}