{ "info": { "author": "Elmotec", "author_email": "elmotec@gmx.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development", "Topic :: Utilities" ], "description": ".. image:: https://img.shields.io/pypi/v/circlify.svg\n :target: https://pypi.org/pypi/circlify/\n :alt: PyPi version\n\n.. image:: https://img.shields.io/pypi/pyversions/circlify.svg\n :target: https://pypi.org/pypi/circlify/\n :alt: Python compatibility\n\n.. image:: https://img.shields.io/travis/elmotec/circlify.svg\n :target: https://travis-ci.org/elmotec/circlify\n :alt: Build Status\n\n.. image:: https://coveralls.io/repos/elmotec/circlify/badge.svg\n :target: https://coveralls.io/r/elmotec/circlify\n :alt: Coverage\n\n.. image:: https://img.shields.io/codacy/grade/474b0af6853a4c5f8f9214d3220571f9.svg\n :target: https://www.codacy.com/app/elmotec/circlify/dashboard\n :alt: Codacy\n\n\n========\ncirclify\n========\n\nPure Python implementation of circle packing layout algorithm.\n\nCircles are first arranged via a version of A1.0 by Huang et al (see https://home.mis.u-picardie.fr/~cli/Publis/circle.pdf for details) and then enclosed in a circle created around them using Matou\u00c5\u00a1ek-Sharir-Welzl algorithm used in d3js (see https://beta.observablehq.com/@mbostock/miniball, http://www.inf.ethz.ch/personal/emo/PublFiles/SubexLinProg_ALG16_96.pdf, and https://github.com/d3/d3-hierarchy/blob/master/src/pack/enclose.js)\n\nInstallation\n------------\n\nUsing pip:\n\n::\n\n pip install circlify\n\nor using the source:\n\n:: \n\n git clone git://github.com/elmotec/circlify.git\n cd circlify\n python setup.py install\n\n\nThe last step may require ``sudo`` if you don't have root access.\n\n\nUsage\n-----\n\nThe main function ``circlify`` is supported by a small data class ``circlify.Circle`` and takes 3 parameters:\n\n* A list of positive values sorted from largest to smallest.\n* (optional) A target enclosure where the packed circles should fit. It defaults to the unit circle (0, 0, 1).\n* (optional) A boolean indicating if the target enclosure should be appended to the output.\n\nThe function returns a list of ``circlify.Circle`` objects, each one corresponding\nto the coordinates and radius of cirlces proportional to the corresponding input value.\n\n\nExample\n-------\n\n.. code:: python\n\n import circlify as circ\n\n data = [19, 17, 13, 11, 7, 5, 3, 2, 1]\n circles = circ.circlify(data, with_enclosure=True)\n\n\nThe variable `circles` contains (level 0 is the enclosure):\n\n.. code:: python\n\n [\n circ.Circle(x=0.0, y=0.0, r=1.0, level=0),\n circ.Circle(x=0.09222041925800777, y=0.8617116738294696,\n r=0.09068624109026069),\n circ.Circle(x=-0.40283175658099674, y=0.7512387781681531,\n r=0.12824971207048294),\n circ.Circle(x=0.3252787490004198, y=0.7776370388468007,\n r=0.15707317711577193),\n circ.Circle(x=0.48296614887228806, y=0.4541723195782383,\n r=0.20278059970175755),\n circ.Circle(x=-0.6132109517981927, y=0.4490810687795324,\n r=0.23993324126007678),\n circ.Circle(x=-0.045884607890591435, y=-0.6977206243364218,\n r=0.3007722353441051),\n circ.Circle(x=-0.04661299415374866, y=0.4678014425767657,\n r=0.32697389223002427),\n circ.Circle(x=-0.411432317820337, y=-0.13064957525245907,\n r=0.3739089508053733),\n circ.Circle(x=0.35776879346704843, y=-0.13064957525245907,\n r=0.39529216048201216),\n ]\n\n\nA simple matplotlib representation. See ``circlify.bubbles`` helper function (requires ``matplotlib``):\n\n.. figure:: https://github.com/elmotec/circlify/blob/master/static/Figure_3.png\n :alt: visualization of circlify circle packing of first 9 prime numbers.\n\nStarting with version 0.10, circlify also handle hierarchical input so that:\n\n.. code:: python\n\n import circlify as circ\n\n data = [0.05, {'id': 'a2', 'datum': 0.05},\n {'id': 'a0', 'datum': 0.8, 'children': [0.3, 0.2, 0.2, 0.1], },\n {'id': 'a1', 'datum': 0.1, 'children':\n [ {'id': 'a1_1', 'datum': 0.05}, {'datum': 0.04}, 0.01],},\n ]\n circles = circ.circlify(data, with_enclosure=True)\n\n\nreturns:\n\n.. code:: python\n\n [\n circ.Circle(level=0, r=1.0),\n circ.Circle(x=-0.565803075997749, y=0.41097786651145324,\n r=0.18469903125906464),\n circ.Circle(x=-0.3385727489559141, y=0.7022188441650276,\n r=0.18469903125906464, ex={'id': 'a2', 'datum': 0.05}),\n circ.Circle(x=-0.7387961250362587, r=0.2612038749637415,\n ex={'id': 'a1', 'datum': 0.1,\n 'children': [{'id': 'a1_1', 'datum': 0.05},\n {'datum': 0.04},\n {'id': 'a1_2', 'datum': 0.01}]}),\n circ.Circle(x=0.2612038749637414, r=0.7387961250362586,\n ex={'id': 'a0', 'datum': 0.8,\n 'children': [0.3, 0.2, 0.2, 0.1]}),\n circ.Circle(level=2, x=-0.7567888163564136,\n y=0.14087823651338607, r=0.0616618704777984,\n ex={'id': 'a1_2', 'datum': 0.01}),\n circ.Circle(level=2, x=-0.8766762590444033, y=0.0,\n r=0.1233237409555968,\n ex={'datum': 0.04}),\n circ.Circle(level=2, ex={'id': 'a1_1', 'datum': 0.05},\n x=-0.6154723840806618, y=0.0, r=0.13788013400814464),\n circ.Circle(level=2, x=0.6664952237042423,\n y=0.3369290873460549, r=0.2117455702848763),\n circ.Circle(level=2, x=-0.11288314691830154,\n y=-0.230392881357073, r=0.2994534572692975),\n circ.Circle(level=2, x=0.15631936804871832,\n y=0.30460197676548245, r=0.2994534572692975),\n circ.Circle(level=2, x=0.5533243963620484,\n y=-0.230392881357073, r=0.36675408601105247),\n ]\n\n\nA simple matplotlib representation. See ``circlify.bubbles`` helper function (requires ``matplotlib``):\n\n.. figure:: https://github.com/elmotec/circlify/blob/master/static/Figure_4.png\n :alt: visualization of circlify nested circle packing for a hierarchical input.\n\n*Note* that the area of the circles are proportional to the values passed in input only if the circles are at the same hierarchical level.\nFor instance: circles *a1_1* and *a2* both have a value of 0.05, yet *a1_1* is smaller than *a2* because *a1_1* is fitted within its parent circle *a1* one level below the level of *a2*.\nIn other words, the level 1 circles *a1* and *a2* are both proportional to their respective values but *a1_1* is proportional to the values on level 2 witin *a1*.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/elmotec/circlify", "keywords": "circle packing enclosure hierarchy graph display visualization", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "circlify", "package_url": "https://pypi.org/project/circlify/", "platform": "", "project_url": "https://pypi.org/project/circlify/", "project_urls": { "Homepage": "http://github.com/elmotec/circlify" }, "release_url": "https://pypi.org/project/circlify/0.10.0/", "requires_dist": null, "requires_python": ">2.7,>=3.4", "summary": "Circle packing algorithm for Python", "version": "0.10.0" }, "last_serial": 5285663, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "a6251d8a520fa168ed38be27c23b2f15", "sha256": "b5f44fe89784cb64d22065cdeaa16d846690487d22fbbe5a9b466f58539124c6" }, "downloads": -1, "filename": "circlify-0.10.0.tar.gz", "has_sig": false, "md5_digest": "a6251d8a520fa168ed38be27c23b2f15", "packagetype": "sdist", "python_version": "source", "requires_python": ">2.7,>=3.4", "size": 8885, "upload_time": "2019-05-18T12:39:00", "url": "https://files.pythonhosted.org/packages/bb/e2/96747e9b7f315edf44598408b71603f89da33bca2792e8cdede71797b35e/circlify-0.10.0.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "d9a1eacb644b3713b97d6b177f72ebae", "sha256": "5c3eee2065e1ee9b09244a1cfe8d393a8840b11ae3626e5e5d01b4a1f6952448" }, "downloads": -1, "filename": "circlify-0.9.tar.gz", "has_sig": false, "md5_digest": "d9a1eacb644b3713b97d6b177f72ebae", "packagetype": "sdist", "python_version": "source", "requires_python": ">2.7,>=3.3", "size": 6275, "upload_time": "2018-06-14T01:34:56", "url": "https://files.pythonhosted.org/packages/62/f0/b06417d26103118defb8bf28cb27e79a557f29a9bc3cd7b48a3d59fb1465/circlify-0.9.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "09db562b7e5c4b6be238227b8db3005c", "sha256": "2fb57d77be9503044239d466f4a600095979f104b74c8295cff823b40eb895cb" }, "downloads": -1, "filename": "circlify-0.9.1.tar.gz", "has_sig": false, "md5_digest": "09db562b7e5c4b6be238227b8db3005c", "packagetype": "sdist", "python_version": "source", "requires_python": ">2.7,>=3.3", "size": 6294, "upload_time": "2018-06-14T01:38:15", "url": "https://files.pythonhosted.org/packages/0d/ff/23f5b3e6970f4339e7d248427c5c75f432ead2418e3f31d02192c533ebfe/circlify-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "da20771d07e8ae72c1cee94b89a2f867", "sha256": "824545e51274d45acd87c00cd23a6be518e1d7701ef1d62b21a770ebe5b17479" }, "downloads": -1, "filename": "circlify-0.9.2.tar.gz", "has_sig": false, "md5_digest": "da20771d07e8ae72c1cee94b89a2f867", "packagetype": "sdist", "python_version": "source", "requires_python": ">2.7,>=3.4", "size": 6602, "upload_time": "2019-04-27T14:38:01", "url": "https://files.pythonhosted.org/packages/8d/c0/9e4eaa9a67f931264162b77b6eec7c8e0a6a756c81f4466244cc32feb156/circlify-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "ff39676368ab661700ad7b68faa240c1", "sha256": "a77af12570c405fb9dea12b2ba5894a2fe673a7a5b3c1f497d3503fa09cff460" }, "downloads": -1, "filename": "circlify-0.9.3.tar.gz", "has_sig": false, "md5_digest": "ff39676368ab661700ad7b68faa240c1", "packagetype": "sdist", "python_version": "source", "requires_python": ">2.7,>=3.4", "size": 6658, "upload_time": "2019-05-04T23:16:57", "url": "https://files.pythonhosted.org/packages/ab/0d/14c208bec741b38ee5f17a69c5d0391999cee77c2023da23c1a214cfa8ca/circlify-0.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a6251d8a520fa168ed38be27c23b2f15", "sha256": "b5f44fe89784cb64d22065cdeaa16d846690487d22fbbe5a9b466f58539124c6" }, "downloads": -1, "filename": "circlify-0.10.0.tar.gz", "has_sig": false, "md5_digest": "a6251d8a520fa168ed38be27c23b2f15", "packagetype": "sdist", "python_version": "source", "requires_python": ">2.7,>=3.4", "size": 8885, "upload_time": "2019-05-18T12:39:00", "url": "https://files.pythonhosted.org/packages/bb/e2/96747e9b7f315edf44598408b71603f89da33bca2792e8cdede71797b35e/circlify-0.10.0.tar.gz" } ] }