* @caution Only used in dataStack.
(dimName: DimensionName, type: DataStoreDimensionType)
| 252 | * @caution Only used in dataStack. |
| 253 | */ |
| 254 | ensureCalculationDimension(dimName: DimensionName, type: DataStoreDimensionType): DimensionIndex { |
| 255 | const calcDimNameToIdx = this._calcDimNameToIdx; |
| 256 | const dimensions = this._dimensions; |
| 257 | |
| 258 | let calcDimIdx = calcDimNameToIdx.get(dimName); |
| 259 | if (calcDimIdx != null) { |
| 260 | if (dimensions[calcDimIdx].type === type) { |
| 261 | return calcDimIdx; |
| 262 | } |
| 263 | } |
| 264 | else { |
| 265 | calcDimIdx = dimensions.length; |
| 266 | } |
| 267 | |
| 268 | dimensions[calcDimIdx] = { type: type }; |
| 269 | calcDimNameToIdx.set(dimName, calcDimIdx); |
| 270 | |
| 271 | this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount); |
| 272 | this._rawExtent[calcDimIdx] = initExtentForUnion(); |
| 273 | |
| 274 | return calcDimIdx; |
| 275 | } |
| 276 | |
| 277 | collectOrdinalMeta( |
| 278 | dimIdx: number, |
no test coverage detected