Skip to content

Commit

Permalink
Merge pull request #1802 from nextstrain/measurements-bugs
Browse files Browse the repository at this point in the history
Fix measurements bugs
  • Loading branch information
joverlee521 authored Jul 30, 2024
2 parents 835fbb2 + 172c556 commit 6955728
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

* Fix bug where app crashed if measurements JSON did not define thresholds ([#1802](https://github.com/nextstrain/auspice/pull/1802))
* Fix bug where measurements display did not honor the default `measurements_display` ([#1802](https://github.com/nextstrain/auspice/pull/1802))

## version 2.56.0 - 2024/07/01


Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If you look at the :doc:`release notes <../releases/changelog>` you can see the
Install Auspice as a developer
==============================

See `DEV_DOCS.md <https://github.com/nextstrain/auspice/blob/-/DEV_DOCS.md#developer-installation>__`.
See `DEV_DOCS.md <https://github.com/nextstrain/auspice/blob/-/DEV_DOCS.md#developer-installation>`__.

Testing if it worked
====================
Expand Down
6 changes: 3 additions & 3 deletions src/actions/measurements.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ const getCollectionDisplayControls = (controls, collection) => {
if (collection["display_defaults"]) {
const {
group_by,
measurement_display,
measurements_display,
show_overall_mean,
show_threshold
} = collection["display_defaults"];

if (group_by) {
newControls.measurementsGroupBy = group_by;
}
if (measurement_display) {
newControls.measurementsDisplay = measurement_display;
if (measurements_display) {
newControls.measurementsDisplay = measurements_display;
}
if (typeof show_overall_mean === "boolean") {
newControls.measurementsShowOverallMean = show_overall_mean;
Expand Down
3 changes: 2 additions & 1 deletion src/components/measurements/measurementsD3.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ export const drawMeasurementsSVG = (ref, xAxisRef, svgData) => {
drawStickyXAxis(xAxisRef, containerHeight, svgHeight, xScale, x_axis_label);

// Add threshold(s) if provided
if (thresholds !== null) {
if (Array.isArray(thresholds)) {
for (const threshold of thresholds) {
if (typeof threshold !== "number") continue;
const thresholdXValue = xScale(threshold);
svg.append("line")
.attr("class", classes.threshold)
Expand Down

0 comments on commit 6955728

Please sign in to comment.