lines =
({wide = 16, tall = 9} = {}) =>
(orientation = "tall") =>
(divisions = 2) =>
{
const aspect = ({wide, tall});
const height = width * tall / wide;
const lineCount = aspect[orientation] * divisions + 1;
const stepSize = ({wide: width, tall: height}[orientation]) / divisions / aspect[orientation];
const line = ((stepSize) => ({
tall: (_, i) => ({y1: i * stepSize, y2: i * stepSize, x1: 0, x2: width}),
wide: (_, i) => ({x1: i * stepSize, x2: i * stepSize, y1: 0, y2: height}),
})[orientation])(stepSize);
return d3.range(lineCount).map(line);
}