devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
31 lines (30 loc) • 1.14 kB
JavaScript
/**
* DevExtreme (cjs/viz/funnel/tiling.funnel.js)
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
exports.default = void 0;
const CENTER = .5;
var _default = exports.default = {
getFigures: function(data) {
const height = 1 / data.length;
return data.map((function(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: function(items) {
const max = items.reduce((function(max, item) {
return Math.max(item.value, max)
}), items[0] && items[0].value || 0);
return items.map((function(item) {
return item.value / max
}))
}
};
module.exports = exports.default;
module.exports.default = exports.default;