Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Calculate the value
val = reduceField({
field: calcField,
reducers: [calc],
})[calc];
}
const processor = getDisplayProcessor({
field: {
...fieldInfo.field,
config: {
...fieldInfo.field.config,
unit: panel.format,
decimals: panel.decimals,
mappings: convertOldAngularValueMapping(panel),
},
},
theme: config.theme,
isUtc: dashboard.isTimezoneUtc && dashboard.isTimezoneUtc(),
});
const sparkline: any[] = [];
const data = {
field: fieldInfo.field,
value: val,
display: processor(val),
scopedVars: _.extend({}, panel.scopedVars),
sparkline,
};
data.scopedVars['__name'] = { value: name };
return;
}
const distinct = getDistinctNames(frames);
let fieldInfo = distinct.byName[panel.tableColumn]; //
this.fieldNames = distinct.names;
if (!fieldInfo) {
fieldInfo = distinct.first;
}
if (!fieldInfo) {
const processor = getDisplayProcessor({
field: {
config: {
mappings: convertOldAngularValueMapping(this.panel),
noValue: 'No Data',
},
},
theme: config.theme,
});
// When we don't have any field
this.data = {
value: null,
display: processor(null),
};
} else {
this.data = this.processField(fieldInfo);
}
this.render();
}
return;
}
const distinct = getDistinctNames(frames);
let fieldInfo = distinct.byName[panel.tableColumn]; //
this.fieldNames = distinct.names;
if (!fieldInfo) {
fieldInfo = distinct.first;
}
if (!fieldInfo) {
const processor = getDisplayProcessor({
field: {
config: {
mappings: convertOldAngularValueMapping(this.panel),
noValue: 'No Data',
},
},
theme: config.theme,
});
// When we don't have any field
this.data = {
value: null,
display: processor(null),
};
} else {
this.data = this.processField(fieldInfo);
}
this.render();
}
// Calculate the value
val = reduceField({
field: calcField,
reducers: [calc],
})[calc];
}
const processor = getDisplayProcessor({
field: {
...fieldInfo.field,
config: {
...fieldInfo.field.config,
unit: panel.format,
decimals: panel.decimals,
mappings: convertOldAngularValueMapping(panel),
},
},
theme: config.theme,
timeZone: dashboard.getTimezone(),
});
const sparkline: any[] = [];
const data = {
field: fieldInfo.field,
value: val,
display: processor(val),
scopedVars: _.extend({}, panel.scopedVars),
sparkline,
};
data.scopedVars['__name'] = { value: name };