mirror of
https://github.com/timberjoegithub/grafana-statusmap.git
synced 2026-07-21 23:42:03 +00:00
Fix display of multivalues buckets as an empty cell
This commit is contained in:
Vendored
+21
-9
@@ -101,16 +101,28 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
value: function getBucketColor(values) {
|
value: function getBucketColor(values) {
|
||||||
var thresholds = this.panel.color.thresholds;
|
var thresholds = this.panel.color.thresholds;
|
||||||
|
|
||||||
|
if (!values || values.length == 0) {
|
||||||
|
// treat as null value
|
||||||
|
return this.getMatchedThreshold(null).color;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (values.length == 1) {
|
||||||
|
return this.getMatchedThreshold(values[0]).color;
|
||||||
|
}
|
||||||
|
|
||||||
|
var isAllValuesNulls = true;
|
||||||
|
for (var j = 0; j < values.length; j++) {
|
||||||
|
if (values[j] != null) {
|
||||||
|
isAllValuesNulls = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isAllValuesNulls) {
|
||||||
|
return this.getMatchedThreshold(null).color;
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < thresholds.length; i++) {
|
for (var i = 0; i < thresholds.length; i++) {
|
||||||
for (var j = 0; j < values.length; j++) {
|
for (var _j = 0; _j < values.length; _j++) {
|
||||||
if (values[j] == null) {
|
if (values[_j] == thresholds[i].value) {
|
||||||
if (this.panel.nullPointMode == 'as zero') {
|
|
||||||
return this.getMatchedThreshold(0).color;
|
|
||||||
} else {
|
|
||||||
return 'rgba(0,0,0,0)';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (values[j] == thresholds[i].value) {
|
|
||||||
return this.getDiscreteColor(i);
|
return this.getDiscreteColor(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -61,15 +61,27 @@ export class ColorModeDiscrete {
|
|||||||
getBucketColor(values) {
|
getBucketColor(values) {
|
||||||
let thresholds = this.panel.color.thresholds;
|
let thresholds = this.panel.color.thresholds;
|
||||||
|
|
||||||
|
if (!values || values.length == 0) {
|
||||||
|
// treat as null value
|
||||||
|
return this.getMatchedThreshold(null).color;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (values.length == 1) {
|
||||||
|
return this.getMatchedThreshold(values[0]).color;
|
||||||
|
}
|
||||||
|
|
||||||
|
let isAllValuesNulls = true;
|
||||||
|
for (let j = 0; j < values.length; j++) {
|
||||||
|
if (values[j] != null) {
|
||||||
|
isAllValuesNulls = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isAllValuesNulls) {
|
||||||
|
return this.getMatchedThreshold(null).color;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < thresholds.length; i++) {
|
for (let i = 0; i < thresholds.length; i++) {
|
||||||
for (let j = 0; j < values.length; j++) {
|
for (let j = 0; j < values.length; j++) {
|
||||||
if (values[j] == null) {
|
|
||||||
if (this.panel.nullPointMode == 'as zero') {
|
|
||||||
return this.getMatchedThreshold(0).color;
|
|
||||||
} else {
|
|
||||||
return 'rgba(0,0,0,0)';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (values[j] == thresholds[i].value) {
|
if (values[j] == thresholds[i].value) {
|
||||||
return this.getDiscreteColor(i);
|
return this.getDiscreteColor(i);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user