Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
Former-commit-id: d520064
  • Loading branch information
theosanderson committed Jul 10, 2021
1 parent f9ad063 commit b9db7d1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
14 changes: 10 additions & 4 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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]);

Expand Down
11 changes: 6 additions & 5 deletions src/Deck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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]];
Expand Down Expand Up @@ -604,8 +605,8 @@ function Deck({ data, colourBy, progress, setSelectedNode,scatterIds,search_conf
</div>
</div>
);
}
}, [data, node_data, hoverInfo]);
*/}
}, [hoverInfo]);
const spinnerShown = useMemo(() => node_data.ids.length === 0, [node_data]);


Expand Down
2 changes: 1 addition & 1 deletion src/helpers/tree.js.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6dbfc5bcf3223b030bc229590bdbbbef06e05a58
7b99ffc1eb80e2f3e76b17d8ff33535e9aa5b461

0 comments on commit b9db7d1

Please sign in to comment.