function makeSimplexContours(config) {
if (!config) config = {};
const svg = d3
.create("svg")
.attr("width", width)
.attr("height", width / 2)
.style("background-color", () => {
if (config.grayscale) return 'black';
});
const color = d3
.scaleSequential(d3.interpolateOrRd)
.domain([1, contours.length]);
svg
.append("g")
.selectAll("path")
.data(scaleContour(contours, pixelScale))
.enter()
.append("path")
.style("transition", "all 100ms ease-in")
.attr("d", d3.geoPath())
.style("fill", (d, i) => {
if (config.grayscale) {
return 'black';
} else {
return color(i);
}
})
.style("stroke", 'white');
return svg.node();
}