function draw_tubside(color = tile_color, stroke_color = "white") {
function draw_tile(x, y, w, h) {
svg.append('rect')
.attr('x', pixel_per_inch * x)
.attr('y', pixel_per_inch * y)
.attr('width', pixel_per_inch * w)
.attr('height', pixel_per_inch * h)
.attr('stroke', stroke_color)
.attr('fill', color);
}
const svg = d3.select(DOM.svg(side_canvas_width, canvas_height));
const defs = svg.append("defs");
const artboard = svg.append("g");
var x, y;
x = 0;
y = 0;
if (row_oriented) {
var row = 0;
while (y < height) {
var x = tile_width * offset * row;
while (x > 0) {
x -= tile_width;
}
while (x < side_width) {
draw_tile(x, y, tile_width, tile_height);
x += tile_width;
}
y += tile_height;
row += 1;
}
} else {
var col = 3;
while (x < side_width) {
y = tile_width * offset * col;
while (y > 0) {
y -= tile_width;
}
while (y < height) {
draw_tile(x, y, tile_height, tile_width);
y += tile_width;
}
x += tile_height;
col += 1;
}
}
svg.append('rect')
.attr('x', 0)
.attr('y', pixel_per_inch * (height - tub_height))
.attr('width', pixel_per_inch * side_width)
.attr('height', pixel_per_inch * tub_height)
.attr('stroke', 'black')
.attr('fill', 'white');
svg.append('rect')
.attr('x', 0)
.attr('y', pixel_per_inch * (height - tub_height))
.attr('width', pixel_per_inch * side_width)
.attr('height', pixel_per_inch)
.attr('stroke', 'black')
.attr('fill', '#977556');
return svg.node();
}