* If normal array used, mutable chunk size is supported. * If typed array used, chunk size must be fixed.
(source, dimSize)
| 23091 | * If typed array used, chunk size must be fixed. |
| 23092 | */ |
| 23093 | function DefaultDataProvider(source, dimSize) { |
| 23094 | if (!Source.isInstance(source)) { |
| 23095 | source = Source.seriesDataToSource(source); |
| 23096 | } |
| 23097 | this._source = source; |
| 23098 | |
| 23099 | var data = this._data = source.data; |
| 23100 | var sourceFormat = source.sourceFormat; |
| 23101 | |
| 23102 | // Typed array. TODO IE10+? |
| 23103 | if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { |
| 23104 | if (__DEV__) { |
| 23105 | if (dimSize == null) { |
| 23106 | throw new Error('Typed array data must specify dimension size'); |
| 23107 | } |
| 23108 | } |
| 23109 | this._offset = 0; |
| 23110 | this._dimSize = dimSize; |
| 23111 | this._data = data; |
| 23112 | } |
| 23113 | |
| 23114 | var methods = providerMethods[ |
| 23115 | sourceFormat === SOURCE_FORMAT_ARRAY_ROWS |
| 23116 | ? sourceFormat + '_' + source.seriesLayoutBy |
| 23117 | : sourceFormat |
| 23118 | ]; |
| 23119 | |
| 23120 | if (__DEV__) { |
| 23121 | assert$1(methods, 'Invalide sourceFormat: ' + sourceFormat); |
| 23122 | } |
| 23123 | |
| 23124 | extend(this, methods); |
| 23125 | } |
| 23126 | |
| 23127 | var providerProto = DefaultDataProvider.prototype; |
| 23128 | // If data is pure without style configuration |