r3-legacy/src/r3-graph-metric.js

62 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-10-06 21:11:18 +02:00
/**
* R3.Graph.Metric
* @param apiComponent
* @constructor
*/
R3.Graph.Metric = function(
apiComponent
) {
__RUNTIME_COMPONENT__;
2019-10-15 22:21:34 +02:00
this.linkedComponents.domElements = [R3.DomElement];
2019-10-06 21:11:18 +02:00
R3.Graph.call(
this,
true
);
};
2019-10-15 22:21:34 +02:00
R3.Graph.Metric.prototype = Object.create(R3.Graph.prototype);
2019-10-06 21:11:18 +02:00
R3.Graph.Metric.prototype.constructor = R3.Graph.Metric;
2019-10-15 22:21:34 +02:00
2019-10-06 21:11:18 +02:00
/**
* Updates the instance with the current state
*/
R3.Graph.Metric.prototype.createInstance = function() {
2019-10-15 22:21:34 +02:00
this.instance = true;
2019-10-06 21:11:18 +02:00
__CREATE_INSTANCE__;
};
/**
* Updates the instance with the current state
*/
R3.Graph.Metric.prototype.updateInstance = function(property) {
2019-10-15 22:21:34 +02:00
if (property === 'query') {
this.domElements.map(
function(domElement, index) {
if (this.query instanceof R3.Query.Alerts.Summary) {
if (R3.Utils.UndefinedOrNull(this.query.priorities[index])) {
domElement.instance.innerHTML = 0;
} else {
domElement.instance.innerHTML = this.query.priorities[index];
}
}
}.bind(this)
)
}
2019-10-06 21:11:18 +02:00
R3.Graph.prototype.updateInstance.call(this, property);
};