Skip to content

Commit

Permalink
fix(web): fix path to json
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov committed Jan 18, 2021
1 parent b3dc6cc commit 7c882b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion scripts/convert_to_web_app_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import json
import os
from shutil import copyfile

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -141,7 +142,7 @@ def update_per_cluster_distribution(cluster_data, country, distribution):

frequency = 0
if total_sequences != 0:
frequency = cluster_sequences / total_sequences
frequency = cluster_sequences / total_sequences

if len(distribution) == 0:
distribution.append({'week': week, 'frequencies': {country: frequency}, 'interp': {country: interp},
Expand Down Expand Up @@ -243,3 +244,6 @@ def add_cluster_properties(cluster):

with open(os.path.join(output_path, "countryStyles.json"), "w") as fh:
json.dump(country_styles, fh, indent=2, sort_keys=True)

copyfile(os.path.join(cluster_tables_path, 'perVariant_countries_toPlot.json'),
os.path.join(output_path, "countriesToPlot.json"))
1 change: 1 addition & 0 deletions web/data/countriesToPlot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Spain": "True", "Netherlands": "True", "United Kingdom": "True", "Belgium": "True", "Switzerland": "True", "Ireland": "True", "Norway": "True", "France": "True", "Denmark": "True", "Germany": "True", "Italy": "True", "Sweden": "True", "Australia": "True", "Latvia": "False", "Lithuania": "False", "Luxembourg": "True", "New Zealand": "False", "Portugal": "True", "Finland": "False", "Hungary": "True", "USA": "True", "South Africa": "True", "Israel": "False", "Turkey": "False", "Czech Republic": "True", "Brazil": "True"}
3 changes: 1 addition & 2 deletions web/src/io/getCountryColor.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { get } from 'lodash'

import countriesToPlot from 'src/../data/countriesToPlot.json'
import countryStyles from 'src/../data/countryStyles.json'

import countriesToPlot from '../../../cluster_tables/perVariant_countries_toPlot.json'

export function getCountryStyle(country: string) {
return get<Record<string, { c: string; ls: string }>, string>(countryStyles, country) ?? { c: '#555555', ls: '-' }
}
Expand Down

0 comments on commit 7c882b3

Please sign in to comment.