(upstream: Source)
| 274 | } |
| 275 | |
| 276 | function cloneRawData(upstream: Source): Source['data'] { |
| 277 | const sourceFormat = upstream.sourceFormat; |
| 278 | const data = upstream.data; |
| 279 | |
| 280 | if (!isSupportedSourceFormat(sourceFormat)) { |
| 281 | let errMsg = ''; |
| 282 | if (__DEV__) { |
| 283 | errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat; |
| 284 | } |
| 285 | throwError(errMsg); |
| 286 | } |
| 287 | |
| 288 | if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { |
| 289 | const result = []; |
| 290 | for (let i = 0, len = data.length; i < len; i++) { |
| 291 | // Not strictly clone for performance |
| 292 | result.push((data as OptionSourceDataArrayRows)[i].slice()); |
| 293 | } |
| 294 | return result; |
| 295 | } |
| 296 | else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { |
| 297 | const result = []; |
| 298 | for (let i = 0, len = data.length; i < len; i++) { |
| 299 | // Not strictly clone for performance |
| 300 | result.push(extend({}, (data as OptionSourceDataObjectRows)[i])); |
| 301 | } |
| 302 | return result; |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | function getDimensionInfo( |
| 307 | dimensions: ExternalDimensionDefinition[], |
nothing calls this directly
no test coverage detected
searching dependent graphs…