DOM is documented here https://observablehq.com/documentation/misc/standard-library#dom
it is a convenient way to create a canvas, but you can substitute d3.create("canvas").attr("width", width).attr("height", height) if you prefer (or 2 * width, 2 * height if you want high-density images).