Skip to content

Commit

Permalink
Merge pull request #524 from theosanderson/fix-genotype
Browse files Browse the repository at this point in the history
Fix genotype colour issue
  • Loading branch information
theosanderson authored Sep 14, 2023
2 parents 2cab430 + 078ab2e commit db28d88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 1 addition & 3 deletions taxonium_component/src/components/SearchPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,7 @@ function SearchPanel({
{colorBy.colorByField === "genotype" && (

<div className="space-x-2">
<div className="text-xs">
If you are using custom JSONLs there is currently a bug with genotype colouring, please use <a className="text-blue-800" href="https://cov2tree-9k82lpuou-theosanderson.vercel.app/">this old version</a>.
</div>

<label className="space-x-2">
<span>Gene</span>
<Select
Expand Down
8 changes: 5 additions & 3 deletions taxonium_component/src/hooks/useLayers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const useLayers = ({
}
}, [data.base_data, getX]);


const detailed_scatter_data = useMemo(() => {
return detailed_data.nodes.filter(
(node) =>
Expand Down Expand Up @@ -157,10 +158,11 @@ const useLayers = ({
const scatter_layer_common_props = {
getPosition: (d) => [getX(d), d.y],
getFillColor: (d) => toRGB(getNodeColorField(d, detailed_data)),

getRadius: 3,
// radius in pixels
getRadius: (d) =>
getNodeColorField(d, detailed_data) === hoveredKey ? 4 : 3,
// we had to get rid of the below because it was messing up the genotype colours
// getRadius: (d) =>
// getNodeColorField(d, detailed_data) === hoveredKey ? 4 : 3,
getLineColor: [100, 100, 100],
opacity: 0.6,
stroked: data.data.nodes && data.data.nodes.length < 3000,
Expand Down
2 changes: 1 addition & 1 deletion taxonium_component/src/stories/Taxonium.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const JSONLgenetic = {
args: {
sourceData: {
status: "url_supplied",
filename: "https://cov2tree.nyc3.cdn.digitaloceanspaces.com/tfci-taxonium2.jsonl",
filename: "https://cov2tree.nyc3.cdn.digitaloceanspaces.com/tfci-taxonium.jsonl.gz",
filetype: "jsonl",
},
},
Expand Down

1 comment on commit db28d88

@vercel
Copy link

@vercel vercel bot commented on db28d88 Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.