-
Notifications
You must be signed in to change notification settings - Fork 6
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
Several QOL changes for plots #185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codecov-ai-reviewer review
if "xaxis" in options: | ||
fig.update_layout(xaxis=options["xaxis"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation directly updates the layout of the figure if 'xaxis' is present in the options. This can be made more robust by using the update
method of the dictionary to avoid potential key errors and to make the code more readable.
if "xaxis" in options: | |
fig.update_layout(xaxis=options["xaxis"]) | |
fig.update_layout({ | |
xaxis: options.get("xaxis", {}) | |
}) |
@@ -33,15 +32,13 @@ def create_samples_received_map(): | |||
"received_samples_map" | |||
) | |||
|
|||
ldata = pd.DataFrame(json_data) | |||
|
|||
fig = px.choropleth_mapbox( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the DataFrame conversion for json_data
might cause issues if json_data
is not in the expected format. Ensure that json_data
is a dictionary with the required keys.
@@ -104,7 +104,7 @@ def create_needle_plot_graph_mutation_by_lineage( | |||
mutationData=mdata, | |||
rangeSlider=True, | |||
xlabel="Genome Position", | |||
ylabel="Population Allele Frequency samples", | |||
ylabel="Population Allele Frequency", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The label 'Population Allele Frequency samples' seems to be a typo. The corrected label 'Population Allele Frequency' is more appropriate.
This PR includes several changes:
Speed up intranet/received_samples page by including samples_map in graphicJsons and improving the queries for received_samples_with_date(), which also has been changed to show created_at dates instead of sequencing_dates (Closes received samples per date graph is limited to 2021 #175 )
Included host-info data in graphic json to speed up the loading time
Included the number of samples represented for each lineage in Lineage-Variants dashboard plot