igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
113 lines (110 loc) • 2.99 kB
JavaScript
import { IgrSeries } from "./igr-series";
import { fromPoint, toPoint } from "igniteui-react-core";
/**
* Provides data for IgxDataChartComponent mouse button related events.
*/
export class IgrChartMouseEventArgs {
get nativeElement() {
return this._implementation.nativeElement;
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
onImplementationCreated() {
}
constructor() {
this.mounted = false;
}
_provideImplementation(i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
/**
* Gets a reference to the object that raised the event.
*/
get originalSource() {
return this.i.originalSource;
}
/**
* Gets the ItemsSource item associated with the current event.
*/
get item() {
return this.i.item;
}
set item(v) {
this.i.item = v;
}
/**
* Gets the series associated with the current event.
*/
get series() {
const r = this.i.series;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgrSeries._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set series(v) {
v == null ? this.i.series = null : this.i.series = v.i;
}
/**
* Gets the mouse position relative to the plot area.
*/
get plotAreaPosition() {
return fromPoint(this.i.plotAreaPosition);
}
set plotAreaPosition(v) {
this.i.plotAreaPosition = toPoint(v);
}
/**
* Gets the mouse position relative to the chart.
*/
get chartPosition() {
return fromPoint(this.i.chartPosition);
}
/**
* Gets the Chart associated with the current event.
*/
get chart() {
const r = this.i.chart;
if (r == null) {
return null;
}
return r.externalObject;
}
set chart(v) {
v == null ? this.i.chart = null : this.i.chart = v.i;
}
/**
* Provides a human readable description of the mouse button event.
*/
toString() {
let iv = this.i.toString();
return (iv);
}
/**
* Returns the x- and y- coordinates of the mouse pointer position, optionally evaluated
* against the origin of a supplied UIElement.
* @param relativeTo * Any UIElement derived object that is contained by the the engine plug-in
* and connected to the object tree. To specify the object relative to the overall the engine
* coordinate system, use a relativeTo value of null.
*/
getPosition(relativeTo) {
let iv = this.i.getPosition(relativeTo);
return fromPoint(iv);
}
}