100pah commented on a change in pull request #13339:
URL: 
https://github.com/apache/incubator-echarts/pull/13339#discussion_r494795805



##########
File path: src/data/List.ts
##########
@@ -611,92 +593,90 @@ class List<
                 this._idDimIdx = i;
             }
 
-            if (!storage[dim]) {
-                const store: DataValueChunk[] = [];
-                storage[dim] = store;
-                storageArr.push(store);
-            }
-
-            prepareChunks(storage, dimInfo, chunkSize, originalChunkCount, 
end);
-
-            this._chunkCount = storage[dim].length;
+            prepareStorage(storage, dimInfo, end, append);
         }
 
-        const rawExtentArr = zrUtil.map(dimensions, (dim) => {
-            return rawExtent[dim];
+        const storageArr = this._storageArr = map(dimensions, (dim) => {
+            return storage[dim];
         });
 
-        let dataItem = [] as OptionDataItem;
-        for (let idx = start; idx < end; idx++) {
-            // NOTICE: Try not to write things into dataItem
-            dataItem = rawData.getItem(idx, dataItem);
-            // Each data item is value
-            // [1, 2]
-            // 2
-            // Bar chart, line chart which uses category axis
-            // only gives the 'y' value. 'x' value is the indices of category
-            // Use a tempValue to normalize the value to be a (x, y) value
-            const chunkIndex = mathFloor(idx / chunkSize);
-            const chunkOffset = idx % chunkSize;
-
-            // Store the data by dimensions
-            for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) {
-                const dim = dimensions[dimIdx];
-                const dimStorage = storageArr[dimIdx][chunkIndex];
-                // PENDING NULL is empty or zero
-                const val = this._dimValueGetter(dataItem, dim, idx, dimIdx) 
as ParsedValueNumeric;
-                dimStorage[chunkOffset] = val;
+        const rawExtentArr = map(dimensions, (dim) => {
+            return rawExtent[dim];
+        });
 
-                const dimRawExtent = rawExtentArr[dimIdx];
-                val < dimRawExtent[0] && (dimRawExtent[0] = val);
-                val > dimRawExtent[1] && (dimRawExtent[1] = val);
-            }
+        if (rawData.getStorage) {

Review comment:
       It might make readers confused when named as `getStorage`. 
   Because the storage is created by `List` rather than `rawData` and already 
has value in it.
   Probably it's better to name it as `fillStorage`?
   

##########
File path: src/data/List.ts
##########
@@ -213,7 +213,7 @@ class List<
     private _count: number = 0;
     private _rawCount: number = 0;
     private _storage: DataStorage = {};
-    private _storageArr: DataValueChunk[][] = [];

Review comment:
       It's would be great if making comment about:
   why using _strorageArr (like "optimize xxx")




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to