drawScale = {
let scaleSettings = { col1, col2, minCol, nSteps, blendMode }
let bvScale = new BivariateColorscale(scaleSettings);
let nScaleSteps = bvScale.getNumSteps();
console.log(nScaleSteps);
let w = 200;
let h = 200;
let svg = d3.select('#scale')
.html('')
.append('svg')
.attr('width', w)
.attr('height', h);
let rectMargin = 2;
let rectHeight = (h / nScaleSteps) - rectMargin;
let rectWidth = (w / nScaleSteps) - rectMargin;
for (let i = 0; i < nScaleSteps; i++) {
for (let j = 0; j < nScaleSteps; j++) {
svg.append('rect')
.attr('x', i * (rectWidth + rectMargin))
.attr('y', j * (rectHeight + rectMargin))
.attr('width', rectWidth)
.attr('height', rectHeight)
.attr('fill', bvScale.getColorAtIdx(i,j));
}
}
}