igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,494 lines (1,491 loc) • 52.7 kB
JavaScript
import { __extends, __values } from "tslib";
import * as React from 'react';
import { Treemap } from "./Treemap";
import { toPoint, ensureEnum, brushToString, stringToBrush, ensureBool, initializePropertiesFromCss, NamePatcher, isValidProp, toSpinal, getModifiedProps, fromBrushCollection, toBrushCollection } from "igniteui-react-core";
import { FontInfo } from "igniteui-react-core";
import { ReactRenderer } from "igniteui-react-core";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { TreemapNodeStyleMapping } from './TreemapNodeStyleMapping';
import { IgrTreemapNodeStyleMappingCollection } from './igr-treemap-node-style-mapping-collection';
import { ContentChildrenManager } from "igniteui-react-core";
import { CollectionAdapter } from "igniteui-react-core";
import { NotifyCollectionChangedAction } from "igniteui-react-core";
import { TreemapFillScaleMode_$type } from "./TreemapFillScaleMode";
import { IgrTreemapNodeStylingEventArgs } from "./igr-treemap-node-styling-event-args";
import { TreemapOrientation_$type } from './TreemapOrientation';
import { TreemapLayoutType_$type } from './TreemapLayoutType';
import { IgrTreemapNodePointerEventArgs } from './igr-treemap-node-pointer-event-args';
import { TreemapHeaderDisplayMode_$type } from './TreemapHeaderDisplayMode';
import { HorizontalAlignment_$type } from "igniteui-react-core";
import { VerticalAlignment_$type } from "igniteui-react-core";
import { TreemapLabelHorizontalFitMode_$type } from './TreemapLabelHorizontalFitMode';
import { TreemapLabelVerticalFitMode_$type } from './TreemapLabelVerticalFitMode';
import { TreemapHighlightingMode_$type } from './TreemapHighlightingMode';
import { TreemapHighlightedValueDisplayMode_$type } from './TreemapHighlightedValueDisplayMode';
var IgrTreemap = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrTreemap, _super);
function IgrTreemap(props) {
var _this = _super.call(this, props) || this;
_this._wrapper = null;
_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 React to reproject the child content.
* Or adding and removing ranges from the manual ranges collection on the ranges property.
*/
_this.actualStyleMappings = [];
_this._styleMappings = null;
_this._styleMappingsAdapter = null;
_this._implementation = null;
_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._getMainRef = _this._getMainRef.bind(_this);
_this._contentChildrenManager = new ContentChildrenManager(function (ch) { return ch.key || ch.props.name; }, function (ch) { return ch.key || ch.props.name; }, function () { return _this._updateContentChildren(); });
_this._implementation = _this.createImplementation();
if (document) {
_this._container = document.createElement("div");
_this._container.style.display = "block";
_this._container.style.width = "100%";
_this._container.style.height = "100%";
}
var root;
root = _this._container;
if (_this._container != null) {
root = _this._container;
}
var ren = new ReactRenderer(root, document, true, DataChartStylingDefaults);
_this._wrapper = ren;
var treemap = _this.i;
_this._treeMap = treemap;
_this._styleMappingsAdapter = new CollectionAdapter(_this.contentStyleMappings, _this.i.styleMappings, _this.actualStyleMappings, function (c) { return c.i; }, function (i) {
if (_this._container && _this._container.parentElement) {
i._styling(_this._container, _this, _this);
}
}, function (i) { });
treemap.provideContainer(ren);
treemap.notifySizeChanged();
if (props) {
_this.initializeProperties();
}
ren.addSizeWatcher(function () {
_this._treeMap.notifySizeChanged();
});
return _this;
}
Object.defineProperty(IgrTreemap.prototype, "height", {
get: function () {
return this._height;
},
set: function (value) {
this._height = value;
if (this._elRef) {
this._elRef.style.height = value;
this._treeMap.notifySizeChanged();
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "width", {
get: function () {
return this._width;
},
set: function (value) {
this._width = value;
if (this._elRef) {
this._elRef.style.height = value;
this._treeMap.notifySizeChanged();
}
},
enumerable: false,
configurable: true
});
IgrTreemap.prototype._getMainRef = function (ref) {
this._elRef = ref;
};
IgrTreemap.prototype._updateContentChildren = function () {
this.contentStyleMappings.length = 0;
var contentChildrenActual = this._contentChildrenManager.contentChildrenActual;
for (var i = 0; i < contentChildrenActual.length; i++) {
if ((TreemapNodeStyleMapping.$type).isAssignableFrom(contentChildrenActual[i].i.$type)) {
this.contentStyleMappings.push(contentChildrenActual[i]);
}
}
if (this._styleMappingsAdapter !== null) {
this._styleMappingsAdapter.notifyContentChanged();
}
};
Object.defineProperty(IgrTreemap.prototype, "styleMappings", {
/**
* A collection of manually added style mappings for the treemap.
*/
get: function () {
var _this = this;
if (this._styleMappings === null) {
var coll = new IgrTreemapNodeStyleMappingCollection();
var inner = coll._innerColl;
inner.addListener(function (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;
},
enumerable: false,
configurable: true
});
IgrTreemap.prototype.render = function () {
var children = this._contentChildrenManager.getChildren(this.props.children);
var div = React.createElement("div", {
className: "ig-treemap igr-treemap",
ref: this._getMainRef,
children: children
});
//}
return div;
};
IgrTreemap.prototype.shouldComponentUpdate = function (nextProps, nextState) {
var e_1, _a;
var mod = getModifiedProps(this.props, nextProps);
try {
for (var _b = __values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) {
var p = _c.value;
if (isValidProp(this, p)) {
this[p] = mod[p];
}
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
return true;
};
IgrTreemap.prototype.initializeProperties = function () {
var e_2, _a;
try {
for (var _b = __values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
var p = _c.value;
if (isValidProp(this, p)) {
this[p] = this.props[p];
}
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_2)
throw e_2.error;
}
}
};
// supports angular themes or custom properties set in CSS
IgrTreemap.prototype.updateStyle = function () {
this._styling(this._elRef, this);
};
IgrTreemap.prototype.destroy = function () {
this._treeMap.destroy();
this._wrapper.destroy();
};
IgrTreemap.prototype.componentWillUnmount = function () {
};
IgrTreemap.prototype.componentDidMount = function () {
this._elRef.style.width = this._width ? this._width : "";
this._elRef.style.height = this._height ? this._height : "";
this._elRef.appendChild(this._container);
this._treeMap.notifySizeChanged();
this.initializeContent();
};
IgrTreemap.prototype.initializeContent = function () {
this._styling(this._container, this);
if (this.actualStyleMappings && this.actualStyleMappings.length > 0) {
var currStyleMapping = this.actualStyleMappings;
for (var i = 0; i < currStyleMapping.length; i++) {
currStyleMapping[i]._styling(this._container, this, this);
}
}
this._updateContentChildren();
this.updateStyle();
this.i.notifySizeChanged();
};
IgrTreemap.prototype.createImplementation = function () {
return new Treemap();
};
Object.defineProperty(IgrTreemap.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "valueMemberPath", {
/**
* Gets or sets path to use to get the values from the items.
*/
get: function () {
return this.i.hx;
},
set: function (v) {
this.i.hx = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "rootTitle", {
/**
* Gets or sets the root title to use for breadcrumbs.
*/
get: function () {
return this.i.hn;
},
set: function (v) {
this.i.hn = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "breadcrumbSequence", {
/**
* Gets or sets the root title to use for breadcrumbs.
*/
get: function () {
return this.i.fh;
},
set: function (v) {
this.i.fh = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentIdMemberPath", {
/**
* Gets or sets the path to use to get the Parent of the items.
*/
get: function () {
return this.i.hb;
},
set: function (v) {
this.i.hb = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelMemberPath", {
/**
* Gets or sets the path to use to get the Label of the items.
*/
get: function () {
return this.i.gt;
},
set: function (v) {
this.i.gt = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "customValueMemberPath", {
/**
* Gets or sets the path to use to get the custom value of the items.
*/
get: function () {
return this.i.fk;
},
set: function (v) {
this.i.fk = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "idMemberPath", {
/**
* Gets or sets the path to use to get the id of the items.
*/
get: function () {
return this.i.gj;
},
set: function (v) {
this.i.gj = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "dataSource", {
/**
* Gets or sets the (possibly hierarchical) data to assign to the TreeMap.
*/
get: function () {
return this.i.dataSource;
},
set: function (v) {
this.i.dataSource = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "highlightedDataSource", {
/**
* Gets or sets the data to highlight.
*/
get: function () {
return this.i.highlightedDataSource;
},
set: function (v) {
this.i.highlightedDataSource = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "highlightedValueMemberPath", {
/**
* Gets or sets the highlighted value mapping property.
*/
get: function () {
return this.i.gb;
},
set: function (v) {
this.i.gb = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "highlightedValueOpacity", {
/**
* Gets or sets the opacity applied to the node underneath the highlighted value.
*/
get: function () {
return this.i.dt;
},
set: function (v) {
this.i.dt = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "highlightedValuesDisplayMode", {
/**
* Gets or sets the display mode for highlighted values.
*/
get: function () {
return this.i.l;
},
set: function (v) {
this.i.l = ensureEnum(TreemapHighlightedValueDisplayMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "fillBrushes", {
/**
* Gets or sets brushes to use for the fill scale.
*/
get: function () {
return fromBrushCollection(this.i.b);
},
set: function (v) {
this.i.b = toBrushCollection(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "fillScaleMode", {
/**
* Gets or sets mode to use for the fill scale.
*/
get: function () {
return this.i.d;
},
set: function (v) {
this.i.d = ensureEnum(TreemapFillScaleMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "isFillScaleLogarithmic", {
/**
* Gets or sets whether the fill scale is logarithmic.
*/
get: function () {
return this.i.bx;
},
set: function (v) {
this.i.bx = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "fillScaleLogarithmBase", {
/**
* Gets or sets the logarithm base to use if the fill scale is logarithmic.
*/
get: function () {
return this.i.ez;
},
set: function (v) {
this.i.ez = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "fillScaleMinimumValue", {
/**
* Gets or sets the minimum value to use for the fill scale.
*/
get: function () {
return this.i.dl;
},
set: function (v) {
this.i.dl = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "fillScaleMaximumValue", {
/**
* Gets or sets the maximum value to use for the fill scale.
*/
get: function () {
return this.i.dk;
},
set: function (v) {
this.i.dk = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelVerticalFitMode", {
/**
* Gets or sets the vertical fit mode to use for the node labels.
*/
get: function () {
return this.i.r;
},
set: function (v) {
this.i.r = ensureEnum(TreemapLabelVerticalFitMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelHorizontalFitMode", {
/**
* Gets or sets the horizontal fit mode to use for the node labels.
*/
get: function () {
return this.i.o;
},
set: function (v) {
this.i.o = ensureEnum(TreemapLabelHorizontalFitMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "overlayHeaderHoverBackground", {
/**
* Gets or sets the background to use for the overlay header when it is hovered.
*/
get: function () {
return brushToString(this.i.jx);
},
set: function (v) {
this.i.jx = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerHoverBackground", {
/**
* Gets or sets the background to use for the header when it is hovered.
*/
get: function () {
return brushToString(this.i.jr);
},
set: function (v) {
this.i.jr = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerBackground", {
/**
* Gets or sets the background to use for the header.
*/
get: function () {
return brushToString(this.i.jp);
},
set: function (v) {
this.i.jp = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "overlayHeaderBackground", {
/**
* Gets or sets the background to use for the overlay header.
*/
get: function () {
return brushToString(this.i.jw);
},
set: function (v) {
this.i.jw = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerTextColor", {
/**
* Gets or sets the text color to use for the header.
*/
get: function () {
return brushToString(this.i.ju);
},
set: function (v) {
this.i.ju = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerDarkTextColor", {
/**
* Gets or sets the dark text color to use for the header.
*/
get: function () {
return brushToString(this.i.jq);
},
set: function (v) {
this.i.jq = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "textColor", {
/**
* Gets or sets the text color to use for the nodes.
*/
get: function () {
return brushToString(this.i.j7);
},
set: function (v) {
this.i.j7 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "darkTextColor", {
/**
* Gets or sets the dark text color to use for the nodes.
*/
get: function () {
return brushToString(this.i.jo);
},
set: function (v) {
this.i.jo = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerHoverTextColor", {
/**
* Gets or sets the text color to use for the header.
*/
get: function () {
return brushToString(this.i.jt);
},
set: function (v) {
this.i.jt = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerHoverDarkTextColor", {
/**
* Gets or sets the dark text color to use for the header when hovered.
*/
get: function () {
return brushToString(this.i.js);
},
set: function (v) {
this.i.js = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "textStyle", {
/**
* Gets or sets the font to use for content nodes
*/
get: function () {
if (this.i.a8 == null) {
return null;
}
return this.i.a8.fontString;
},
set: function (v) {
var fi = new FontInfo();
fi.fontString = v;
this.i.a8 = fi;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerTextStyle", {
/**
* Gets or sets the font to use for header nodes
*/
get: function () {
if (this.i.a6 == null) {
return null;
}
return this.i.a6.fontString;
},
set: function (v) {
var fi = new FontInfo();
fi.fontString = v;
this.i.a6 = fi;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerDisplayMode", {
/**
* Gets or sets the font to use for header nodes
*/
get: function () {
return this.i.j;
},
set: function (v) {
this.i.j = ensureEnum(TreemapHeaderDisplayMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerLabelLeftMargin", {
/**
* Gets or sets the left margin to use for the header.
*/
get: function () {
return this.i.dq;
},
set: function (v) {
this.i.dq = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerLabelTopMargin", {
/**
* Gets or sets the top margin to use for the header.
*/
get: function () {
return this.i.ds;
},
set: function (v) {
this.i.ds = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerLabelRightMargin", {
/**
* Gets or sets the right margin to use for the header.
*/
get: function () {
return this.i.dr;
},
set: function (v) {
this.i.dr = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerLabelBottomMargin", {
/**
* Gets or sets the bottom margin to use for the header.
*/
get: function () {
return this.i.dp;
},
set: function (v) {
this.i.dp = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "overlayHeaderLabelLeftMargin", {
/**
* Gets or sets the left margin to use for the overlay header.
*/
get: function () {
return this.i.d3;
},
set: function (v) {
this.i.d3 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "overlayHeaderLabelTopMargin", {
/**
* Gets or sets the top margin to use for the overlay header.
*/
get: function () {
return this.i.d5;
},
set: function (v) {
this.i.d5 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "overlayHeaderLabelRightMargin", {
/**
* Gets or sets the right margin to use for the overlay header.
*/
get: function () {
return this.i.d4;
},
set: function (v) {
this.i.d4 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "overlayHeaderLabelBottomMargin", {
/**
* Gets or sets the bottom margin to use for the overlay header.
*/
get: function () {
return this.i.d2;
},
set: function (v) {
this.i.d2 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelLeftMargin", {
/**
* Gets or sets the left margin to use for the labels.
*/
get: function () {
return this.i.dx;
},
set: function (v) {
this.i.dx = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelTopMargin", {
/**
* Gets or sets the top margin to use for the labels.
*/
get: function () {
return this.i.dz;
},
set: function (v) {
this.i.dz = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelRightMargin", {
/**
* Gets or sets the right margin to use for the labels.
*/
get: function () {
return this.i.dy;
},
set: function (v) {
this.i.dy = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelBottomMargin", {
/**
* Gets or sets the bottom margin to use for the labels.
*/
get: function () {
return this.i.dw;
},
set: function (v) {
this.i.dw = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentNodeLeftMargin", {
/**
* Gets or sets the left margin to use for the parent nodes.
*/
get: function () {
return this.i.d8;
},
set: function (v) {
this.i.d8 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentNodeTopMargin", {
/**
* Gets or sets the top margin to use for the parent nodes.
*/
get: function () {
return this.i.ec;
},
set: function (v) {
this.i.ec = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentNodeRightMargin", {
/**
* Gets or sets the right margin to use for the parent nodes.
*/
get: function () {
return this.i.ea;
},
set: function (v) {
this.i.ea = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentNodeBottomMargin", {
/**
* Gets or sets the bottom margin to use for the parent nodes.
*/
get: function () {
return this.i.d6;
},
set: function (v) {
this.i.d6 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentNodeLeftPadding", {
/**
* Gets or sets the left padding to use for the parent nodes.
*/
get: function () {
return this.i.d9;
},
set: function (v) {
this.i.d9 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentNodeTopPadding", {
/**
* Gets or sets the top padding to use for the parent nodes.
*/
get: function () {
return this.i.ed;
},
set: function (v) {
this.i.ed = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentNodeRightPadding", {
/**
* Gets or sets the right padding to use for the parent nodes.
*/
get: function () {
return this.i.eb;
},
set: function (v) {
this.i.eb = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "parentNodeBottomPadding", {
/**
* Gets or sets the bottom padding to use for the parent nodes.
*/
get: function () {
return this.i.d7;
},
set: function (v) {
this.i.d7 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelHorizontalAlignment", {
/**
* Gets or sets the horizontal alignment to use for the node labels.
*/
get: function () {
return this.i.ja;
},
set: function (v) {
this.i.ja = ensureEnum(HorizontalAlignment_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "labelVerticalAlignment", {
/**
* Gets or sets the vertical alignment to use for the node labels.
*/
get: function () {
return this.i.kd;
},
set: function (v) {
this.i.kd = ensureEnum(VerticalAlignment_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "headerHeight", {
/**
* Gets or sets the height to use for the header.
*/
get: function () {
return this.i.dn;
},
set: function (v) {
this.i.dn = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "outline", {
/**
* Gets or sets the outline to use for the nodes.
*/
get: function () {
return brushToString(this.i.jv);
},
set: function (v) {
this.i.jv = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "strokeThickness", {
/**
* Gets or sets the stroke thickness to use for the node outline.
*/
get: function () {
return this.i.es;
},
set: function (v) {
this.i.es = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "nodeOpacity", {
/**
* Gets or sets the opacity to use for the nodes.
*/
get: function () {
return this.i.d1;
},
set: function (v) {
this.i.d1 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "layoutOrientation", {
/**
* Gets or sets the orientation to use for the stripped and slice and dice layout types.
*/
get: function () {
return this.i.al;
},
set: function (v) {
this.i.al = ensureEnum(TreemapOrientation_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "layoutType", {
/**
* Gets or sets the type of layout to use for the nodes.
*/
get: function () {
return this.i.u;
},
set: function (v) {
this.i.u = ensureEnum(TreemapLayoutType_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "minimumDisplaySize", {
/**
* Gets or sets the minimum size (width or height) to display a node.
*/
get: function () {
return this.i.d0;
},
set: function (v) {
this.i.d0 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "transitionDuration", {
/**
* Gets or sets the number of milliseconds over which changes to the gauge should be animated.
*/
get: function () {
return this.i.e3;
},
set: function (v) {
this.i.e3 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "pixelScalingRatio", {
/**
* 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: function () {
return this.i.ee;
},
set: function (v) {
this.i.ee = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "actualPixelScalingRatio", {
get: function () {
return this.i.dg;
},
set: function (v) {
this.i.dg = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "interactionPixelScalingRatio", {
/**
* 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: function () {
return this.i.dv;
},
set: function (v) {
this.i.dv = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "actualInteractionPixelScalingRatio", {
/**
* 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: function () {
return this.i.df;
},
set: function (v) {
this.i.df = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "highlightingTransitionDuration", {
/**
* Gets or sets the number of milliseconds over which the highlighting effect will render.
*/
get: function () {
return this.i.e1;
},
set: function (v) {
this.i.e1 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "highlightingMode", {
/**
* Gets or sets the highlighting mode to use.
*/
get: function () {
return this.i.aw;
},
set: function (v) {
this.i.aw = ensureEnum(TreemapHighlightingMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "actualHighlightingMode", {
/**
* Gets the actual highlighting mode used.
*/
get: function () {
return this.i.au;
},
set: function (v) {
this.i.au = ensureEnum(TreemapHighlightingMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "highlightingFadeOpacity", {
/**
* Gets or sets the opacity to use for nodes that are not highlighted when HighlightingMode is set to FadeOthers.
*/
get: function () {
return this.i.du;
},
set: function (v) {
this.i.du = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "animating", {
get: function () {
return this.i.bs;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "focusItem", {
/**
* Gets or sets the item to drill to in the treemap.
*/
get: function () {
return this.i.e5;
},
set: function (v) {
this.i.e5 = v;
},
enumerable: false,
configurable: true
});
IgrTreemap.prototype.findByName = function (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;
};
Object.defineProperty(IgrTreemap.prototype, "hasUserValues", {
get: function () {
return this._hasUserValues;
},
enumerable: false,
configurable: true
});
IgrTreemap.prototype.__m = function (propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
};
IgrTreemap.prototype._styling = function (container, component, parent) {
if (this._inStyling) {
return;
}
this._inStyling = true;
this._stylingContainer = container;
this._stylingParent = component;
var genericPrefix = "";
var typeName = this.i.$type.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
genericPrefix = toSpinal("Treemap");
var additionalPrefixes = [];
var prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
var 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);
}
var basePrefix = toSpinal(typeName);
additionalPrefixes.push(basePrefix + "-");
b = b.baseType;
}
if (parent) {
var parentTypeName = parent.i.$type.name;
if (parentTypeName.indexOf("Xam") === 0) {
parentTypeName = parentTypeName.substring(3);
}
var 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;
};
IgrTreemap.prototype.notifySizeChanged = function () {
this.i.notifySizeChanged();
};
/**
* Returns visuals as a serialized string.
*/
IgrTreemap.prototype.exportSerializedVisualData = function () {
var iv = this.i.fn();
return (iv);
};
IgrTreemap.prototype.markDirty = function () {
this.i.ic();
};
IgrTreemap.prototype.onDetachedFromUI = function () {
this.i.onDetachedFromUI();
};
IgrTreemap.prototype.onAttachedToUI = function () {
this.i.onAttachedToUI();
};
IgrTreemap.prototype.flush = function () {
this.i.h9();
};
IgrTreemap.prototype.notifySetItem = function (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.
*/
IgrTreemap.prototype.notifyClearItems = function (source_) {
this.i.ie(source_);
};
IgrTreemap.prototype.notifyInsertItem = function (source_, index, newItem) {
this.i.ig(source_, index, newItem);
};
IgrTreemap.prototype.notifyRemoveItem = function (source_, index, oldItem) {
this.i.ih(source_, index, oldItem);
};
IgrTreemap.prototype.simulateHover = function (point) {
this.i.i2(toPoint(point));
};
Object.defineProperty(IgrTreemap.prototype, "nodeStyling", {
/**
* Fired when a node is being styled. Provides an opportunity to customize node styling.
*/
get: function () {
return this._nodeStyling;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var outerArgs = new IgrTreemapNodeStylingEventArgs();
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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "nodeRenderStyling", {
/**
* Fired before a node is rendered for last minute style changes.
*/
get: function () {
return this._nodeRenderStyling;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var outerArgs = new IgrTreemapNodeStylingEventArgs();
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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "nodePointerOver", {
/**
* Fired with the pointer is moving over a node.
*/
get: function () {
return this._nodePointerOver;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var outerArgs = new IgrTreemapNodePointerEventArgs();
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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "nodePointerEnter", {
/**
* Fired when the pointer enters a node.
*/
get: function () {
return this._nodePointerEnter;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var outerArgs = new IgrTreemapNodePointerEventArgs();
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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTreemap.prototype, "nodePointerLeave", {
/**
* Fired when the pointer leaved a node.
*/
get: function () {
return this._nodePointerLeave;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var outerArgs = new IgrTreemapNodePointerEventArgs();
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);
;
},
enumerable: false,
configurable: true
});