igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
162 lines (158 loc) • 6.04 kB
JavaScript
import { IgcNumericXAxisComponent } from "./igc-numeric-x-axis-component";
import { IgcCategoryYAxisComponent } from "./igc-category-y-axis-component";
import { IgcColumnFragmentComponent } from "./igc-column-fragment-component";
import { BarFragment } from "./BarFragment";
import { getAllPropertyNames, toSpinal, toPoint, fromRect } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents one part of a StackedBarSeries.
*/
export let IgcBarFragmentComponent = /*@__PURE__*/ (() => {
class IgcBarFragmentComponent extends IgcColumnFragmentComponent {
createImplementation() {
return new BarFragment();
}
/**
* @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 (IgcBarFragmentComponent._observedAttributesIgcBarFragmentComponent == null) {
let names = getAllPropertyNames(IgcBarFragmentComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcBarFragmentComponent._observedAttributesIgcBarFragmentComponent = names;
}
return IgcBarFragmentComponent._observedAttributesIgcBarFragmentComponent;
}
static register() {
if (!IgcBarFragmentComponent._isElementRegistered) {
IgcBarFragmentComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcBarFragmentComponent.htmlTagName, IgcBarFragmentComponent);
}
}
/**
* Gets whether the current series shows a bar shape.
*/
get isBar() {
return this.i.ez;
}
/**
* Overridden by derived series classes to indicate when marker-less display is preferred or not.
*/
get isMarkerlessDisplayPreferred() {
return this.i.fm;
}
/**
* Gets whether the current series shows a column shape.
*/
get isColumn() {
return this.i.e1;
}
/**
* The X-Axis for this BarFragment.
*/
get barFragmentXAxis() {
const r = this.i.barFragmentXAxis;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcNumericXAxisComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
/**
* The Y-Axis for this BarFragment.
*/
get barFragmentYAxis() {
const r = this.i.barFragmentYAxis;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcCategoryYAxisComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
get isVertical() {
return this.i.isVertical;
}
_styling(container, component, parent) {
super._styling(container, component, parent);
this._inStyling = true;
if (this.barFragmentXAxis && this.barFragmentXAxis._styling) {
this.barFragmentXAxis._styling(container, component, this);
}
if (this.barFragmentYAxis && this.barFragmentYAxis._styling) {
this.barFragmentYAxis._styling(container, component, this);
}
this._inStyling = false;
}
/**
* Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
* @param world * The world position for which to return the index.
*/
getExactItemIndex(world) {
let iv = this.i.is(toPoint(world));
return (iv);
}
/**
* 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);
}
}
IgcBarFragmentComponent._observedAttributesIgcBarFragmentComponent = null;
IgcBarFragmentComponent.htmlTagName = "igc-bar-fragment";
IgcBarFragmentComponent._isElementRegistered = false;
return IgcBarFragmentComponent;
})();