Commit 496b6e8d authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

fixed a critical bug

parent eea5b491
......@@ -43,7 +43,7 @@
for (let i = 0; i < height; i += 1) {
rows.push(`row - ${i}`);
for (let j = 0; j < width; j += 1) {
if (undefinedValues && Math.random() > 0.8) {
if (undefinedValues && Math.random() > 0.9) {
values.push(undefined);
} else {
values.push(Math.random() * (maxValue - minValue + 1) + minValue);
......
......@@ -43,7 +43,7 @@ export default class extends Chart {
this.data = [];
rows.forEach((row, i) => {
cols.forEach((col, j) => {
const value = values[i * rows.length + j];
const value = values[i * cols.length + j];
this.data.push({ value, row, col });
});
});
......@@ -117,10 +117,7 @@ export default class extends Chart {
.attr('height', this.yScale.bandwidth())
.attr('x', d => this.xScale(d.col))
.attr('y', d => this.yScale(d.row))
.attr('fillStyle', (d) => {
if (typeof d.value === 'undefined') return '#000';
return colorScale(d.value);
});
.attr('fillStyle', d => colorScale(d.value));
rect
.transition()
......@@ -129,10 +126,7 @@ export default class extends Chart {
.attr('height', this.yScale.bandwidth())
.attr('x', d => this.xScale(d.col))
.attr('y', d => this.yScale(d.row))
.attr('fillStyle', (d) => {
if (typeof d.value === 'undefined') return '#000';
return colorScale(d.value);
});
.attr('fillStyle', d => colorScale(d.value));
rect.exit()
.remove();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment