From 0d0833cbb9c237f377631c4aa4b4eb5c78133b39 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Wed, 29 Jun 2022 19:10:33 +1000 Subject: Refactor to provide default-option access to non-top-level components --- src/tol.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/tol.ts (limited to 'src/tol.ts') diff --git a/src/tol.ts b/src/tol.ts new file mode 100644 index 0000000..bf7a2f5 --- /dev/null +++ b/src/tol.ts @@ -0,0 +1,26 @@ +/* + * Used to represent tree-of-life data + */ + +// Represents a tree-of-life node +export class TolNode { + otolId: string | null; + children: string[]; + parent: string | null; + tips: number; + pSupport: boolean; + commonName: null | string; + imgName: null | string | + [string, string] | [null, string] | [string, null]; // Pairs represent compound-images + constructor(children: string[] = [], parent = null, tips = 0, pSupport = false){ + this.otolId = null; + this.children = children; + this.parent = parent; + this.tips = tips; + this.pSupport = pSupport; + this.commonName = null; + this.imgName = null; + } +} +// Maps TolNode names to TolNode objects +export type TolMap = Map; -- cgit v1.2.3