MCPcopy
hub / github.com/tdewolff/minify / dataStack

Function dataStack

_benchmarks/sample_echarts.js:19676–19705  ·  view source on GitHub ↗
(ecModel)

Source from the content-addressed store, hash-verified

19674 // Should be executed after series filtered and before stack calculation.
19675
19676 function dataStack(ecModel) {
19677 var stackInfoMap = createHashMap();
19678 ecModel.eachSeries(function (seriesModel) {
19679 var stack = seriesModel.get('stack'); // Compatibal: when `stack` is set as '', do not stack.
19680
19681 if (stack) {
19682 var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);
19683 var data = seriesModel.getData();
19684 var stackInfo = {
19685 // Used for calculate axis extent automatically.
19686 // TODO: Type getCalculationInfo return more specific type?
19687 stackResultDimension: data.getCalculationInfo('stackResultDimension'),
19688 stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),
19689 stackedDimension: data.getCalculationInfo('stackedDimension'),
19690 stackedByDimension: data.getCalculationInfo('stackedByDimension'),
19691 isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),
19692 data: data,
19693 seriesModel: seriesModel
19694 }; // If stacked on axis that do not support data stack.
19695
19696 if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {
19697 return;
19698 }
19699
19700 stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);
19701 stackInfoList.push(stackInfo);
19702 }
19703 });
19704 stackInfoMap.each(calculateStack);
19705 }
19706
19707 function calculateStack(stackInfoList) {
19708 each(stackInfoList, function (targetStackInfo, idxInStack) {

Callers

nothing calls this directly

Calls 1

createHashMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…