Skip to content

Commit

Permalink
Update SearchPanel.jsx (#587)
Browse files Browse the repository at this point in the history
* Update SearchPanel.jsx

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* up

* u

* u

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
theosanderson and pre-commit-ci[bot] committed May 3, 2024
1 parent bdb13be commit 783002a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 28 deletions.
65 changes: 42 additions & 23 deletions taxonium_component/src/components/SearchPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,31 +246,50 @@ function SearchPanel({
</button>
<div className="space-y-2 py-3">
{config.num_tips && (
<p className="text-gray-500 text-sm">
{overlayContent ? (
<>
<span title={config.date_created ? config.date_created : ""}>
Displaying
</span>{" "}
<button
className="underline"
onClick={() => {
setAboutEnabled(true);
}}
>
{formatNumber(config.num_tips)}{" "}
<>
<p className="text-gray-500 text-sm">
{overlayContent ? (
<>
<span title={config.date_created ? config.date_created : ""}>
Displaying
</span>{" "}
<button
className="underline"
onClick={() => {
setAboutEnabled(true);
}}
>
{formatNumber(config.num_tips)}{" "}
{config.tipPluralNoun ? config.tipPluralNoun : "sequences"}
</button>{" "}
{config.source && ` from ${config.source}`}
</>
) : (
<>
Displaying {formatNumber(config.num_tips)}{" "}
{config.tipPluralNoun ? config.tipPluralNoun : "sequences"}
</button>{" "}
{config.source && ` from ${config.source}`}
</>
) : (
<>
Displaying {formatNumber(config.num_tips)}{" "}
{config.tipPluralNoun ? config.tipPluralNoun : "sequences"}
{config.source && ` from ${config.source}`}
</>
{config.source && ` from ${config.source}`}
</>
)}
</p>
{config.enabled_by_gisaid && (
<span>
Enabled by data from{" "}
<a
rel="noopener noreferrer"
href="https://www.gisaid.org"
target="_blank"
>
<img
src="https://www.gisaid.org/fileadmin/gisaid/img/schild.png"
alt="gisaid-logo"
width="65"
/>
</a>
.
</span>
)}
</p>
</>
)}
{config.x_accessors && config.x_accessors.length > 1 && (
<label className="space-x-2 text-sm block">
Expand Down
10 changes: 5 additions & 5 deletions taxonium_component/src/utils/processNextstrain.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,14 @@ async function json_to_tree(json) {
json.meta.data_provenance.map((source) => source.name).join(" & ");
}

if (config.source.includes("GISAID")){
config.enabled_by_gisaid = true
if (config.source.includes("GISAID")) {
config.enabled_by_gisaid = true;
}

config.overlay = `<p>This is a tree extracted from a <a href='//nextstrain.org'>Nextstrain</a> JSON file, being visualised in Taxonium.</p>.`;
if(json.meta.description){
config.overlay = config.overlay+"<p>"+json.meta.description+"</p>";
}
if (json.meta.description) {
config.overlay = config.overlay + "<p>" + json.meta.description + "</p>";
}

if (json.meta && json.meta.updated) {
config.source = config.source + " in a tree built on " + json.meta.updated;
Expand Down

0 comments on commit 783002a

Please sign in to comment.