js/crop_list.js
/* Draws the initial crop list. */
Draws the initial crop list.
Draws the initial crop list .
drawCropList() {
        let that = this;
        let boundCrops = d3.select("#crop_list_ul")
            .selectAll("li")
            .data([...that.data.crops]);
        boundCrops.enter()
            .append("li")
            .attr("id", function (d) {
                return d.replace(/ /g, "_").replace(/,/g, "");
            })
            .on("click", function (d) {
                let thisLi = this;
                that.updateCropSelection(d, that, thisLi);
            })
            .text(function (d) {
                return d;
            });
    }
drawCropList ( ) { let that = this ; let boundCrops = d3 . select ( "#crop_list_ul" ) . selectAll ( "li" ) . data ( [ ... that . data . crops ] ) ; boundCrops . enter ( ) . append ( "li" ) . attr ( "id" , function ( d ) { return d . replace ( / / g , "_" ) . replace ( / , / g , "" ) ; } ) . on ( "click" , function ( d ) { let thisLi = this ; that . updateCropSelection ( d , that , thisLi ) ; } ) . text ( function ( d ) { return d ; } ) ; }
Draws the initial crop list.
Draws the initial crop list .