function renderPath(container, path, opts={}) {
container.append('path')
.attr('fill', opts.fill || 'none')
.attr('stroke', opts.stroke || '#000')
.attr('stroke-width', opts.strokeWidth || 2)
.attr('stroke-dasharray', opts.strokeDasharray || '')
.attr('d', (
Array.isArray(path[0][0])
? path.map(subpath => d3.line()(subpath))
: d3.line()(path)
) + (opts.close ? 'z' : ''))
}