Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SearchPanel.jsx #587

Merged
merged 6 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading