(sourceParam: Source | OptionSourceData, dimSize?: number)
| 105 | |
| 106 | |
| 107 | constructor(sourceParam: Source | OptionSourceData, dimSize?: number) { |
| 108 | // let source: Source; |
| 109 | const source: Source = !isSourceInstance(sourceParam) |
| 110 | ? createSourceFromSeriesDataOption(sourceParam as OptionSourceData) |
| 111 | : sourceParam as Source; |
| 112 | |
| 113 | // declare source is Source; |
| 114 | this._source = source; |
| 115 | const data = this._data = source.data; |
| 116 | const sourceFormat = source.sourceFormat; |
| 117 | const seriesLayoutBy = source.seriesLayoutBy; |
| 118 | |
| 119 | // Typed array. TODO IE10+? |
| 120 | if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { |
| 121 | if (__DEV__) { |
| 122 | if (dimSize == null) { |
| 123 | throw new Error('Typed array data must specify dimension size'); |
| 124 | } |
| 125 | } |
| 126 | this._offset = 0; |
| 127 | this._dimSize = dimSize; |
| 128 | this._data = data; |
| 129 | } |
| 130 | |
| 131 | if (__DEV__) { |
| 132 | const validator = rawSourceDataValidatorMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; |
| 133 | validator && validator(data, source.dimensionsDefine); |
| 134 | } |
| 135 | |
| 136 | mountMethods(this, data, source); |
| 137 | } |
| 138 | |
| 139 | getSource(): Source { |
| 140 | return this._source; |
nothing calls this directly
no test coverage detected