UNPKG

igniteui-webcomponents-charts

Version:

Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.

1,299 lines (1,296 loc) 48.1 kB
import { Treemap } from "./Treemap"; import { toPoint, ensureEnum, brushToString, stringToBrush, ensureBool, initializePropertiesFromCss, NamePatcher, toSpinal, fromBrushCollection, toBrushCollection, brushCollectionToString, enumToString, getAllPropertyNames, fromSpinal } from "igniteui-webcomponents-core"; import { FontInfo } from "igniteui-webcomponents-core"; import { WebComponentRenderer } from "igniteui-webcomponents-core"; import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core"; import { DataChartStylingDefaults } from './DataChartStylingDefaults'; import { IgcTreemapNodeStyleMappingComponent } from './igc-treemap-node-style-mapping-component'; import { IgcTreemapNodeStyleMappingCollection } from './igc-treemap-node-style-mapping-collection'; import { CollectionAdapter } from "igniteui-webcomponents-core"; import { NotifyCollectionChangedAction } from "igniteui-webcomponents-core"; import { TreemapFillScaleMode_$type } from "./TreemapFillScaleMode"; import { IgcTreemapNodeStylingEventArgs } from "./igc-treemap-node-styling-event-args"; import { TypeRegistrar } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; import { TreemapOrientation_$type } from './TreemapOrientation'; import { TreemapLayoutType_$type } from './TreemapLayoutType'; import { IgcTreemapNodePointerEventArgs } from './igc-treemap-node-pointer-event-args'; import { TreemapHeaderDisplayMode_$type } from './TreemapHeaderDisplayMode'; import { HorizontalAlignment_$type } from "igniteui-webcomponents-core"; import { VerticalAlignment_$type } from "igniteui-webcomponents-core"; import { TreemapLabelHorizontalFitMode_$type } from './TreemapLabelHorizontalFitMode'; import { TreemapLabelVerticalFitMode_$type } from './TreemapLabelVerticalFitMode'; import { TreemapHighlightingMode_$type } from './TreemapHighlightingMode'; import { TreemapHighlightedValueDisplayMode_$type } from './TreemapHighlightedValueDisplayMode'; import { IgcHTMLElement } from "igniteui-webcomponents-core"; export let IgcTreemapComponent = /*@__PURE__*/ (() => { class IgcTreemapComponent extends IgcHTMLElement { set height(value) { this._height = value; this.style.height = value; this.i.notifySizeChanged(); } get height() { return this._height; } set width(value) { this._width = value; this.style.width = value; this.i.notifySizeChanged(); } get width() { return this._width; } /** * A collection or manually added axes for the chart. */ get styleMappings() { if (this._styleMappings === null) { let coll = new IgcTreemapNodeStyleMappingCollection(); let inner = coll._innerColl; inner.addListener((sender, e) => { switch (e.action) { case NotifyCollectionChangedAction.Add: this._styleMappingsAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0)); break; case NotifyCollectionChangedAction.Remove: this._styleMappingsAdapter.removeManualItemAt(e.oldStartingIndex); break; case NotifyCollectionChangedAction.Replace: this._styleMappingsAdapter.removeManualItemAt(e.oldStartingIndex); this._styleMappingsAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0)); break; case NotifyCollectionChangedAction.Reset: this._styleMappingsAdapter.clearManualItems(); break; } }); this._styleMappings = coll; } return this._styleMappings; } constructor() { super(); this.contentStyleMappings = []; /** * The style mappings actually present in the treemap. Do not directly modify this array. * This array's contents can be modified by causing Angular to reproject the child content. * Or adding and removing style mappings from the manual style mappings collection on the styleMappings property. */ this.actualStyleMappings = []; this._styleMappings = null; this._styleMappingsAdapter = null; this._disconnected = false; this._settingAttributes = false; this._attached = false; this._queuedSetAttributes = []; this._updatingFromAttribute = false; this.__p = null; this._hasUserValues = new Set(); this._stylingContainer = null; this._stylingParent = null; this._inStyling = false; this._nodeStyling = null; this._nodeStyling_wrapped = null; this._nodeRenderStyling = null; this._nodeRenderStyling_wrapped = null; this._nodePointerOver = null; this._nodePointerOver_wrapped = null; this._nodePointerEnter = null; this._nodePointerEnter_wrapped = null; this._nodePointerLeave = null; this._nodePointerLeave_wrapped = null; this._nodePointerPressed = null; this._nodePointerPressed_wrapped = null; this._nodePointerReleased = null; this._nodePointerReleased_wrapped = null; if (this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this)); } this._renderer = new WebComponentRenderer(this, document, true, DataChartStylingDefaults); this._implementation = this.createImplementation(); this._container = this._renderer.createElement("div"); this._renderer.updateRoot(this._container); //this._renderer.rootWrapper.append(this._container); this._container.setStyleProperty("display", "block"); this._container.setStyleProperty("width", "100%"); this._container.setStyleProperty("height", "100%"); var root; root = this._container; if (this._container.getNativeElement() != null) { root = this._container.getNativeElement(); } this._wrapper = this._renderer; var treemap = this.i; this._treeMap = treemap; this._styleMappingsAdapter = new CollectionAdapter(this.contentStyleMappings, this.i.styleMappings, this.actualStyleMappings, (c) => c.i, (i) => { if (this._container && this._container.getNativeElement().parentElement) { i._styling(this, this, this); } }, (i) => { }); treemap.provideContainer(this._renderer); treemap.notifySizeChanged(); let mut = new MutationObserver((list) => { for (var mutation of list) { if (mutation.type == 'childList') { this.updateContentStyleMappings(); } } }); mut.observe(this, { childList: true }); this._renderer.addSizeWatcher(() => { this._treeMap.notifySizeChanged(); }); } // supports angular themes or custom properties set in CSS updateStyle() { this._styling(this, this); } destroy() { this._treeMap.destroy(); this._wrapper.destroy(); } updateContentStyleMappings() { this.contentStyleMappings.length = 0; for (var i = 0; i < this.children.length; i++) { if (this.children[i] instanceof IgcTreemapNodeStyleMappingComponent) { this.contentStyleMappings.push(this.children[i]); } } if (this._styleMappingsAdapter != null) { this._styleMappingsAdapter.notifyContentChanged(); } } createImplementation() { return new Treemap(); } disconnectedCallback() { this._disconnected = true; if (this.i) { this.i.onDetachedFromUI(); } } connectedCallback() { if (this._disconnected) { this._disconnected = false; if (this.i) { this.i.onAttachedToUI(); } return; } this.classList.add("ig-treemap"); this.classList.add("igc-treemap"); this.appendChild(this._renderer.rootWrapper.getNativeElement()); this._attached = true; this.style.display = "block"; this.style.height = this._height; this.style.width = this._width; this._flushQueuedAttributes(); // supports themes or custom properties set in CSS this._styling(this, this); for (let i = 0; i < this.actualStyleMappings.length; i++) { let s = this.actualStyleMappings[i]; s._styling(this, this, this); } this.updateContentStyleMappings(); this.afterContentInit(); } afterContentInit() { this.i.notifySizeChanged(); } /** * @hidden */ get i() { return this._implementation; } /** * @hidden */ static _createFromInternal(internal) { if (!internal) { return null; } if (!internal.$type) { return null; } let name = internal.$type.name; let externalName = "Igc" + name + "Component"; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); } _enqueueSetAttribute(attrName, attrValue) { this._queuedSetAttributes.push({ attrName: attrName, attrValue: attrValue }); } _flushQueuedAttributes() { this._settingAttributes = true; for (let i = 0; i < this._queuedSetAttributes.length; i++) { this.setAttribute(this._queuedSetAttributes[i].attrName, this._queuedSetAttributes[i].attrValue); } this._settingAttributes = false; this._queuedSetAttributes.length = 0; } _a(attrName, attrValue) { if (this._updatingFromAttribute) { return; } if (attrValue) { attrValue = attrValue.toString(); } this._settingAttributes = true; attrName = toSpinal(attrName); if (this._attached) { this.setAttribute(attrName, attrValue); } else { this._enqueueSetAttribute(attrName, attrValue); } this._settingAttributes = false; } static get observedAttributes() { if (IgcTreemapComponent._observedAttributesIgcTreemapComponent == null) { let names = getAllPropertyNames(IgcTreemapComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcTreemapComponent._observedAttributesIgcTreemapComponent = names; } return IgcTreemapComponent._observedAttributesIgcTreemapComponent; } attributeChangedCallback(name, oldValue, newValue) { if (this._settingAttributes) { return; } let setName = fromSpinal(name); this._updatingFromAttribute = true; this[setName] = newValue; this._updatingFromAttribute = false; } static register() { if (!IgcTreemapComponent._isElementRegistered) { IgcTreemapComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcTreemapComponent.htmlTagName, IgcTreemapComponent); } } /** * Gets or sets path to use to get the values from the items. */ get valueMemberPath() { return this.i.hx; } set valueMemberPath(v) { this.i.hx = v; } /** * Gets or sets the root title to use for breadcrumbs. */ get rootTitle() { return this.i.hn; } set rootTitle(v) { this.i.hn = v; } /** * Gets or sets the root title to use for breadcrumbs. */ get breadcrumbSequence() { return this.i.fh; } set breadcrumbSequence(v) { this.i.fh = v; } /** * Gets or sets the path to use to get the Parent of the items. */ get parentIdMemberPath() { return this.i.hb; } set parentIdMemberPath(v) { this.i.hb = v; } /** * Gets or sets the path to use to get the Label of the items. */ get labelMemberPath() { return this.i.gt; } set labelMemberPath(v) { this.i.gt = v; } /** * Gets or sets the path to use to get the custom value of the items. */ get customValueMemberPath() { return this.i.fk; } set customValueMemberPath(v) { this.i.fk = v; } /** * Gets or sets the path to use to get the id of the items. */ get idMemberPath() { return this.i.gj; } set idMemberPath(v) { this.i.gj = v; } /** * Gets or sets the (possibly hierarchical) data to assign to the TreeMap. */ get dataSource() { return this.i.dataSource; } set dataSource(v) { this.i.dataSource = v; } /** * Gets or sets the data to highlight. */ get highlightedDataSource() { return this.i.highlightedDataSource; } set highlightedDataSource(v) { this.i.highlightedDataSource = v; } /** * Gets or sets the highlighted value mapping property. */ get highlightedValueMemberPath() { return this.i.gb; } set highlightedValueMemberPath(v) { this.i.gb = v; } /** * Gets or sets the opacity applied to the node underneath the highlighted value. */ get highlightedValueOpacity() { return this.i.dt; } set highlightedValueOpacity(v) { this.i.dt = +v; this._a("highlightedValueOpacity", this.i.dt); } /** * Gets or sets the display mode for highlighted values. */ get highlightedValuesDisplayMode() { return this.i.l; } set highlightedValuesDisplayMode(v) { this.i.l = ensureEnum(TreemapHighlightedValueDisplayMode_$type, v); this._a("highlightedValuesDisplayMode", enumToString(TreemapHighlightedValueDisplayMode_$type, this.i.l)); } /** * Gets or sets brushes to use for the fill scale. */ get fillBrushes() { return fromBrushCollection(this.i.b); } set fillBrushes(v) { this.i.b = toBrushCollection(v); this._a("fillBrushes", brushCollectionToString(this.i.b)); } /** * Gets or sets mode to use for the fill scale. */ get fillScaleMode() { return this.i.d; } set fillScaleMode(v) { this.i.d = ensureEnum(TreemapFillScaleMode_$type, v); this._a("fillScaleMode", enumToString(TreemapFillScaleMode_$type, this.i.d)); } /** * Gets or sets whether the fill scale is logarithmic. */ get isFillScaleLogarithmic() { return this.i.bx; } set isFillScaleLogarithmic(v) { this.i.bx = ensureBool(v); this._a("isFillScaleLogarithmic", this.i.bx); } /** * Gets or sets the logarithm base to use if the fill scale is logarithmic. */ get fillScaleLogarithmBase() { return this.i.ez; } set fillScaleLogarithmBase(v) { this.i.ez = +v; this._a("fillScaleLogarithmBase", this.i.ez); } /** * Gets or sets the minimum value to use for the fill scale. */ get fillScaleMinimumValue() { return this.i.dl; } set fillScaleMinimumValue(v) { this.i.dl = +v; this._a("fillScaleMinimumValue", this.i.dl); } /** * Gets or sets the maximum value to use for the fill scale. */ get fillScaleMaximumValue() { return this.i.dk; } set fillScaleMaximumValue(v) { this.i.dk = +v; this._a("fillScaleMaximumValue", this.i.dk); } /** * Gets or sets the vertical fit mode to use for the node labels. */ get labelVerticalFitMode() { return this.i.r; } set labelVerticalFitMode(v) { this.i.r = ensureEnum(TreemapLabelVerticalFitMode_$type, v); this._a("labelVerticalFitMode", enumToString(TreemapLabelVerticalFitMode_$type, this.i.r)); } /** * Gets or sets the horizontal fit mode to use for the node labels. */ get labelHorizontalFitMode() { return this.i.o; } set labelHorizontalFitMode(v) { this.i.o = ensureEnum(TreemapLabelHorizontalFitMode_$type, v); this._a("labelHorizontalFitMode", enumToString(TreemapLabelHorizontalFitMode_$type, this.i.o)); } /** * Gets or sets the background to use for the overlay header when it is hovered. */ get overlayHeaderHoverBackground() { return brushToString(this.i.jx); } set overlayHeaderHoverBackground(v) { this.i.jx = stringToBrush(v); this._a("overlayHeaderHoverBackground", brushToString(this.i.jx)); } /** * Gets or sets the background to use for the header when it is hovered. */ get headerHoverBackground() { return brushToString(this.i.jr); } set headerHoverBackground(v) { this.i.jr = stringToBrush(v); this._a("headerHoverBackground", brushToString(this.i.jr)); } /** * Gets or sets the background to use for the header. */ get headerBackground() { return brushToString(this.i.jp); } set headerBackground(v) { this.i.jp = stringToBrush(v); this._a("headerBackground", brushToString(this.i.jp)); } /** * Gets or sets the background to use for the overlay header. */ get overlayHeaderBackground() { return brushToString(this.i.jw); } set overlayHeaderBackground(v) { this.i.jw = stringToBrush(v); this._a("overlayHeaderBackground", brushToString(this.i.jw)); } /** * Gets or sets the text color to use for the header. */ get headerTextColor() { return brushToString(this.i.ju); } set headerTextColor(v) { this.i.ju = stringToBrush(v); this._a("headerTextColor", brushToString(this.i.ju)); } /** * Gets or sets the dark text color to use for the header. */ get headerDarkTextColor() { return brushToString(this.i.jq); } set headerDarkTextColor(v) { this.i.jq = stringToBrush(v); this._a("headerDarkTextColor", brushToString(this.i.jq)); } /** * Gets or sets the text color to use for the nodes. */ get textColor() { return brushToString(this.i.j7); } set textColor(v) { this.i.j7 = stringToBrush(v); this._a("textColor", brushToString(this.i.j7)); } /** * Gets or sets the dark text color to use for the nodes. */ get darkTextColor() { return brushToString(this.i.jo); } set darkTextColor(v) { this.i.jo = stringToBrush(v); this._a("darkTextColor", brushToString(this.i.jo)); } /** * Gets or sets the text color to use for the header. */ get headerHoverTextColor() { return brushToString(this.i.jt); } set headerHoverTextColor(v) { this.i.jt = stringToBrush(v); this._a("headerHoverTextColor", brushToString(this.i.jt)); } /** * Gets or sets the dark text color to use for the header when hovered. */ get headerHoverDarkTextColor() { return brushToString(this.i.js); } set headerHoverDarkTextColor(v) { this.i.js = stringToBrush(v); this._a("headerHoverDarkTextColor", brushToString(this.i.js)); } /** * Gets or sets the font to use for content nodes */ get textStyle() { if (this.i.a8 == null) { return null; } return this.i.a8.fontString; } set textStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.a8 = fi; this._a("textStyle", this.i.a8 != null ? this.i.a8.fontString : ""); } /** * Gets or sets the font to use for header nodes */ get headerTextStyle() { if (this.i.a6 == null) { return null; } return this.i.a6.fontString; } set headerTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.a6 = fi; this._a("headerTextStyle", this.i.a6 != null ? this.i.a6.fontString : ""); } /** * Gets or sets the font to use for header nodes */ get headerDisplayMode() { return this.i.j; } set headerDisplayMode(v) { this.i.j = ensureEnum(TreemapHeaderDisplayMode_$type, v); this._a("headerDisplayMode", enumToString(TreemapHeaderDisplayMode_$type, this.i.j)); } /** * Gets or sets the left margin to use for the header. */ get headerLabelLeftMargin() { return this.i.dq; } set headerLabelLeftMargin(v) { this.i.dq = +v; this._a("headerLabelLeftMargin", this.i.dq); } /** * Gets or sets the top margin to use for the header. */ get headerLabelTopMargin() { return this.i.ds; } set headerLabelTopMargin(v) { this.i.ds = +v; this._a("headerLabelTopMargin", this.i.ds); } /** * Gets or sets the right margin to use for the header. */ get headerLabelRightMargin() { return this.i.dr; } set headerLabelRightMargin(v) { this.i.dr = +v; this._a("headerLabelRightMargin", this.i.dr); } /** * Gets or sets the bottom margin to use for the header. */ get headerLabelBottomMargin() { return this.i.dp; } set headerLabelBottomMargin(v) { this.i.dp = +v; this._a("headerLabelBottomMargin", this.i.dp); } /** * Gets or sets the left margin to use for the overlay header. */ get overlayHeaderLabelLeftMargin() { return this.i.d3; } set overlayHeaderLabelLeftMargin(v) { this.i.d3 = +v; this._a("overlayHeaderLabelLeftMargin", this.i.d3); } /** * Gets or sets the top margin to use for the overlay header. */ get overlayHeaderLabelTopMargin() { return this.i.d5; } set overlayHeaderLabelTopMargin(v) { this.i.d5 = +v; this._a("overlayHeaderLabelTopMargin", this.i.d5); } /** * Gets or sets the right margin to use for the overlay header. */ get overlayHeaderLabelRightMargin() { return this.i.d4; } set overlayHeaderLabelRightMargin(v) { this.i.d4 = +v; this._a("overlayHeaderLabelRightMargin", this.i.d4); } /** * Gets or sets the bottom margin to use for the overlay header. */ get overlayHeaderLabelBottomMargin() { return this.i.d2; } set overlayHeaderLabelBottomMargin(v) { this.i.d2 = +v; this._a("overlayHeaderLabelBottomMargin", this.i.d2); } /** * Gets or sets the left margin to use for the labels. */ get labelLeftMargin() { return this.i.dx; } set labelLeftMargin(v) { this.i.dx = +v; this._a("labelLeftMargin", this.i.dx); } /** * Gets or sets the top margin to use for the labels. */ get labelTopMargin() { return this.i.dz; } set labelTopMargin(v) { this.i.dz = +v; this._a("labelTopMargin", this.i.dz); } /** * Gets or sets the right margin to use for the labels. */ get labelRightMargin() { return this.i.dy; } set labelRightMargin(v) { this.i.dy = +v; this._a("labelRightMargin", this.i.dy); } /** * Gets or sets the bottom margin to use for the labels. */ get labelBottomMargin() { return this.i.dw; } set labelBottomMargin(v) { this.i.dw = +v; this._a("labelBottomMargin", this.i.dw); } /** * Gets or sets the left margin to use for the parent nodes. */ get parentNodeLeftMargin() { return this.i.d8; } set parentNodeLeftMargin(v) { this.i.d8 = +v; this._a("parentNodeLeftMargin", this.i.d8); } /** * Gets or sets the top margin to use for the parent nodes. */ get parentNodeTopMargin() { return this.i.ec; } set parentNodeTopMargin(v) { this.i.ec = +v; this._a("parentNodeTopMargin", this.i.ec); } /** * Gets or sets the right margin to use for the parent nodes. */ get parentNodeRightMargin() { return this.i.ea; } set parentNodeRightMargin(v) { this.i.ea = +v; this._a("parentNodeRightMargin", this.i.ea); } /** * Gets or sets the bottom margin to use for the parent nodes. */ get parentNodeBottomMargin() { return this.i.d6; } set parentNodeBottomMargin(v) { this.i.d6 = +v; this._a("parentNodeBottomMargin", this.i.d6); } /** * Gets or sets the left padding to use for the parent nodes. */ get parentNodeLeftPadding() { return this.i.d9; } set parentNodeLeftPadding(v) { this.i.d9 = +v; this._a("parentNodeLeftPadding", this.i.d9); } /** * Gets or sets the top padding to use for the parent nodes. */ get parentNodeTopPadding() { return this.i.ed; } set parentNodeTopPadding(v) { this.i.ed = +v; this._a("parentNodeTopPadding", this.i.ed); } /** * Gets or sets the right padding to use for the parent nodes. */ get parentNodeRightPadding() { return this.i.eb; } set parentNodeRightPadding(v) { this.i.eb = +v; this._a("parentNodeRightPadding", this.i.eb); } /** * Gets or sets the bottom padding to use for the parent nodes. */ get parentNodeBottomPadding() { return this.i.d7; } set parentNodeBottomPadding(v) { this.i.d7 = +v; this._a("parentNodeBottomPadding", this.i.d7); } /** * Gets or sets the horizontal alignment to use for the node labels. */ get labelHorizontalAlignment() { return this.i.ja; } set labelHorizontalAlignment(v) { this.i.ja = ensureEnum(HorizontalAlignment_$type, v); this._a("labelHorizontalAlignment", enumToString(HorizontalAlignment_$type, this.i.ja)); } /** * Gets or sets the vertical alignment to use for the node labels. */ get labelVerticalAlignment() { return this.i.kd; } set labelVerticalAlignment(v) { this.i.kd = ensureEnum(VerticalAlignment_$type, v); this._a("labelVerticalAlignment", enumToString(VerticalAlignment_$type, this.i.kd)); } /** * Gets or sets the height to use for the header. */ get headerHeight() { return this.i.dn; } set headerHeight(v) { this.i.dn = +v; this._a("headerHeight", this.i.dn); } /** * Gets or sets the outline to use for the nodes. */ get outline() { return brushToString(this.i.jv); } set outline(v) { this.i.jv = stringToBrush(v); this._a("outline", brushToString(this.i.jv)); } /** * Gets or sets the stroke thickness to use for the node outline. */ get strokeThickness() { return this.i.es; } set strokeThickness(v) { this.i.es = +v; this._a("strokeThickness", this.i.es); } /** * Gets or sets the opacity to use for the nodes. */ get nodeOpacity() { return this.i.d1; } set nodeOpacity(v) { this.i.d1 = +v; this._a("nodeOpacity", this.i.d1); } /** * Gets or sets the orientation to use for the stripped and slice and dice layout types. */ get layoutOrientation() { return this.i.al; } set layoutOrientation(v) { this.i.al = ensureEnum(TreemapOrientation_$type, v); this._a("layoutOrientation", enumToString(TreemapOrientation_$type, this.i.al)); } /** * Gets or sets the type of layout to use for the nodes. */ get layoutType() { return this.i.u; } set layoutType(v) { this.i.u = ensureEnum(TreemapLayoutType_$type, v); this._a("layoutType", enumToString(TreemapLayoutType_$type, this.i.u)); } /** * Gets or sets the minimum size (width or height) to display a node. */ get minimumDisplaySize() { return this.i.d0; } set minimumDisplaySize(v) { this.i.d0 = +v; this._a("minimumDisplaySize", this.i.d0); } /** * Gets or sets the number of milliseconds over which changes to the gauge should be animated. */ get transitionDuration() { return this.i.e3; } set transitionDuration(v) { this.i.e3 = +v; this._a("transitionDuration", this.i.e3); } /** * Gets or sets the scaling value used to affect the pixel density of the control. * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control * to appear blurry. */ get pixelScalingRatio() { return this.i.ee; } set pixelScalingRatio(v) { this.i.ee = +v; this._a("pixelScalingRatio", this.i.ee); } get actualPixelScalingRatio() { return this.i.dg; } set actualPixelScalingRatio(v) { this.i.dg = +v; this._a("actualPixelScalingRatio", this.i.dg); } /** * Gets or sets the scaling value used to affect the pixel density of the control while it is animating. * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control * to appear blurry. */ get interactionPixelScalingRatio() { return this.i.dv; } set interactionPixelScalingRatio(v) { this.i.dv = +v; this._a("interactionPixelScalingRatio", this.i.dv); } /** * Gets or sets the resolved scaling value used to affect the pixel density of the control while it is animating. * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control * to appear blurry. */ get actualInteractionPixelScalingRatio() { return this.i.df; } set actualInteractionPixelScalingRatio(v) { this.i.df = +v; this._a("actualInteractionPixelScalingRatio", this.i.df); } /** * Gets or sets the number of milliseconds over which the highlighting effect will render. */ get highlightingTransitionDuration() { return this.i.e1; } set highlightingTransitionDuration(v) { this.i.e1 = +v; this._a("highlightingTransitionDuration", this.i.e1); } /** * Gets or sets the highlighting mode to use. */ get highlightingMode() { return this.i.aw; } set highlightingMode(v) { this.i.aw = ensureEnum(TreemapHighlightingMode_$type, v); this._a("highlightingMode", enumToString(TreemapHighlightingMode_$type, this.i.aw)); } /** * Gets the actual highlighting mode used. */ get actualHighlightingMode() { return this.i.au; } set actualHighlightingMode(v) { this.i.au = ensureEnum(TreemapHighlightingMode_$type, v); this._a("actualHighlightingMode", enumToString(TreemapHighlightingMode_$type, this.i.au)); } /** * Gets or sets the opacity to use for nodes that are not highlighted when HighlightingMode is set to FadeOthers. */ get highlightingFadeOpacity() { return this.i.du; } set highlightingFadeOpacity(v) { this.i.du = +v; this._a("highlightingFadeOpacity", this.i.du); } get animating() { return this.i.bs; } /** * Gets or sets the item to drill to in the treemap. */ get focusItem() { return this.i.e5; } set focusItem(v) { this.i.e5 = v; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.styleMappings != null && this.styleMappings.findByName && this.styleMappings.findByName(name)) { return this.styleMappings.findByName(name); } return null; } get hasUserValues() { return this._hasUserValues; } __m(propertyName) { if (!this._inStyling) { this._hasUserValues.add(propertyName); } } _styling(container, component, parent) { if (this._inStyling) { return; } this._inStyling = true; this._stylingContainer = container; this._stylingParent = component; let genericPrefix = ""; let typeName = this.i.$type.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } genericPrefix = toSpinal("TreemapComponent"); let additionalPrefixes = []; let prefix = toSpinal(typeName); additionalPrefixes.push(prefix + "-"); let b = this.i.$type.baseType; while (b && b.name != "Object" && b.name != "Base" && b.name != "Control" && b.Name != "DependencyObject" && b.Name != "FrameworkElement") { typeName = b.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } let basePrefix = toSpinal(typeName); additionalPrefixes.push(basePrefix + "-"); b = b.baseType; } if (parent) { let parentTypeName = parent.i.$type.name; if (parentTypeName.indexOf("Xam") === 0) { parentTypeName = parentTypeName.substring(3); } let parentPrefix = toSpinal(parentTypeName); additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-"); additionalPrefixes.push(parentPrefix + "-" + prefix + "-"); } initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes); if (this._otherStyling) { this._otherStyling(container, component, parent); } this._inStyling = false; } notifySizeChanged() { this.i.notifySizeChanged(); } /** * Returns visuals as a serialized string. */ exportSerializedVisualData() { let iv = this.i.fn(); return (iv); } markDirty() { this.i.ic(); } onDetachedFromUI() { this.i.onDetachedFromUI(); } onAttachedToUI() { this.i.onAttachedToUI(); } flush() { this.i.h9(); } notifySetItem(source_, index, oldItem, newItem) { this.i.ii(source_, index, oldItem, newItem); } /** * Manually notifies the treemap's data source that the data it has bound to has been cleared and needs to be re-examined. * This should not be called if the data that the pie chart is bound to is already observable. * @param source_ * The data source. */ notifyClearItems(source_) { this.i.ie(source_); } notifyInsertItem(source_, index, newItem) { this.i.ig(source_, index, newItem); } notifyRemoveItem(source_, index, oldItem) { this.i.ih(source_, index, oldItem); } simulateHover(point) { this.i.i2(toPoint(point)); } /** * Fired when a node is being styled. Provides an opportunity to customize node styling. */ get nodeStyling() { return this._nodeStyling; } set nodeStyling(ev) { if (this._nodeStyling_wrapped !== null) { this.i.nodeStyling = delegateRemove(this.i.nodeStyling, this._nodeStyling_wrapped); this._nodeStyling_wrapped = null; this._nodeStyling = null; } this._nodeStyling = ev; this._nodeStyling_wrapped = (o, e) => { let outerArgs = new IgcTreemapNodeStylingEventArgs(); outerArgs._provideImplementation(e); if (this.beforeNodeStyling) { this.beforeNodeStyling(this, outerArgs); } if (this._nodeStyling) { this._nodeStyling(this, outerArgs); } }; this.i.nodeStyling = delegateCombine(this.i.nodeStyling, this._nodeStyling_wrapped); ; } /** * Fired before a node is rendered for last minute style changes. */ get nodeRenderStyling() { return this._nodeRenderStyling; } set nodeRenderStyling(ev) { if (this._nodeRenderStyling_wrapped !== null) { this.i.nodeRenderStyling = delegateRemove(this.i.nodeRenderStyling, this._nodeRenderStyling_wrapped); this._nodeRenderStyling_wrapped = null; this._nodeRenderStyling = null; } this._nodeRenderStyling = ev; this._nodeRenderStyling_wrapped = (o, e) => { let outerArgs = new IgcTreemapNodeStylingEventArgs(); outerArgs._provideImplementation(e); if (this.beforeNodeRenderStyling) { this.beforeNodeRenderStyling(this, outerArgs); } if (this._nodeRenderStyling) { this._nodeRenderStyling(this, outerArgs); } }; this.i.nodeRenderStyling = delegateCombine(this.i.nodeRenderStyling, this._nodeRenderStyling_wrapped); ; } /** * Fired with the pointer is moving over a node. */ get nodePointerOver() { return this._nodePointerOver; } set nodePointerOver(ev) { if (this._nodePointerOver_wrapped !== null) { this.i.nodePointerOver = delegateRemove(this.i.nodePointerOver, this._nodePointerOver_wrapped); this._nodePointerOver_wrapped = null; this._nodePointerOver = null; } this._nodePointerOver = ev; this._nodePointerOver_wrapped = (o, e) => { let outerArgs = new IgcTreemapNodePointerEventArgs(); outerArgs._provideImplementation(e); if (this.beforeNodePointerOver) { this.beforeNodePointerOver(this, outerArgs); } if (this._nodePointerOver) { this._nodePointerOver(this, outerArgs); } }; this.i.nodePointerOver = delegateCombine(this.i.nodePointerOver, this._nodePointerOver_wrapped); ; } /** * Fired when the pointer enters a node. */ get nodePointerEnter() { return this._nodePointerEnter; } set nodePointerEnter(ev) { if (this._nodePointerEnter_wrapped !== null) { this.i.nodePointerEnter = delegateRemove(this.i.nodePointerEnter, this._nodePointerEnter_wrapped); this._nodePointerEnter_wrapped = null; this._nodePointerEnter = null; } this._nodePointerEnter = ev; this._nodePointerEnter_wrapped = (o, e) => { let outerArgs = new IgcTreemapNodePointerEventArgs(); outerArgs._provideImplementation(e); if (this.beforeNodePointerEnter) { this.beforeNodePointerEnter(this, outerArgs); } if (this._nodePointerEnter) { this._nodePointerEnter(this, outerArgs); } }; this.i.nodePointerEnter = delegateCombine(this.i.nodePointerEnter, this._nodePointerEnter_wrapped); ; } /** * Fired when the pointer leaved a node. */ get nodePointerLeave() { return this._nodePointerLeave; } set nodePointerLeave(ev) { if (this._nodePointerLeave_wrapped !== null) { this.i.nodePointerLeave = delegateRemove(this.i.nodePointerLeave, this._nodePointerLeave_wrapped); this._nodePointerLeave_wrapped = null; this._nodePointerLeave = null; } this._nodePointerLeave = ev; this._nodePointerLeave_wrapped = (o, e) => { let outerArgs = new IgcTreemapNodePointerEventArgs(); outerArgs._provideImplementation(e); if (this.beforeNodePointerLeave) { this.beforeNodePointerLeave(this, outerArgs); } if (this._nodePointerLeave) { this._nodePointerLeave(this, outerArgs); } }; this.i.nodePointerLeave = delegateCombine(this.i.nodePointerLeave, this._nodePointerLeave_wrapped); ; } /** * Fired when the pointer is pressed on a node. */ get nodePointerPressed() { return this._nodePointerPressed; } set nodePointerPressed(ev) { if (this._nodePointerPressed_wrapped !== null) { this.i.nodePointerPressed = delegateRemove(this.i.nodePointerPressed, this._nodePointerPressed_wrapped); this._nodePointerPressed_wrapped = null; this._nodePointerPressed = null; } this._nodePointerPressed = ev; this._nodePointerPressed_wrapped = (o, e) => { let outerArgs = new IgcTreemapNodePointerEventArgs(); outerArgs._provideImplementation(e); if (this.beforeNodePointerPressed) { this.beforeNodePointerPressed(this, outerArgs); } if (this._nodePointerPressed) { this._nodePointerPressed(this, outerArgs); } }; this.i.nodePointerPressed = delegateCombine(this.i.nodePointerPressed, this._nodePointerPressed_wrapped); ; } /** * Fired when the pointer is released on a node. */ get nodePointerReleased() { return this._nodePointerReleased; } set nodePointerReleased(ev) { if (this._nodePointerReleased_wrapped !== null) { this.i.nodePointerReleased = delegateRemove(this.i.nodePointerReleased, this._nodePointerReleased_wrapped); this._nodePointerReleased_wrapped = null; this._nodePointerReleased = null; } this._nodePointerReleased = ev; this._nodePointerReleased_wrapped = (o, e) => { let outerArgs = new IgcTreemapNodePointerEventArgs(); outerArgs._provideImplementation(e); if (this.beforeNodePointerReleased) { this.beforeNodePointerReleased(this, outerArgs); } if (this._nodePointerReleased) { this._nodePointerReleased(this, outerArgs); } }; this.i.nodePointerReleased = delegateCombine(this.i.nodePointerReleased, this._nodePointerReleased_wrapped); ; } } IgcTreemapComponent._observedAttributesIgcTreemapComponent = null; IgcTreemapComponent.htmlTagName = "igc-treemap"; IgcTreemapComponent._isElementRegistered = false; return IgcTreemapComponent; })();