js/crop_list.js
/* Updates the crop list and other views that change when this happens. */
Updates the crop list and other views that change when this happens.
Updates the crop list and other views that change when this happens .
updateCropSelection(d, that, thisLi) {
        that.cropVis.selected_crop = d;
        that.updateCropOnMap(that);
        d3.selectAll(".clickedCropLi").classed("clickedCropLi", false);
        d3.select(thisLi).attr("class", "clickedCropLi");
        let current_countries = [...that.cropVis.selected_countries];
        that.cropVis.selected_countries.clear();
        that.cropVis.barChart.deleteBarChart();
        that.cropVis.lineChart.deleteLineChart();
        that.cropVis.lineChart.alreadyExistingCountries.clear();
        that.cropVis.table.drawTable();
        for (let country of current_countries) {
            that.cropVis.selected_countries.add(country);
            that.cropVis.barChart.updateBarChart();
        }
        that.cropVis.lineChart.updateLineChart();
        that.cropVis.worldMap.updateAllMapTooltips(that);
    }
updateCropSelection ( d , that , thisLi ) { that . cropVis . selected_crop = d ; that . updateCropOnMap ( that ) ; d3 . selectAll ( ".clickedCropLi" ) . classed ( "clickedCropLi" , false ) ; d3 . select ( thisLi ) . attr ( "class" , "clickedCropLi" ) ; let current_countries = [ ... that . cropVis . selected_countries ] ; that . cropVis . selected_countries . clear ( ) ; that . cropVis . barChart . deleteBarChart ( ) ; that . cropVis . lineChart . deleteLineChart ( ) ; that . cropVis . lineChart . alreadyExistingCountries . clear ( ) ; that . cropVis . table . drawTable ( ) ; for ( let country of current_countries ) { that . cropVis . selected_countries . add ( country ) ; that . cropVis . barChart . updateBarChart ( ) ; } that . cropVis . lineChart . updateLineChart ( ) ; that . cropVis . worldMap . updateAllMapTooltips ( that ) ; }
Updates the crop list and other views that change when this happens.
Updates the crop list and other views that change when this happens .
// Unhighlight previously selected crop and highlight selected crop // that.cropVis.worldMap.clearHighlightedBoundaries();