aboutsummaryrefslogtreecommitdiff
path: root/src/tol.ts
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-29 19:10:33 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-29 19:10:33 +1000
commit0d0833cbb9c237f377631c4aa4b4eb5c78133b39 (patch)
tree6ee2f42bf379ae95bf5409f41cc651007b5e7cdc /src/tol.ts
parent0486614da4d5916ef18fc3975e4e2d281899f507 (diff)
Refactor to provide default-option access to non-top-level components
Diffstat (limited to 'src/tol.ts')
-rw-r--r--src/tol.ts26
1 files changed, 26 insertions, 0 deletions
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<string, TolNode>;