diff --git a/src/App.jsx b/src/App.jsx index 61249098..dff681a5 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,7 +2,7 @@ import "./App.css"; import React, { useEffect, useState, useCallback ,useMemo} from "react"; import Deck from "./Deck"; import SearchPanel from "./components/SearchPanel"; -import axios from "axios"; +//import axios from "axios"; import AboutOverlay from "./components/AboutOverlay"; import { BrowserRouter as Router } from "react-router-dom"; import { CgListTree } from "react-icons/cg"; @@ -59,11 +59,17 @@ function App() { useEffect(() => { const tree = window.kn_parse(window.newick) + + window.kn_reorder(tree,tree.root) + tree.node_order = window.kn_expand_node(tree,tree.root) window.kn_calxy(tree,true) - tree.ids = [...Array(tree.x.length).keys()]; - tree.x=tree.x.map(x=>10*(x+0.1)) - tree.y=tree.y.map(x=>10*(x+0.1)) window.tree=tree + + tree.x=tree.x.map(a=>15*(a+0.1)) + tree.y=tree.y.map(a=>30*(a+0.1)) + //tree.names=tree.node.map(a=>a.name) + tree.ids = [...Array(tree.names.length).keys()]; + //tree.parents=tree.node.map(a=>tree.node.findIndex(x=>x===a)) setNodeData({ status: "loaded", data: {node_data:tree} }); }, [nodeData.status]); diff --git a/src/Deck.jsx b/src/Deck.jsx index b88b21e1..2c11fadc 100644 --- a/src/Deck.jsx +++ b/src/Deck.jsx @@ -131,10 +131,10 @@ function toRGB(string) { } return rgb; } -function toRGBCSS(string) { +/*function toRGBCSS(string) { const output = toRGB(string); return `rgb(${output[0]},${output[1]},${output[2]})`; -} +}*/ let getMMatrix = (zoom) => [ 1 / 2 ** (zoom - 5.6), @@ -564,7 +564,8 @@ function Deck({ data, colourBy, progress, setSelectedNode,scatterIds,search_conf const hoverStuff = useMemo(() => { if (hoverInfo && hoverInfo.object) { - const lineage = + return <>{hoverInfo.object} + /*const lineage = data.lineage_mapping[node_data.lineages[hoverInfo.object]]; const country = data.country_mapping[node_data.countries[hoverInfo.object]]; @@ -604,8 +605,8 @@ function Deck({ data, colourBy, progress, setSelectedNode,scatterIds,search_conf ); - } - }, [data, node_data, hoverInfo]); + */} + }, [hoverInfo]); const spinnerShown = useMemo(() => node_data.ids.length === 0, [node_data]); diff --git a/src/helpers/tree.js.REMOVED.git-id b/src/helpers/tree.js.REMOVED.git-id index 2fb47a07..040fcb37 100644 --- a/src/helpers/tree.js.REMOVED.git-id +++ b/src/helpers/tree.js.REMOVED.git-id @@ -1 +1 @@ -6dbfc5bcf3223b030bc229590bdbbbef06e05a58 \ No newline at end of file +7b99ffc1eb80e2f3e76b17d8ff33535e9aa5b461 \ No newline at end of file