igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
198 lines (196 loc) • 6.84 kB
JavaScript
import { __extends } from "tslib";
import { IgrAxis } from "./igr-axis";
import { CategoryTooltipLayerPosition_$type } from "./CategoryTooltipLayerPosition";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { CategoryToolTipLayer } from "./CategoryToolTipLayer";
import { ensureBool, ensureEnum, brushToString, stringToBrush } from "igniteui-react-core";
/**
* Represents an annotation layer that displays grouped tooltips for series that use a category axis.
*/
var IgrCategoryToolTipLayer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrCategoryToolTipLayer, _super);
function IgrCategoryToolTipLayer(props) {
var _this = _super.call(this, props) || this;
_this._targetAxisName = null;
return _this;
}
IgrCategoryToolTipLayer.prototype.createImplementation = function () {
return new CategoryToolTipLayer();
};
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "isToolTipLayer", {
get: function () {
return this.i.f7;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "isAnnotationHoverLayer", {
/**
* Gets whether the series is an annotation layer displayed only when hovering over the chart.
*/
get: function () {
return this.i.eu;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "isDefaultTooltipBehaviorDisabled", {
/**
* Gets whether the default tooltip behaviors for the chart are disabled if this layer is present.
*/
get: function () {
return this.i.e5;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "targetAxis", {
/**
* Gets or sets the Axis to target this annotation to. If null, this annotation layer will not render content.
*/
get: function () {
var r = this.i.aas;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgrAxis._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aas = null : this.i.aas = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "targetAxisName", {
/**
* Gets or sets the name to use to resolve targetAxis from markup.
*/
get: function () {
return this._targetAxisName;
},
set: function (v) {
this._targetAxisName = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "useInterpolation", {
/**
* Gets or sets whether to use value interpolation when drawing the tooltips.
*/
get: function () {
return this.i.aaw;
},
set: function (v) {
this.i.aaw = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "toolTipPosition", {
/**
* Gets or sets the Position to apply to the tooltip containers.
*/
get: function () {
return this.i.aat;
},
set: function (v) {
this.i.aat = ensureEnum(CategoryTooltipLayerPosition_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "toolTipBackground", {
/**
* Gets or sets the background of the tooltip containers.
*/
get: function () {
return brushToString(this.i.abc);
},
set: function (v) {
this.i.abc = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "toolTipBorderBrush", {
/**
* Gets or sets the border color of the tooltip containers.
*/
get: function () {
return brushToString(this.i.abd);
},
set: function (v) {
this.i.abd = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCategoryToolTipLayer.prototype, "toolTipBorderThickness", {
/**
* Gets or sets the border thickness of the tooltip containers.
*/
get: function () {
return this.i.aax;
},
set: function (v) {
this.i.aax = +v;
},
enumerable: false,
configurable: true
});
IgrCategoryToolTipLayer.prototype.bindAxes = function (axes) {
_super.prototype.bindAxes.call(this, axes);
for (var i = 0; i < axes.length; i++) {
if (this.targetAxisName && this.targetAxisName.length > 0 &&
axes[i].name == this.targetAxisName) {
this.targetAxis = axes[i];
}
}
};
IgrCategoryToolTipLayer.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
return this.targetAxis;
}
return null;
};
IgrCategoryToolTipLayer.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.targetAxis && this.targetAxis._styling) {
this.targetAxis._styling(container, component, this);
}
this._inStyling = false;
};
/**
* Hides any tooltips presented by the layer, if any.
*/
IgrCategoryToolTipLayer.prototype.hideToolTips = function () {
this.i.ql();
};
return IgrCategoryToolTipLayer;
}(IgrAnnotationLayer));
export { IgrCategoryToolTipLayer };