mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 17:58:43 -05:00
13 lines
362 B
JavaScript
13 lines
362 B
JavaScript
import { insertMainDimension } from './hypercube-utils';
|
|
|
|
export default function addMainDimension(self, dimension, index) {
|
|
const dimensions = self.getDimensions();
|
|
const idx = index ?? dimensions.length;
|
|
|
|
if (dimensions.length < self.maxDimensions()) {
|
|
return insertMainDimension(self, dimension, dimensions, idx);
|
|
}
|
|
|
|
return Promise.resolve();
|
|
}
|