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

Isolines and data files separated by time resolution #62

Merged
merged 31 commits into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a3d7e99
Very rough first cut at isoline feature.
corviday Jun 27, 2017
6da0c17
Data with same units graphed on single axis.
corviday Jun 28, 2017
8a5980b
User selection of map parameters, opacity bugfix.
corviday Jun 29, 2017
bee7edd
More clarity, less repetition.
corviday Jun 30, 2017
0b99954
Fix name of psu-magma palette
corviday Jun 30, 2017
840a779
Map legends and autoscaling
corviday Jun 30, 2017
97797a8
Register multiple map layers to autoscale control
corviday Jul 4, 2017
5027176
Colourbar positions, fix autoscale
corviday Jul 5, 2017
1fa4f25
Adjust MotiDataController to split chronology data
corviday Jul 19, 2017
f4642e4
Fix an error made while rebasing.
corviday Jul 19, 2017
d191d51
First cut at generating multiple timeseries charts
corviday Jul 21, 2017
0017b3e
Support for split climatology files
corviday Jul 27, 2017
5066de1
rewrite projected climate graph pipeline
corviday Jul 31, 2017
9b67875
Adjust tests to support API-provided period info
corviday Jul 31, 2017
989ad67
reorder functions, cleanup, add tests
corviday Aug 8, 2017
333adc0
Workaround til the multimeta API returns period
corviday Aug 8, 2017
951c1ed
Make cleanup changes suggested by JSHint
corviday Aug 9, 2017
150e081
Export split climatologies, multiple variables
corviday Aug 10, 2017
ecdb47d
update tests to matched changed header order
corviday Aug 10, 2017
24b9686
Remove extra whitespace and debug outputs
corviday Aug 10, 2017
0f9a8ce
Add DualMap's functionality to CanadaMap.
corviday Aug 15, 2017
f701e30
Merge MapController/DualMapController, fix dataset
corviday Aug 17, 2017
7bc83fa
cleanup from removal of DualMapController
corviday Aug 17, 2017
8d31ea9
MapController dropdown displays selected dataset
corviday Aug 17, 2017
f630cce
DRY up data controllers, better comments
corviday Aug 18, 2017
768397e
Clarify comments and function names
corviday Aug 21, 2017
82103a9
Make update checks attribute order independent
corviday Aug 21, 2017
c25f139
Temporarily remove logscale UI elements
corviday Aug 21, 2017
cfdabd6
Less random initial timestamp, improve clarity
corviday Aug 24, 2017
772ef6c
Fix typo
corviday Sep 8, 2017
3629849
rename scalar to raster & contour to isoline
corviday Sep 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/AppController/AppController.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/***************************************************************
* AppController.js
*
* This controller represent climate explorer's main portal. It
* has dropdowns to allow a user to select a model, emission
* scenario, and variable. It loads and filters metadata for
* the selected datasets and passes them to its children:
* - MapController (displays a variable as a colour-shaded map)
* - DataController (displays graphs and a statistical table).
***************************************************************/

import React from 'react';
import { Grid, Row, Col } from 'react-bootstrap';

Expand Down
33 changes: 27 additions & 6 deletions src/components/AppMixin/AppMixin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
/****************************************************************************
* AppMixin.js - shared functionality for top-level App Controller Components
*
* This class contains data retrieval and parsing methods used to initialize
* Climate Explorer. It is mixed in to all three of the top level controllers,
* each of which represents a portal accessible from a separate URL:
*
* - MotiController (simplified interface and UI)
* - AppController (displays lots of detail, the default)
* - DualController (displays two variables at once for comparison)
*
****************************************************************************/

import _ from 'underscore';
import urljoin from 'url-join';
import axios from 'axios';
import moment from 'moment';

var AppMixin = {
getInitialState: function () {
Expand All @@ -12,7 +26,7 @@ var AppMixin = {
componentDidMount: function () {
var models = [];
var vars;

axios({
baseURL: urljoin(CE_BACKEND_URL, 'multimeta'),
params: { ensemble_name: CE_ENSEMBLE_NAME },
Expand All @@ -21,14 +35,21 @@ var AppMixin = {
vars = Object.keys(response.data[key].variables);

for (var v in vars) {
var start = response.data[key].start_date;
start = moment(start, moment.ISO_8601).utc().format('YYYY');
var end = response.data[key].end_date;
end = moment(end, moment.ISO_8601).utc().format('YYYY');

models.push(_.extend({
unique_id: key,
variable_id: vars[v],
start_date: start,
end_date: end,
variable_name: response.data[key].variables[vars[v]],
}, _.omit(response.data[key], 'variables')));
}, _.omit(response.data[key], 'variables', 'start_date', 'end_date')));
}
}

this.setState({
meta: models,
model_id: models[0].model_id,
Expand All @@ -42,9 +63,9 @@ var AppMixin = {
this.setState({ area: wkt });
},

getfilteredMeta: function () {
getfilteredMeta: function (variableFilter = this.state.variable_id) {
var l = this.state.meta.filter(function (x) {
return x.model_id === this.state.model_id && x.experiment === this.state.experiment && x.variable_id === this.state.variable_id;
return x.model_id === this.state.model_id && x.experiment === this.state.experiment && x.variable_id === variableFilter;
}, this);
l.sort(function (a, b) {return a.unique_id > b.unique_id ? 1 : -1;});
return l;
Expand All @@ -68,7 +89,7 @@ var AppMixin = {

getMetadataItems: function (name) {
return _.unique(this.state.meta.map(function (el) {return el[name];}));
},
},
};

export default AppMixin;