npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mkoliba/phylogeny-tree

v3.18.0-beta.7

Published

Phylogenetic tree visualisation for the web.

Downloads

17

Readme

phylogeny-tree

Javascript phylogeny visualisation library for Newick tree format. It handles up to ~15 000 leaves.

Forked from phylocanvas-3 the development branch of Phylocanvas, developed by The Centre for Genomic Pathogen Surveillance.

Examples of usage are in dev/pages folder.

Example use

import createTree from '@mkoliba/phylogeny-tree/createTree';
import interactionsPlugin from '@mkoliba/phylogeny-tree-plugin-interactions/index';
import '@mkoliba/phylogeny-tree-plugin-interactions/styles.css';
import contextMenu from '@mkoliba/phylogeny-tree-plugin-context-menu/index';
import '@mkoliba/phylogeny-tree-plugin-context-menu/styles.css';

const newick =
'(Bovine:0.69395,(Gibbon:0.36079,(Orangutan:0.33636,(Gorilla:0.17147,(Chimp:0.19268,Human:0.11927):0.08386):0.06124):0.15057):0.54939,Mouse:1.2146);'
const canvas = document.querySelector('#canvas'),
const options = {
    source: newick,
    renderInternalLabels: true,
    rotatedIds: [
      '6',
    ],
    styles: {
      Mouse: { shape: 'square', fillStyle: 'red' },
      Human: { shape: 'triangle', fillStyle: 'green' },
      Gibbon: { shape: 'star', fillStyle: 'blue' },
      Bovine: { shape: 'hexagon', fillStyle: 'orange' },
      Chimp: { shape: 'hexastar', fillStyle: 'grey' },
      Orangutan: { shape: 'octastar', fillStyle: 'indigo' },
    }
  }
const plugins = [
    contextMenu,
    interactionsPlugin
  ]

const tree = createTree(canvas, options, plugins)

In React project use [react-phylogeny-treettps://github.com/mkoliba/react-pppphylogeny-treeh wrap Phylocanvas3 in component or hook.

API

  • createTree Parameters:
    • canvas: canvas element
    • options: Phylocanvas3 Options object, have to contain key source with newick string, see Options below
    • plugins: array of Phylocanvas3 Plugins, see plugins section bellow

Options

Properties of options object overide default options properties ({ ...defaultOptions, ...options }) and resulting object is set as initial state of the tree.

Some of available options:

  • source: newick tree string, or object {type: 'biojs', data} where data key contains to biojs-io-newick tree object received from parser.parse_newick.

For others check default options and examples in dev folder.

Plugins

Plugins have to have a folowing type:

((tree: Tree, decorate: (fnName: string, fn: unknown) => void) => void)[];

Available plugins:

add package to your project using yarn add or npm install -S