repos

Switch datamaps import from all.min to usa.min

08bb4b95 by Isaac Bythewood · 4 months ago

Switch datamaps import from all.min to usa.min

datamaps.all.min.js is 7.3 MB and includes topojson for every country
on earth. Webpack has to parse and optimise the entire file, which is
what was exhausting the Node.js heap during the Docker build. The map
only uses scope: "usa", so datamaps.usa.min.js (53 KB) is sufficient
and reduces the module size by 138x.
modified properties/static_src/scripts/property_map.js
@@ -1,5 +1,5 @@import { scaleLinear } from "d3-scale";import Datamap from "datamaps/dist/datamaps.all.min";import Datamap from "datamaps/dist/datamaps.usa.min";document.addEventListener("DOMContentLoaded", function () {  const datamapEl = document.getElementById("datamap");