Skip to content
Open
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
3 changes: 2 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ a:visited { color: rgb(49, 54, 149) } /* visited links */
.season-control:hover {color: red; cursor: pointer;}

#data {
padding-top: 20px;
}

#intro {
Expand All @@ -44,6 +43,8 @@ a:visited { color: rgb(49, 54, 149) } /* visited links */
.chart {
float:left;
max-width: 100%;
background-color: #666;
padding-top: 20px;
}

.active {
Expand Down
4 changes: 1 addition & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@
We welcome your contributions to make this a better tool.
Here are some possible improvements:
<ul>
<li>Add sticky tooltip with total precip for selected years.</li>
<li>Distinguish between mean and median.</li>
<li>Switch between locations, or use multiple graphs for different locations.</li>
<li>Add a control for the MEI month.</li>
<li>Add support for arbitrary date ranges.</li>
Expand Down Expand Up @@ -121,4 +119,4 @@

</body>

</html>
</html>
14 changes: 8 additions & 6 deletions js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function precipChart() {

// construct the color scale (the code, not the legend)
//var colors =['#2D8098', '#2A6778', '#274E5A', '#24363A', '#212121', '#4D2426', '#7F262E', '#B22833', '#E42A38'].reverse()
var colors = colorbrewer.RdYlBu[10]
var colors = colorbrewer.RdYlGn[10]
// var colorDomain = [-2.5,2.5];
var colorDomain = [-2.25,2.25];
// var colorDomain = [-2,2];
Expand Down Expand Up @@ -430,7 +430,7 @@ function precipChart() {
})
.text(function(d){return d.season})
.attr("class", "season-control")
.attr("fill", function(d) { return (typeof(d.dflt) === "undefined") ? "gray" : "black"} )
.attr("fill", function(d) { return (typeof(d.dflt) === "undefined") ? "white" : "black"} )
.on("click", function(d) { d.func() } )
return gEnter;
}
Expand Down Expand Up @@ -484,8 +484,10 @@ function precipChart() {
}

function getENSOcolor(d) {
if (d.key == 'mean' || d.key == 'median') {
if (d.key == 'mean') {
return 'black';
} else if (d.key == 'median') {
return 'white';
} else {
return colorScale(getENSOvalue(d));
}
Expand Down Expand Up @@ -602,7 +604,7 @@ function precipChart() {
.attr("fill", "black")
seasonsControls
.filter(function(d) { return d.season.toLowerCase().indexOf("cool") == -1 })
.attr("fill", "gray")
.attr("fill", "white")

return chart.redraw();
}
Expand All @@ -619,7 +621,7 @@ function precipChart() {
.attr("fill", "black")
seasonsControls
.filter(function(d) { return d.season.toLowerCase().indexOf("monsoon") == -1 })
.attr("fill", "gray")
.attr("fill", "white")

return chart.redraw();
}
Expand All @@ -636,7 +638,7 @@ function precipChart() {
.attr("fill", "black")
seasonsControls
.filter(function(d) { return d.season.toLowerCase().indexOf("full") == -1 })
.attr("fill", "gray")
.attr("fill", "white")

return chart.redraw();
}
Expand Down