Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Used for exporting and importing properties between backend models. An object that exports to | ||
* ExportFormat should put dimensions and measures inside one data group. If an object has two hypercubes | ||
* each of the cubes should export dimensions and measures in two separate data groups. | ||
* An object that imports from this structure is responsible for putting the existing properties where they should be | ||
* in the new model. | ||
* @interface ExportFormat | ||
* @ignore | ||
* @property {(ExportDataDef[])=} data | ||
* @property {object=} properties | ||
*/ | ||
|
||
/** | ||
* @ignore | ||
* @interface ExportDataDef | ||
* @property {qae.NxDimension[]} dimensions | ||
* @property {qae.NxMeasure[]} measures | ||
* @property {qae.NxDimension[]} excludedDimensions | ||
* @property {qae.NxMeasure[]} excludedMeasures | ||
* @property {number[]} interColumnSortOrder | ||
*/ | ||
|
||
/** | ||
* @ignore | ||
* @param {number} nDataGroups | ||
* @return {ExportFormat} | ||
*/ | ||
function createExportFormat(nDataGroups = 1) { | ||
const exportFormat = { | ||
data: [], | ||
properties: {}, | ||
}; | ||
|
||
for (let i = 0; i < nDataGroups; ++i) { | ||
exportFormat.data.push({ | ||
dimensions: [], | ||
measures: [], | ||
excludedDimensions: [], | ||
excludedMeasures: [], | ||
interColumnSortOrder: [], | ||
}); | ||
} | ||
return exportFormat; | ||
} | ||
|
||
export default createExportFormat; |