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

minor bug fixes and improvments #247

Merged
merged 7 commits into from
Mar 1, 2017
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
24 changes: 12 additions & 12 deletions fetch_data.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

curl http://nextstrain.org/data/ebola_tree.json --compressed -o data/ebola_tree.json
curl http://nextstrain.org/data/ebola_sequences.json --compressed -o data/ebola_sequences.json
curl http://nextstrain.org/data/ebola_meta.json --compressed -o data/ebola_meta.json
curl http://nextstrain.org/data/ebola_entropy.json --compressed -o data/ebola_entropy.json
curl http://nextstrain.org/data/zika_tree.json --compressed -o data/zika_tree.json
curl http://nextstrain.org/data/zika_sequences.json --compressed -o data/zika_sequences.json
curl http://nextstrain.org/data/zika_meta.json --compressed -o data/zika_meta.json
curl http://nextstrain.org/data/zika_entropy.json --compressed -o data/zika_entropy.json
curl http://nextstrain.org/data/flu_h3n2_3y_tree.json --compressed -o data/flu_h3n2_3y_tree.json
curl http://nextstrain.org/data/flu_h3n2_3y_sequences.json --compressed -o data/flu_h3n2_3y_sequences.json
curl http://nextstrain.org/data/flu_h3n2_3y_meta.json --compressed -o data/flu_h3n2_3y_meta.json
curl http://nextstrain.org/data/flu_h3n2_3y_entropy.json --compressed -o data/flu_h3n2_3y_entropy.json
curl http://data.nextstrain.org/ebola_tree.json --compressed -o data/ebola_tree.json
curl http://data.nextstrain.org/ebola_sequences.json --compressed -o data/ebola_sequences.json
curl http://data.nextstrain.org/ebola_meta.json --compressed -o data/ebola_meta.json
curl http://data.nextstrain.org/ebola_entropy.json --compressed -o data/ebola_entropy.json
curl http://data.nextstrain.org/zika_tree.json --compressed -o data/zika_tree.json
curl http://data.nextstrain.org/zika_sequences.json --compressed -o data/zika_sequences.json
curl http://data.nextstrain.org/zika_meta.json --compressed -o data/zika_meta.json
curl http://data.nextstrain.org/zika_entropy.json --compressed -o data/zika_entropy.json
curl http://data.nextstrain.org/flu_h3n2_3y_tree.json --compressed -o data/flu_h3n2_3y_tree.json
curl http://data.nextstrain.org/flu_h3n2_3y_sequences.json --compressed -o data/flu_h3n2_3y_sequences.json
curl http://data.nextstrain.org/flu_h3n2_3y_meta.json --compressed -o data/flu_h3n2_3y_meta.json
curl http://data.nextstrain.org/flu_h3n2_3y_entropy.json --compressed -o data/flu_h3n2_3y_entropy.json
3 changes: 2 additions & 1 deletion src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React from "react";
import { connect } from "react-redux";
import { loadJSONs } from "../actions/loadData";
import { NEW_DATASET } from "../actions/types";
import { RESET_CONTROLS, NEW_DATASET } from "../actions/types";
import { restoreStateFromURL, turnURLtoDataPath } from "../util/urlHelpers"
import "whatwg-fetch"; // setup polyfill
import Radium from "radium";
Expand Down Expand Up @@ -73,6 +73,7 @@ class App extends React.Component {
new bits of state via the URL query and then URL pathname
*/
// console.log("CDM")
this.props.dispatch({type: RESET_CONTROLS});
restoreStateFromURL(this.context.router, this.props.dispatch);
const data_path = turnURLtoDataPath(this.context.router);
if (data_path) {
Expand Down
5 changes: 4 additions & 1 deletion src/components/framework/title-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class TitleBar extends React.Component {
return {
main: {
maxWidth: 960,
margin: "auto",
marginTop: "auto",
marginRight: "auto",
marginBottom: "auto",
marginLeft: "auto",
height: titleBarHeight,
justifyContent: "space-between",
alignItems: "center",
Expand Down
8 changes: 3 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import "./css/static.css";
import { outboundLinkWithAnalytics } from "./util/googleAnalytics";

/* google analytics */
ReactGA.initialize(process.env.NODE_ENV === "production" ? "UA-92687617-1" : "unknown");
ReactGA.initialize(process.env.NODE_ENV === "production" ? "UA-92687617-1" : "UA-92687617-2");

const store = configureStore();

Expand All @@ -36,10 +36,8 @@ class Root extends React.Component {
<Route path="/about" component={About}/>
<Route path="/zika" component={App}/>
<Route path="/ebola" component={App}/>
<Route exact path="/flu*" render={() =>
outboundLinkWithAnalytics("http://nextflu.org/")
}
/>
{/* note that this app never triggers /flu, but a user might */}
<Route path="/flu*" render={() => {window.location.assign("http://nextflu.org/"); return null;}}/>
<Route path="*" component={Splash}/>
</Switch>
</div>
Expand Down
27 changes: 3 additions & 24 deletions src/static/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,10 @@ import React from "react";
// import { connect } from "react-redux";
import Flex from "../components/framework/flex";
import TitleBar from "../components/framework/title-bar";
import { analyticsNewPage } from "../util/googleAnalytics";
import { analyticsNewPage, triggerOutboundEvent } from "../util/googleAnalytics";
import { version } from "../version";
import { Link } from "react-router-dom";

/* helper / generating functions */
const generateLogos = [
<a key={1} href="http://www.fredhutch.org/" target="_blank">
<img width="75" src={require("../images/fred-hutch-logo-small.png")}/>
</a>,
<a key={2} href="http://www.eb.tuebingen.mpg.de/" target="_blank">
<img width="65" src={require("../images/max-planck-logo-small.png")}/>
</a>,
<a key={3} href="https://www.nih.gov/" target="_blank">
<img width="52" src={require("../images/nih-logo-small.png")}/>
</a>,
<a key={4} href="https://erc.europa.eu/" target="_blank">
<img width="60" src={require("../images/erc-logo-small.png")}/>
</a>,
<a key={5} href="https://www.openscienceprize.org/" target="_blank">
<img width="82" src={require("../images/osp-logo-small.png")}/>
</a>,
<a key={6} href="http://biozentrum.org/" target="_blank">
<img width="85" src={require("../images/bz_logo.png")}/>
</a>
];
import {generateLogos} from "./helpers/logos";

const About = () => {
analyticsNewPage();
Expand Down Expand Up @@ -71,7 +50,7 @@ const About = () => {

The ongoing (2015-) epidemic of zika fever in the Americas is seen here in the context of over 400 genomes including isolates from Asia and the Pacific Islands. Multiple trans-Pacific and trans-Atlantic transmission events are easily seen, as well as the complex transmission routes between Brazil, Central America and the USA.

<p/><Link to="/flu">Influenza Virus (via nextflu.org)</Link><p/>
<p/><a href="http://nextflu.org/" target="_blank" onClick={() => triggerOutboundEvent("http://nextflu.org")}>Influenza Virus (via nextflu.org)</a><p/>

H1N1 and H3N2 strains of Influenza virus are shown together with antigen evolution, epitope mutations and clade frequency changes over the past 2-12 years. These data and features are being moved over to this site at the moment.

Expand Down
22 changes: 22 additions & 0 deletions src/static/helpers/logos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";

export const generateLogos = [
<a key={1} href="http://www.fredhutch.org/" target="_blank">
<img width="75" src={require("../../images/fred-hutch-logo-small.png")}/>
</a>,
<a key={2} href="http://www.eb.tuebingen.mpg.de/" target="_blank">
<img width="65" src={require("../../images/max-planck-logo-small.png")}/>
</a>,
<a key={3} href="https://www.nih.gov/" target="_blank">
<img width="52" src={require("../../images/nih-logo-small.png")}/>
</a>,
<a key={4} href="https://erc.europa.eu/" target="_blank">
<img width="60" src={require("../../images/erc-logo-small.png")}/>
</a>,
<a key={5} href="https://www.openscienceprize.org/" target="_blank">
<img width="82" src={require("../../images/osp-logo-small.png")}/>
</a>,
<a key={6} href="http://biozentrum.org/" target="_blank">
<img width="85" src={require("../../images/bz_logo.png")}/>
</a>
];
Loading