"use strict"; // Ice layer renderer - renders ice from data model to SVG function drawIce() { TIME && console.time("drawIce"); // Clear existing ice SVG ice.selectAll("*").remove(); let html = ""; // Draw glaciers pack.ice.glaciers.forEach((glacier, index) => { html += ``; }); // Draw icebergs pack.ice.icebergs.forEach((iceberg, index) => { html += ``; }); ice.html(html); TIME && console.timeEnd("drawIce"); } // Re-render ice layer from data model function redrawIce() { drawIce(); }