Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
fix(render): null as zero for spectrum mode (continue #205)
Browse files Browse the repository at this point in the history
  • Loading branch information
diafour committed Jul 19, 2021
1 parent c1a3b91 commit 0b5ce08
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,14 +578,12 @@ export class StatusmapRenderer {
if (this.panel.color.mode === 'opacity') {
return this.panel.color.cardColor;
} else if (this.panel.color.mode === 'spectrum') {
if(bucket.value !== null) {
return this.colorScale(bucket.value);
} else {
if(this.panel.nullPointMode == 'as zero') {
return this.colorScale(0);
}
}
} else if (this.panel.color.mode === 'discrete') {
if (!bucket.value && this.panel.nullPointMode === 'as zero') {
// bucket.value === 0 falls here, but it is fine.
return this.colorScale(0);
}
return this.colorScale(bucket.value);
} else if (this.panel.color.mode === 'discrete') {
if (this.panel.seriesFilterIndex !== null && this.panel.seriesFilterIndex !== -1) {
return this.ctrl.discreteExtraSeries.getBucketColorSingle(bucket.values[this.panel.seriesFilterIndex]);
} else {
Expand Down

0 comments on commit 0b5ce08

Please sign in to comment.