From d8416dd1a6296a4c257e62281e5d1ffc41e79b7d Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Tue, 14 Mar 2017 14:40:51 -0700 Subject: [PATCH 1/5] add gates tweet --- src/static/helpers/tweets.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static/helpers/tweets.js b/src/static/helpers/tweets.js index ab4dbbea5..8c29b484e 100644 --- a/src/static/helpers/tweets.js +++ b/src/static/helpers/tweets.js @@ -15,6 +15,7 @@ export const tweets = () => (

Nextstrain uses phylogenetics to track epidemics real-time and understand spread of disease #openscienceprize #BD2KOpenSci

— Lisa Federer (@lisafederer) December 1, 2016
+

Fascinating…Nextstrain uses genetic data from viruses to help scientists track the spread of disease outbreaks. https://t.co/6XtBvA5iiO

— Bill Gates (@BillGates) March 14, 2017

lovely real time analysis of Ebola virus evolution, great example of timely live data sharing http://t.co/ZZbhehvo44 pic.twitter.com/vqb3EbOeg1

— ben goldacre (@bengoldacre) August 7, 2015

Vote for best open data project: https://t.co/XjHfFWiWLl My favorite: https://t.co/Iana59QyqN from @richardneher @trvrb pic.twitter.com/XTj4bqdsVK

— Matthew Cotten (@mlcotten13) December 3, 2016

Benchmark in data visualisation to help understand, track and manage outbreaks is http://t.co/A1SWuZ5DbM #mHealthMeetup

— Ctrl Group (@ctrl_group) September 1, 2015
From d7a2ee68f0ba2ee97ca7e8aa2216539a3ef8486b Mon Sep 17 00:00:00 2001 From: Trevor Bedford Date: Tue, 14 Mar 2017 14:49:46 -0700 Subject: [PATCH 2/5] version bump to 1.1.2 for release --- package.json | 2 +- src/version.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5fd9f38e8..308978292 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nextstrain-auspice", - "version": "1.1.1", + "version": "1.1.2", "description": "Nextstrain auspice", "scripts": { "clean": "rimraf dist", diff --git a/src/version.js b/src/version.js index 3008bd7d6..3e252f2c6 100644 --- a/src/version.js +++ b/src/version.js @@ -1 +1 @@ -export const version = "1.1.1"; +export const version = "1.1.2"; From 495c5db3526734620811cc2d9c2aaea463fe383f Mon Sep 17 00:00:00 2001 From: Trevor Bedford Date: Wed, 15 Mar 2017 15:56:27 -0700 Subject: [PATCH 3/5] Map colors by genotype. Fixes #220. --- src/components/map/map.js | 4 +++- src/util/mapHelpersLatLong.js | 12 +++++++----- src/util/treeHelpers.js | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/map/map.js b/src/components/map/map.js index 3f26ba587..3b8427273 100644 --- a/src/components/map/map.js +++ b/src/components/map/map.js @@ -24,6 +24,7 @@ import getLatLongs from "../../util/mapHelpersLatLong"; colorBy: state.controls.colorBy, map: state.map, geoResolution: state.controls.geoResolution, + sequences: state.sequences }; }) class Map extends React.Component { @@ -225,7 +226,8 @@ class Map extends React.Component { this.state.map, this.props.colorBy, this.props.geoResolution, - this.props.colorScale.scale, + this.props.colorScale, + this.props.sequences ); } createMap() { diff --git a/src/util/mapHelpersLatLong.js b/src/util/mapHelpersLatLong.js index 34ced162b..9b8c875ee 100644 --- a/src/util/mapHelpersLatLong.js +++ b/src/util/mapHelpersLatLong.js @@ -1,6 +1,7 @@ import {averageColors} from "./colorHelpers"; +import {getTipColorAttribute} from "./treeHelpers"; -const getLatLongs = (nodes, metadata, map, colorBy, geoResolution, colorScale) => { +const getLatLongs = (nodes, metadata, map, colorBy, geoResolution, colorScale, sequences) => { const aggregatedLocations = {}; /* demes */ const aggregatedTransmissions = {}; /* edges, animation paths */ @@ -28,13 +29,14 @@ const getLatLongs = (nodes, metadata, map, colorBy, geoResolution, colorScale) = aggregate locations for demes */ nodes.forEach((n) => { + const tipColorAttribute = getTipColorAttribute(n, colorScale, sequences); if (!n.children) { // look up geo1 geo2 geo3 do lat longs differ if (aggregatedLocations[n.attr[geoResolution]]) { - aggregatedLocations[n.attr[geoResolution]].push(colorScale(n.attr[colorBy])); + aggregatedLocations[n.attr[geoResolution]].push(colorScale.scale(tipColorAttribute)); } else { // if we haven't added this pair, add it - aggregatedLocations[n.attr[geoResolution]] = [colorScale(n.attr[colorBy])]; + aggregatedLocations[n.attr[geoResolution]] = [colorScale.scale(tipColorAttribute)]; } } if (n.children) { @@ -43,10 +45,10 @@ const getLatLongs = (nodes, metadata, map, colorBy, geoResolution, colorScale) = if (n.attr[geoResolution] === child.attr[geoResolution]) { return; } // look up in transmissions dictionary if (aggregatedTransmissions[n.attr[geoResolution] + "/" + child.attr[geoResolution]]) { - aggregatedTransmissions[n.attr[geoResolution] + "/" + child.attr[geoResolution]].push(colorScale(n.attr[colorBy])); + aggregatedTransmissions[n.attr[geoResolution] + "/" + child.attr[geoResolution]].push(colorScale.scale(tipColorAttribute)); } else { // we don't have it, add it - aggregatedTransmissions[n.attr[geoResolution] + "/" + child.attr[geoResolution]] = [colorScale(n.attr[colorBy])]; + aggregatedTransmissions[n.attr[geoResolution] + "/" + child.attr[geoResolution]] = [colorScale.scale(tipColorAttribute)]; } }); } diff --git a/src/util/treeHelpers.js b/src/util/treeHelpers.js index 5bfc34064..9665b4efd 100644 --- a/src/util/treeHelpers.js +++ b/src/util/treeHelpers.js @@ -136,7 +136,7 @@ export const calcBranchThickness = function (nodes, rootIdx) { return nodes.map((d) => freqScale(d.tipCount / maxTipCount)); }; -const getTipColorAttribute = function (node, colorScale, sequences) { +export const getTipColorAttribute = function (node, colorScale, sequences) { if (colorScale.colorBy.slice(0, 3) === "gt-" && colorScale.genotype) { return getGenotype(colorScale.genotype[0][0], colorScale.genotype[0][1], From 696d646e8a2ac1097fb13b1378dd140b3c4dfb29 Mon Sep 17 00:00:00 2001 From: James Hadfield Date: Thu, 16 Mar 2017 14:33:49 -0700 Subject: [PATCH 4/5] tip modal click behavior. closes #252 --- src/components/tree/tipSelectedPanel.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/tree/tipSelectedPanel.js b/src/components/tree/tipSelectedPanel.js index 3be096faf..eeaf5d6b0 100644 --- a/src/components/tree/tipSelectedPanel.js +++ b/src/components/tree/tipSelectedPanel.js @@ -1,3 +1,4 @@ +/*eslint-env browser*/ import React from "react"; import {infoPanelStyles} from "../../globalStyles"; @@ -34,11 +35,17 @@ const TipSelectedPanel = ({tip, goAwayCallback}) => { } }; + const stopProp = (e) => { + if (!e) {e = window.event;} + e.cancelBubble = true; + if (e.stopPropagation) {e.stopPropagation();} + }; + const makePanel = () => { if (!tip) {return null;} return (
goAwayCallback(tip)}> -
+
stopProp(e)}>

{`${tip.n.strain}`}

From 4c26f154dc46cfe29527375f363d0ad13a108b5d Mon Sep 17 00:00:00 2001 From: Trevor Bedford Date: Thu, 16 Mar 2017 16:41:35 -0700 Subject: [PATCH 5/5] Fix bug with display of genotype colorby control Updating genotype colorby should change value and not placeholder --- src/components/controls/color-by.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/controls/color-by.js b/src/components/controls/color-by.js index a0d0abcec..f0ecf3bf2 100644 --- a/src/components/controls/color-by.js +++ b/src/components/controls/color-by.js @@ -57,15 +57,15 @@ class ColorBy extends React.Component { } genotypeInput() { - let placeholder = "Genome position"; + let value = ""; if (this.props.colorBy) { if (this.props.colorBy.slice(0, 2) === "gt") { - placeholder = this.props.colorBy.slice(3); + value = this.props.colorBy.slice(3); } } if (this.state.selected === "gt") { return ( - this.setGenotypeColorBy(e.target.value)} /> );