devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
28 lines (27 loc) • 1.04 kB
JavaScript
/**
* DevExtreme (cjs/__internal/viz/funnel/tiling.funnel.js)
* Version: 25.2.5
* Build date: Fri Feb 20 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const CENTER = .5;
var _default = exports.default = {
getFigures(data) {
const height = 1 / data.length;
return data.map(((value, index, array) => {
const nextValue = array[index + 1] ? array[index + 1] : array[index];
return [.5 - value / 2, height * index, .5 + value / 2, height * index, .5 + nextValue / 2, height * (index + 1), .5 - nextValue / 2, height * (index + 1)]
}))
},
normalizeValues(items) {
const max = items.reduce(((max, item) => Math.max(item.value, max)), items[0] && items[0].value || 0);
return items.map((item => item.value / max))
}
};