Home

Awesome

clld-phylogeny-plugin

Plugin for the clld framework providing support for phylogenetic trees in clld apps.

This plugin includes the phylotree library to render phylogenetic trees in the browser.

Build Status PyPI

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

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:

    config.include('clld_phylogeny_plugin')

This will add a Resource Phylogeny with corresponding routes

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:

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)