Commit b34bf9c4 authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

Update to arrow functions

parent 9bd35625
......@@ -101,7 +101,8 @@ const summarizeData = (allData, indicator) => {
.rollup( v => { return indicator == "costa" || indicator == "df" ? d3.mean(v, v => v.value) : d3.sum(v, v => v.value) })
.entries(data2)
// map "key" and "value" from d3.nest().rollup() to date and value
.map( group => { return {
.map( group => {
return {
date: new Date(group.key),
value: group.value
}
......@@ -112,7 +113,7 @@ const summarizeData = (allData, indicator) => {
return data;
}
function makeIndicatorGraph() {
const makeIndicatorGraph = () => {
let data = [],
width = 450,
......@@ -141,7 +142,7 @@ function makeIndicatorGraph() {
legendContainer = "legendZone",
updateData;
function chart(selection) {
const chart = selection => {
// get data ranges using values from displayName
minDate = d3.min(data[0].values, d => {
return d[displayName];
......@@ -152,7 +153,7 @@ function makeIndicatorGraph() {
});
maxDate = d3.timeDay.offset(maxDate, 15) // get next month to get correct x-axis alignment
selection.each(function () {
selection.each( () => {
// add graph svg to selected container on webpage
let areaSVG = selection
......@@ -303,10 +304,9 @@ function makeIndicatorGraph() {
});
$("#explainIndicatorModal").modal();
});
//});
// update chart
updateData = function () {
updateData = () => {
let time = map.timeDimension.getCurrentTime();
// update data ranges using values from displayName and lineVariables
......@@ -349,7 +349,7 @@ function makeIndicatorGraph() {
filteredData[i].values.push(v);
}
});
})
});
// update axes
let g = selection.select(".lineChart");
......@@ -516,10 +516,8 @@ function makeIndicatorGraph() {
.attr("cy", d => yLine(d.value)),
exit => exit.remove()
);
}
});
//});
}
chart.width = function(value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment