igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
173 lines (169 loc) • 6.34 kB
JavaScript
import { IgcCategoryAxisBaseComponent } from "./igc-category-axis-base-component";
import { IgcNumericAxisBaseComponent } from "./igc-numeric-axis-base-component";
import { IgcFragmentBaseComponent } from "./igc-fragment-base-component";
import { ColumnFragment } from "./ColumnFragment";
import { getAllPropertyNames, toSpinal, toPoint, fromRect } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents one part of a StackedColumnSeries.
*/
export let IgcColumnFragmentComponent = /*@__PURE__*/ (() => {
class IgcColumnFragmentComponent extends IgcFragmentBaseComponent {
createImplementation() {
return new ColumnFragment();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor() {
super();
}
connectedCallback() {
if (super["connectedCallback"]) {
super["connectedCallback"]();
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
}
disconnectedCallback() {
if (super["disconnectedCallback"]) {
super["disconnectedCallback"]();
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
}
static get observedAttributes() {
if (IgcColumnFragmentComponent._observedAttributesIgcColumnFragmentComponent == null) {
let names = getAllPropertyNames(IgcColumnFragmentComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcColumnFragmentComponent._observedAttributesIgcColumnFragmentComponent = names;
}
return IgcColumnFragmentComponent._observedAttributesIgcColumnFragmentComponent;
}
static register() {
if (!IgcColumnFragmentComponent._isElementRegistered) {
IgcColumnFragmentComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcColumnFragmentComponent.htmlTagName, IgcColumnFragmentComponent);
}
}
/**
* Gets whether the current series shows a column shape.
*/
get isColumn() {
return this.i.e1;
}
/**
* Overridden by derived series classes to indicate when marker-less display is preferred or not.
*/
get isMarkerlessDisplayPreferred() {
return this.i.fm;
}
/**
* Gets or sets the x-radius of the ellipse that is used to round the corners of the column.
*/
get radiusX() {
return this.i.adf;
}
set radiusX(v) {
this.i.adf = +v;
this._a("radiusX", this.i.adf);
}
/**
* Gets or sets the y-radius of the ellipse that is used to round the corners of the column.
*/
get radiusY() {
return this.i.adg;
}
set radiusY(v) {
this.i.adg = +v;
this._a("radiusY", this.i.adg);
}
/**
* Gets or sets the effective x-axis for this series.
*/
get fragmentXAxis() {
const r = this.i.fragmentXAxis;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcCategoryAxisBaseComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
/**
* Gets or sets the effective y-axis for this series.
*/
get fragmentYAxis() {
const r = this.i.fragmentYAxis;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcNumericAxisBaseComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
_styling(container, component, parent) {
super._styling(container, component, parent);
this._inStyling = true;
if (this.fragmentXAxis && this.fragmentXAxis._styling) {
this.fragmentXAxis._styling(container, component, this);
}
if (this.fragmentYAxis && this.fragmentYAxis._styling) {
this.fragmentYAxis._styling(container, component, this);
}
this._inStyling = false;
}
/**
* If possible, will return the best available value bounding box within the series that has the best value match for the world position provided.
* @param world * The world coordinate for which to get a value bounding box for
*/
getSeriesValueBoundingBox(world) {
let iv = this.i.ws(toPoint(world));
return fromRect(iv);
}
/**
* Gets the item that is the best match for the specified world coordinates.
* @param world * The world coordinates to use.
*/
getItem(world) {
let iv = this.i.ko(toPoint(world));
return (iv);
}
/**
* Gets the index of the item that resides at the provided world coordinates.
* @param world * The world coordinates of the requested item.
*/
getItemIndex(world) {
let iv = this.i.j4(toPoint(world));
return (iv);
}
}
IgcColumnFragmentComponent._observedAttributesIgcColumnFragmentComponent = null;
IgcColumnFragmentComponent.htmlTagName = "igc-column-fragment";
IgcColumnFragmentComponent._isElementRegistered = false;
return IgcColumnFragmentComponent;
})();