From 2ab48497797441164e7f57fca2660097d93398ca Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Mon, 25 Apr 2022 01:33:08 +1000
Subject: Adapt to handle open-tree-of-life data

Added data_otol/ with script that converts data from 'Open Tree of Life' release 13.4 into a JSON form.
Moved old tree-of-life data and images into data_tol_old/.
Added TolMap type to tol.ts, changed TolNode, and adapted other code to handle it.
Temporarily disabling tile images until image data is added.
---
 src/components/AncestryBar.vue | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src/components/AncestryBar.vue')

diff --git a/src/components/AncestryBar.vue b/src/components/AncestryBar.vue
index 6d6ae3c..a156a96 100644
--- a/src/components/AncestryBar.vue
+++ b/src/components/AncestryBar.vue
@@ -3,6 +3,7 @@ import {defineComponent, PropType} from 'vue';
 import Tile from './Tile.vue'
 import {LayoutNode} from '../layout';
 import type {LayoutOptions} from '../layout';
+import type {TolMap} from '../tol';
 
 // Displays a sequence of nodes, representing ancestors from a tree-of-life root to a currently-active root
 export default defineComponent({
@@ -12,7 +13,8 @@ export default defineComponent({
 		dims: {type: Array as unknown as PropType<[number,number]>, required: true},
 		// The ancestors to display
 		nodes: {type: Array as PropType<LayoutNode[]>, required: true},
-		// Options
+		// Other
+		tolMap: {type: Object as PropType<TolMap>, required: true},
 		lytOpts: {type: Object as PropType<LayoutOptions>, required: true},
 		uiOpts: {type: Object, required: true},
 	},
@@ -26,7 +28,7 @@ export default defineComponent({
 		},
 		usedNodes(){ // Childless versions of 'nodes' used to parameterise <tile>
 			return this.nodes.map(n => {
-				let newNode = new LayoutNode(n.tolNode, []);
+				let newNode = new LayoutNode(n.name, []);
 				newNode.dims = [this.tileSz, this.tileSz];
 				return newNode;
 			});
@@ -80,8 +82,8 @@ export default defineComponent({
 
 <template>
 <div :style="styles">
-	<tile v-for="(node, idx) in usedNodes" :key="node.tolNode.name" class="shrink-0"
-		:layoutNode="node" :nonAbsPos="true" :lytOpts="lytOpts" :uiOpts="uiOpts"
+	<tile v-for="(node, idx) in usedNodes" :key="node.name" class="shrink-0"
+		:layoutNode="node" :tolMap="tolMap" :nonAbsPos="true" :lytOpts="lytOpts" :uiOpts="uiOpts"
 		@leaf-click="onTileClick(nodes[idx])" @info-icon-click="onInfoIconClick"/>
 </div>
 </template>
-- 
cgit v1.2.3

