# clld-phylogeny-plugin
Plugin for the [clld](https://github.com/clld/clld) framework providing
support for phylogenetic trees in clld apps.
This plugin includes the [phylotree](https://github.com/veg/phylotree.js/tree/master)
library to render phylogenetic trees in the browser.
[![Build Status](https://github.com/clld/clld-phylogeny-plugin/workflows/tests/badge.svg)](https://github.com/clld/clld-phylogeny-plugin/actions?query=workflow%3Atests)
[![PyPI](https://img.shields.io/pypi/v/clld-phylogeny-plugin.svg)](https://pypi.python.org/pypi/clld-phylogeny-plugin)
## Introduction
While plotting cross-linguistic data on a map serves as quick visualization of the correlation between the data and geography, plotting the data on a phylogenetic tree allows inspection of the correlation between the data and some theory about language relatedness, embodied in the tree.
The `clld-phylogeny-plugin` package supports this kind of visualization by
- adding [database models](https://github.com/clld/clld-phylogeny-plugin/blob/master/src/clld_phylogeny_plugin/models.py) to store phylogenetic trees (and how the tree labels correspond to `Language` objects)
- adding a [`Tree` component](https://github.com/clld/clld-phylogeny-plugin/blob/f98e83681e7464d3abfb05eae2f1a3c74fdabc1f/src/clld_phylogeny_plugin/tree.py#L34), allowing simple rendering of a tree on a page
- adding support for "plotting" `Parameter` objects on a tree, i.e. plotting the value for a given (`Parameter`, `Language`) pair next to the language's label on the tree.
## Usage
TODO: See https://github.com/clld/grambank/commit/4101243597c3c95d21786fe8bdcf8cf060da609b for a minimal example.
To make `clld-phylogeny-plugin` functionality available to a `clld` app, it must be included in the app's configuration - typically in `<app>:main`:
```python
config.include('clld_phylogeny_plugin')
```
This will add a *Resource* `Phylogeny` with corresponding routes
- `/phylogenys` - the index page listing all available phylogenies
- `/phylogenys/<ID>` - a phylogeny's details page, by default rendering the associated tree.
### Plotting parameters on trees
To synchronize plotting of markers for parameter values on maps and trees, the `Tree.get_marker` method may need to
be adjusted. This can be done by registering a derived `Tree` class as `ITree` utility:
```python
class MyTree(clld_phylogeny_plugin.tree.Tree):
def get_marker(self, valueset):
# compute marker shape and color from valueset
return shape, color
....
config.registry.registerUtility(MyTree, ITree)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/clld-phylogeny-plugin",
"name": "clld-phylogeny-plugin",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "linguistics",
"author": "Robert Forkel and Hans-J\u00f6rg Bibiko",
"author_email": "dlce.rdm@eva.mpg.de",
"download_url": "https://files.pythonhosted.org/packages/0a/f8/8c71c5c58dbcd2930ebc6574c67c7c2f98cc7cc25ddb061cbf39504dd88f/clld-phylogeny-plugin-1.6.0.tar.gz",
"platform": "any",
"description": "# clld-phylogeny-plugin\n\nPlugin for the [clld](https://github.com/clld/clld) framework providing\nsupport for phylogenetic trees in clld apps.\n\nThis plugin includes the [phylotree](https://github.com/veg/phylotree.js/tree/master)\nlibrary to render phylogenetic trees in the browser.\n\n[![Build Status](https://github.com/clld/clld-phylogeny-plugin/workflows/tests/badge.svg)](https://github.com/clld/clld-phylogeny-plugin/actions?query=workflow%3Atests)\n[![PyPI](https://img.shields.io/pypi/v/clld-phylogeny-plugin.svg)](https://pypi.python.org/pypi/clld-phylogeny-plugin)\n\n\n## Introduction\n\nWhile plotting cross-linguistic data on a map serves as quick visualization of the correlation between the data and geography, plotting the data on a phylogenetic tree allows inspection of the correlation between the data and some theory about language relatedness, embodied in the tree.\n\nThe `clld-phylogeny-plugin` package supports this kind of visualization by\n- adding [database models](https://github.com/clld/clld-phylogeny-plugin/blob/master/src/clld_phylogeny_plugin/models.py) to store phylogenetic trees (and how the tree labels correspond to `Language` objects)\n- adding a [`Tree` component](https://github.com/clld/clld-phylogeny-plugin/blob/f98e83681e7464d3abfb05eae2f1a3c74fdabc1f/src/clld_phylogeny_plugin/tree.py#L34), allowing simple rendering of a tree on a page\n- adding support for \"plotting\" `Parameter` objects on a tree, i.e. plotting the value for a given (`Parameter`, `Language`) pair next to the language's label on the tree.\n\n\n## Usage\n\nTODO: See https://github.com/clld/grambank/commit/4101243597c3c95d21786fe8bdcf8cf060da609b for a minimal example.\n\nTo make `clld-phylogeny-plugin` functionality available to a `clld` app, it must be included in the app's configuration - typically in `<app>:main`:\n```python\n config.include('clld_phylogeny_plugin')\n```\n\nThis will add a *Resource* `Phylogeny` with corresponding routes\n- `/phylogenys` - the index page listing all available phylogenies\n- `/phylogenys/<ID>` - a phylogeny's details page, by default rendering the associated tree.\n\n\n### Plotting parameters on trees\n\nTo synchronize plotting of markers for parameter values on maps and trees, the `Tree.get_marker` method may need to\nbe adjusted. This can be done by registering a derived `Tree` class as `ITree` utility:\n```python\nclass MyTree(clld_phylogeny_plugin.tree.Tree):\n def get_marker(self, valueset):\n # compute marker shape and color from valueset\n return shape, color\n\n....\n config.registry.registerUtility(MyTree, ITree)\n```\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "A clld plugin to support language phylogenies",
"version": "1.6.0",
"project_urls": {
"Homepage": "https://github.com/clld-phylogeny-plugin"
},
"split_keywords": [
"linguistics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2ee71d34697398110bbeb803abb35769b6595a9ceb758bc8a4ecdb64a517a9a8",
"md5": "ea91c11d0021cb27d6ad9def6c5ace80",
"sha256": "10c2249361f5ac0a12a94df43349d29f4b6971715ad2fa8fc58dd3307213baf5"
},
"downloads": -1,
"filename": "clld_phylogeny_plugin-1.6.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ea91c11d0021cb27d6ad9def6c5ace80",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8",
"size": 178075,
"upload_time": "2023-11-30T12:08:19",
"upload_time_iso_8601": "2023-11-30T12:08:19.157466Z",
"url": "https://files.pythonhosted.org/packages/2e/e7/1d34697398110bbeb803abb35769b6595a9ceb758bc8a4ecdb64a517a9a8/clld_phylogeny_plugin-1.6.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0af88c71c5c58dbcd2930ebc6574c67c7c2f98cc7cc25ddb061cbf39504dd88f",
"md5": "004e8383f3f2ed569f5954a518edeab6",
"sha256": "0c39d77bae2d043ac2dda9903c2ab2d09334105a9715e5a6ba2212c9b6e0a6ba"
},
"downloads": -1,
"filename": "clld-phylogeny-plugin-1.6.0.tar.gz",
"has_sig": false,
"md5_digest": "004e8383f3f2ed569f5954a518edeab6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 176397,
"upload_time": "2023-11-30T12:08:22",
"upload_time_iso_8601": "2023-11-30T12:08:22.406517Z",
"url": "https://files.pythonhosted.org/packages/0a/f8/8c71c5c58dbcd2930ebc6574c67c7c2f98cc7cc25ddb061cbf39504dd88f/clld-phylogeny-plugin-1.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-30 12:08:22",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "clld-phylogeny-plugin"
}