{"version":3,"sources":["webpack:///./node_modules/echarts/lib/extension.js","webpack:///./node_modules/echarts/lib/data/helper/sourceHelper.js","webpack:///./node_modules/echarts/lib/data/helper/dataValueHelper.js","webpack:///./node_modules/echarts/lib/data/List.js","webpack:///./node_modules/echarts/lib/data/helper/dataStackHelper.js","webpack:///./node_modules/echarts/lib/data/OrdinalMeta.js","webpack:///./node_modules/echarts/lib/data/helper/transform.js","webpack:///./node_modules/echarts/lib/data/helper/dimensionHelper.js","webpack:///./node_modules/echarts/lib/data/helper/completeDimensions.js","webpack:///./node_modules/echarts/lib/data/helper/createDimensions.js","webpack:///./node_modules/echarts/lib/data/helper/sourceManager.js","webpack:///./node_modules/echarts/lib/data/Graph.js","webpack:///./node_modules/echarts/lib/data/helper/linkList.js","webpack:///./node_modules/echarts/lib/data/Source.js","webpack:///./node_modules/echarts/lib/data/helper/dataProvider.js"],"names":["extensions","extensionRegisters","registerPreprocessor","registerProcessor","registerPostInit","registerPostUpdate","registerAction","registerCoordinateSystem","registerLayout","registerVisual","registerTransform","registerLoading","registerMap","PRIORITY","ComponentModel","ComponentView","SeriesModel","ChartView","registerComponentModel","ComponentModelClass","registerClass","registerComponentView","ComponentViewClass","registerSeriesModel","SeriesModelClass","registerChartView","ChartViewClass","registerSubTypeDefaulter","componentType","defaulter","registerPainter","painterType","PainterCtor","use","ext","singleExt","push","install","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","ecModel","datasetMap","makeSeriesEncodeForAxisCoordSys","coordDimensions","seriesModel","source","encode","datasetModel","querySeriesUpstreamDatasetModel","baseCategoryDimIndex","categoryWayValueDimStart","encodeItemName","encodeSeriesName","key","uid","seriesLayoutBy","slice","coordDimInfoLoose","coordDimIdx","coordDimInfo","name","type","getDataDimCountOnCoordDim","datasetRecord","get","set","categoryWayDim","valueWayDim","pushDim","dimIdxArr","idxFrom","idxCount","i","dimsDef","length","coordDimName","count","start","itemName","seriesName","index","id","models","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","doGuessOrdinal","data","sourceFormat","dimensionsDefine","startIndex","result","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","item","dataKeyedColumns","dataOriginal","val","beStr","isFinite","parseDataValue","value","opt","ordinalMeta","parseAndCollect","NaN","parseFloat","ORDER_COMPARISON_OP_MAP","lt","lval","rval","lte","gt","gte","SortOrderComparator","FilterOrderComparator","op","this","_opFn","_rvalFloat","prototype","evaluate","order","incomparable","isDesc","_resultLT","_incomparable","Infinity","lvalTypeof","rvalTypeof","lvalFloat","rvalFloat","lvalNotNumeric","isNaN","rvalNotNumeric","lvalIsStr","rvalIsStr","FilterEqualityComparator","isEq","_rval","_isEQ","_rvalTypeof","eqResult","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getId","getIdNameFromStore","makeIdFromName","normalizeDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","mathFloor","Math","floor","isObject","map","dataCtors","Float64Array","Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","List","dimensions","hostModel","_count","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","hasItemOption","TRANSFERABLE_METHODS","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","getRawIndex","dimensionInfos","dimensionNames","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","coordDim","coordDimIndex","otherDims","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","userOutput","getDimension","dim","hasOwnProperty","getDimensionInfo","getDimensionsOnCoord","dataDimsOnCoord","mapDimension","idx","dimensionsSummary","encodeFirstDimNotExtra","dims","mapDimensionsAll","initData","nameList","dimValueGetter","provider","_rawData","getSource","_indices","_dontMakeIdFromName","fillStorage","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","pure","getProvider","appendData","rawData","end","persistent","appendValues","values","names","storage","dimLen","rawExtent","max","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dataItem","getItem","dimStorage","clean","getIndices","newIndices","indices","Ctor","constructor","thisCount","buffer","getByDimIdx","dimStore","getByRawIndex","rawIdx","getValues","len","hasValue","getDataExtent","dimData","initialExtent","dimExtent","currEnd","min","getApproximateExtent","setApproximateExtent","extent","getCalculationInfo","setCalculationInfo","getSum","sum","getMedian","dimDataArray","each","sortedDimDataArray","sort","a","b","rawIndexOf","rawIndex","indexOfName","getName","indexOfRawIndex","rawDataIndex","left","right","mid","indicesOfNearest","maxDistance","nearestIndices","minDist","minDiff","nearestIndicesLen","diff","dist","abs","getRawDataItem","cb","ctx","ctxCompat","_this","fCtx","dimNames","dimSize","dimIndices","call","k","apply","filterSelf","offset","dim0","keep","selectRange","range","originalCount","quickFinished","dimStorage2","min2","max2","val2","dimk","mapArray","arguments","list","tmpRetValue","dataCount","dataIndex","retValue","rawExtentOnDim","downSample","dimension","rate","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","dataIdx","sampleFrameIdx","lttbDownSample","valueDimension","maxArea","area","nextRawIndex","sampledIndex","currentRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","y","frameStart","frameEnd","pointAX","pointAY","getItemModel","otherList","thisList","getVisual","visual","setVisual","kvObj","getItemVisual","itemVisual","hasItemVisual","ensureUniqueItemVisual","itemVisuals","setItemVisual","clearAllVisual","setLayout","name_1","getLayout","getItemLayout","setItemLayout","layout","merge","clearItemLayouts","setItemGraphicEl","el","ecData","dataType","seriesIndex","traverse","getItemGraphicEl","eachItemGraphicEl","context","cloneShallow","wrapMethod","methodName","injectFunction","originalMethod","__wrappedMethods","res","concat","internalField","getDimValueSimply","objectRows","keyedColumns","original","typedArray","invertedIndices","categories","chunk","dimInfo","DataCtor","oldStore","oldLen","newStore","j","console","error","excludeDimensions","allDimensions","originalChunk","originalStorage","child","childECData","thisECData","target","propName","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","enableDataStack","dimensionInfoList","stackedByDimInfo","stackedDimInfo","stackResultDimension","stackedOverDimension","byIndex","stackedCoordDimension","mayStack","isExtraCoord","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","stackedDimension","stackedByDimension","isStackedByIndex","isDimensionStacked","stackedDim","getStackedDimension","targetDim","OrdinalMeta","_needCollect","needCollect","_deduplication","deduplication","createByAxisModel","axisModel","option","dedplication","getOrdinal","category","_getOrCreateMap","_map","obj","ExternalSource","getRawData","Error","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","upstream","isSupportedSourceFormat","dimsByName","externalTransformMap","registerExternalTransform","externalTransform","typeParsed","split","isBuiltIn","__isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","applySingleDataTransform","transOption","upSourceList","pipeIndex","transType","extUpSourceList","upSource","internalSource","extSource","sourceHeaderCount","dimDef","dimDefExt","displayName","dimensionsDetectedCount","rawItemGetter","rawCounter","rawValueGetter","rawItem","createExternalSource","resultList","transform","upstreamList","config","resultIndex","resultMetaRawOption","firstUpSource","sourceHeader","metaRawOption","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","dimItem","getOrCreateEncodeArr","defaultTooltip","v","otherDim","encodeArr","dimArr","encodeLabel","label","encodeTooltip","tooltip","getDimensionTypeByAxis","axisType","genName","fromZero","sysDims","dataDimNameMap","coordDimNameMap","dimCount","optDimCount","sysDimItem","sysDimItemDimsDef","getDimCount","dimDefItemRaw","userDimName","resultItem","DataDimensionInfo","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","dataDims","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemOtherDims","sysDimItemDimsDefItem","generateCoord","generateCoordCount","extra","createDimensions","encodeDefine","dimensionsCount","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","dirty","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","resultSourceList","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","isSeries","upSourceMgr","newMetaRawOption","_getSourceMetaRawOption","upMetaRawOption","_applyTransform","sourceData","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","datasetIndex","componentIndex","upSrcMgr","sourceIndex","getSourceManager","model","mainType","errMsg","generateNodeKey","Graph","directed","nodes","edges","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","node","GraphNode","hostGraph","getNodeByIndex","getNodeById","addEdge","n1","n2","edgesMap","edge","GraphEdge","outEdges","inEdges","getEdgeByIndex","edgeData","getEdge","eachNode","eachEdge","node1","node2","breadthFirstTraverse","startNode","direction","edgeType","__visited","queue","currentNode","shift","e","otherNode","update","clone","graph","degree","inDegree","outDegree","getModel","path","getAdjacentDataIndices","dataIndices","adjacentEdge","createGraphDataProxyMixin","hostName","dataName","getValue","getGraphicEl","inner","transferInjection","mainData","datas","linkAll","linkSingle","changeInjection","struct","cloneShallowInjection","getLinkedData","getLinkedDataAll","structAttr","datasAttr","main","SourceImpl","fields","isSourceInstance","createSource","thisMetaRawOption","detectSourceFormat","determined","normalizeDimensionsOption","arrayRowsTravelFirst","firstIndex","dimensions_1","objectRowsCollectDimensions","colArr","value0","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","nameMap","exist","maxLoop","_a","_b","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","_source","_data","_offset","_dimSize","proto","out","newData","protoInitialize","methods","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorageForTypedArray","getRawSourceItemGetter","getRawSourceDataCounter","arr","appendDataSimply","newCol","oldCol","getItemSimply","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue"],"mappings":"8LAkDIA,EAAa,GACbC,EAAqB,CACvBC,qBAAsB,IACtBC,kBAAmB,IACnBC,iBAAkB,IAClBC,mBAAoB,IACpBC,eAAgB,IAChBC,yBAA0B,IAC1BC,eAAgB,IAChBC,eAAgB,IAChBC,kBAAmB,IACnBC,gBAAiB,IACjBC,YAAa,IACbC,SAAU,IACVC,eAAgB,IAChBC,cAAe,IACfC,YAAa,IACbC,UAAW,IAEXC,uBAAwB,SAAUC,GAChC,IAAeC,cAAcD,IAE/BE,sBAAuB,SAAUC,GAC/B,IAAcF,cAAcE,IAE9BC,oBAAqB,SAAUC,GAC7B,IAAYJ,cAAcI,IAE5BC,kBAAmB,SAAUC,GAC3B,IAAUN,cAAcM,IAE1BC,yBAA0B,SAAUC,EAAeC,GACjD,IAAeF,yBAAyBC,EAAeC,IAEzDC,gBAAiB,SAAUC,EAAaC,GACtC,YAAgBD,EAAaC,KAG1B,SAASC,IAAIC,GACd,YAAQA,GAEV,YAAKA,GAAK,SAAUC,GAClBF,IAAIE,MAKJ,YAAQnC,EAAYkC,IAAQ,IAIhClC,EAAWoC,KAAKF,GAEZ,YAAWA,KACbA,EAAM,CACJG,QAASH,IAIbA,EAAIG,QAAQpC,M,sQC9DHqC,EAAa,CACtBC,KAAM,EACNC,MAAO,EACPC,IAAK,GAGHC,EAAmB,cAKhB,SAASC,EAAqBC,GAEnCF,EAAiBE,GAASC,WAAa,cAkBlC,SAASC,EAAgCC,EAAiBC,EAAaC,QAC5E,IAAIC,EAAS,GACTC,EAAeC,EAAgCJ,GAEnD,IAAKG,IAAiBJ,EACpB,OAAOG,EAGT,IAKIG,EACAC,EANAC,EAAiB,GACjBC,EAAmB,GACnBZ,EAAUI,EAAYJ,QACtBC,EAAaH,EAAiBE,GAASC,WACvCY,EA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sB,aAAiB+D,MAAiB/D,EAAMtB,GAAdsB,GACtD0mB,EAAG,KAA6B6B,EAAmB7B,GAC/C,SAAS+B,EAAwB5pB,GAOtC,OANa2pB,EAAwB3pB,GASvC,SAAS2oB,EAAgB3oB,EAAcjC,GACrC,OAAOiC,IAAiB,IAA2BA,EAAe,IAAMjC,EAAiBiC,EAUpF,SAAS6pB,EAAiB9pB,KAAM8Q,EAAWvI,GAGhD,GAAKvI,KAAL,CAKA,IAAIwL,EAAWxL,KAAKgP,eAAe8B,GAEnC,GAAgB,MAAZtF,EAAJ,CAIA,IACInL,EACAP,EAFAG,EAAeD,KAAKkK,cAAcX,YAAYtJ,aAG9C0V,EAAU3V,KAAKyI,iBAAiBF,GAOpC,OALIoN,IACFtV,EAAUsV,EAAQtX,KAClByB,EAAW6V,EAAQlW,OAGdoqB,EAAwB5pB,EAAxB4pB,CAAsCre,EAAU1L,EAAUO","file":"vendors~app~eb9222fc.js","sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { registerPreprocessor, registerProcessor, registerPostInit, registerPostUpdate, registerAction, registerCoordinateSystem, registerLayout, registerVisual, registerTransform, registerLoading, registerMap, PRIORITY } from './core/echarts';\nimport ComponentView from './view/Component';\nimport ChartView from './view/Chart';\nimport ComponentModel from './model/Component';\nimport SeriesModel from './model/Series';\nimport { isFunction, indexOf, isArray, each } from 'zrender/lib/core/util';\nimport { registerPainter } from 'zrender/lib/zrender';\nvar extensions = [];\nvar extensionRegisters = {\n registerPreprocessor: registerPreprocessor,\n registerProcessor: registerProcessor,\n registerPostInit: registerPostInit,\n registerPostUpdate: registerPostUpdate,\n registerAction: registerAction,\n registerCoordinateSystem: registerCoordinateSystem,\n registerLayout: registerLayout,\n registerVisual: registerVisual,\n registerTransform: registerTransform,\n registerLoading: registerLoading,\n registerMap: registerMap,\n PRIORITY: PRIORITY,\n ComponentModel: ComponentModel,\n ComponentView: ComponentView,\n SeriesModel: SeriesModel,\n ChartView: ChartView,\n // TODO Use ComponentModel and SeriesModel instead of Constructor\n registerComponentModel: function (ComponentModelClass) {\n ComponentModel.registerClass(ComponentModelClass);\n },\n registerComponentView: function (ComponentViewClass) {\n ComponentView.registerClass(ComponentViewClass);\n },\n registerSeriesModel: function (SeriesModelClass) {\n SeriesModel.registerClass(SeriesModelClass);\n },\n registerChartView: function (ChartViewClass) {\n ChartView.registerClass(ChartViewClass);\n },\n registerSubTypeDefaulter: function (componentType, defaulter) {\n ComponentModel.registerSubTypeDefaulter(componentType, defaulter);\n },\n registerPainter: function (painterType, PainterCtor) {\n registerPainter(painterType, PainterCtor);\n }\n};\nexport function use(ext) {\n if (isArray(ext)) {\n // use([ChartLine, ChartBar]);\n each(ext, function (singleExt) {\n use(singleExt);\n });\n return;\n }\n\n if (indexOf(extensions, ext) >= 0) {\n return;\n }\n\n extensions.push(ext);\n\n if (isFunction(ext)) {\n ext = {\n install: ext\n };\n }\n\n ext.install(extensionRegisters);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, getDataItemValue, queryReferringComponents, SINGLE_REFERRING } from '../../util/model';\nimport { createHashMap, each, isArray, isString, isObject, isTypedArray } from 'zrender/lib/core/util';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW, SOURCE_FORMAT_KEYED_COLUMNS } from '../../util/types'; // The result of `guessOrdinal`.\n\nexport var BE_ORDINAL = {\n Must: 1,\n Might: 2,\n Not: 3 // Other cases\n\n};\nvar innerGlobalModel = makeInner();\n/**\n * MUST be called before mergeOption of all series.\n */\n\nexport function resetSourceDefaulter(ecModel) {\n // `datasetMap` is used to make default encode.\n innerGlobalModel(ecModel).datasetMap = createHashMap();\n}\n/**\n * [The strategy of the arrengment of data dimensions for dataset]:\n * \"value way\": all axes are non-category axes. So series one by one take\n * several (the number is coordSysDims.length) dimensions from dataset.\n * The result of data arrengment of data dimensions like:\n * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |\n * \"category way\": at least one axis is category axis. So the the first data\n * dimension is always mapped to the first category axis and shared by\n * all of the series. The other data dimensions are taken by series like\n * \"value way\" does.\n * The result of data arrengment of data dimensions like:\n * | ser_shared_x | ser0_y | ser1_y | ser2_y |\n *\n * @return encode Never be `null/undefined`.\n */\n\nexport function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when mutiple series share one dimension\n // category axis, series name should better use\n // the other dimsion name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}\n/**\n * Work for data like [{name: ..., value: ...}, ...].\n *\n * @return encode Never be `null/undefined`.\n */\n\nexport function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel) {\n return encode;\n }\n\n var sourceFormat = source.sourceFormat;\n var dimensionsDefine = source.dimensionsDefine;\n var potentialNameDimIndex;\n\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n\n var idxResult = function () {\n var idxRes0 = {};\n var idxRes1 = {};\n var guessRecords = []; // 5 is an experience value.\n\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\n guessRecords.push(guessResult);\n var isPureNumber = guessResult === BE_ORDINAL.Not; // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,\n // and then find a name dim with the priority:\n // \"BE_ORDINAL.Might|BE_ORDINAL.Must\" > \"other dim\" > \"the value dim itself\".\n\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\n idxRes0.v = i;\n }\n\n if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) {\n idxRes0.n = i;\n }\n\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\n return idxRes0;\n } // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),\n // find the first BE_ORDINAL.Might as the value dim,\n // and then find a name dim with the priority:\n // \"other dim\" > \"the value dim itself\".\n // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be\n // treated as number.\n\n\n if (!isPureNumber) {\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\n idxRes1.v = i;\n }\n\n if (idxRes1.n == null || idxRes1.n === idxRes1.v) {\n idxRes1.n = i;\n }\n }\n }\n\n function fulfilled(idxResult) {\n return idxResult.v != null && idxResult.n != null;\n }\n\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\n }();\n\n if (idxResult) {\n encode.value = [idxResult.v]; // `potentialNameDimIndex` has highest priority.\n\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; // By default, label use itemName in charts.\n // So we dont set encodeLabel here.\n\n encode.itemName = [nameDimIndex];\n encode.seriesName = [nameDimIndex];\n }\n\n return encode;\n}\n/**\n * @return If return null/undefined, indicate that should not use datasetModel.\n */\n\nexport function querySeriesUpstreamDatasetModel(seriesModel) {\n // Caution: consider the scenario:\n // A dataset is declared and a series is not expected to use the dataset,\n // and at the beginning `setOption({series: { noData })` (just prepare other\n // option but no data), then `setOption({series: {data: [...]}); In this case,\n // the user should set an empty array to avoid that dataset is used by default.\n var thisData = seriesModel.get('data', true);\n\n if (!thisData) {\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\n index: seriesModel.get('datasetIndex', true),\n id: seriesModel.get('datasetId', true)\n }, SINGLE_REFERRING).models[0];\n }\n}\n/**\n * @return Always return an array event empty.\n */\n\nexport function queryDatasetUpstreamDatasetModels(datasetModel) {\n // Only these attributes declared, we by defualt reference to `datasetIndex: 0`.\n // Otherwise, no reference.\n if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) {\n return [];\n }\n\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\n index: datasetModel.get('fromDatasetIndex', true),\n id: datasetModel.get('fromDatasetId', true)\n }, SINGLE_REFERRING).models;\n}\n/**\n * The rule should not be complex, otherwise user might not\n * be able to known where the data is wrong.\n * The code is ugly, but how to make it neat?\n */\n\nexport function guessOrdinal(source, dimIndex) {\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\n} // dimIndex may be overflow source data.\n// return {BE_ORDINAL}\n\nfunction doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\n var result; // Experience value.\n\n var maxLoop = 5;\n\n if (isTypedArray(data)) {\n return BE_ORDINAL.Not;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n var dimType;\n\n if (dimensionsDefine) {\n var dimDefItem = dimensionsDefine[dimIndex];\n\n if (isObject(dimDefItem)) {\n dimName = dimDefItem.name;\n dimType = dimDefItem.type;\n } else if (isString(dimDefItem)) {\n dimName = dimDefItem;\n }\n }\n\n if (dimType != null) {\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data;\n\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n var sample = dataArrayRows[dimIndex];\n\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\n if ((result = detectValue(sample[startIndex + i])) != null) {\n return result;\n }\n }\n } else {\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\n var row = dataArrayRows[startIndex + i];\n\n if (row && (result = detectValue(row[dimIndex])) != null) {\n return result;\n }\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n var dataObjectRows = data;\n\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\n var item = dataObjectRows[i];\n\n if (item && (result = detectValue(item[dimName])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n var dataKeyedColumns = data;\n\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n var sample = dataKeyedColumns[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return BE_ORDINAL.Not;\n }\n\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\n if ((result = detectValue(sample[i])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var dataOriginal = data;\n\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\n var item = dataOriginal[i];\n var val = getDataItemValue(item);\n\n if (!isArray(val)) {\n return BE_ORDINAL.Not;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n\n if (val != null && isFinite(val) && val !== '') {\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\n } else if (beStr && val !== '-') {\n return BE_ORDINAL.Must;\n }\n }\n\n return BE_ORDINAL.Not;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseDate, numericToNumber } from '../../util/number';\nimport { createHashMap, trim, hasOwn } from 'zrender/lib/core/util';\nimport { throwError } from '../../util/log';\n/**\n * Convert raw the value in to inner value in List.\n *\n * [Performance sensitive]\n *\n * [Caution]: this is the key logic of user value parser.\n * For backward compatibiliy, do not modify it until have to!\n */\n\nexport function parseDataValue(value, // For high performance, do not omit the second param.\nopt) {\n // Performance sensitive.\n var dimType = opt && opt.type;\n\n if (dimType === 'ordinal') {\n // If given value is a category string\n var ordinalMeta = opt && opt.ordinalMeta;\n return ordinalMeta ? ordinalMeta.parseAndCollect(value) : value;\n }\n\n if (dimType === 'time' // spead up when using timestamp\n && typeof value !== 'number' && value != null && value !== '-') {\n value = +parseDate(value);\n } // dimType defaults 'number'.\n // If dimType is not ordinal and value is null or undefined or NaN or '-',\n // parse to NaN.\n // number-like string (like ' 123 ') can be converted to a number.\n // where null/undefined or other string will be converted to NaN.\n\n\n return value == null || value === '' ? NaN // If string (like '-'), using '+' parse to NaN\n // If object, also parse to NaN\n : +value;\n}\n;\nvar valueParserMap = createHashMap({\n 'number': function (val) {\n // Do not use `numericToNumber` here. We have by defualt `numericToNumber`.\n // Here the number parser can have loose rule:\n // enable to cut suffix: \"120px\" => 120, \"14%\" => 14.\n return parseFloat(val);\n },\n 'time': function (val) {\n // return timestamp.\n return +parseDate(val);\n },\n 'trim': function (val) {\n return typeof val === 'string' ? trim(val) : val;\n }\n});\nexport function getRawValueParser(type) {\n return valueParserMap.get(type);\n}\nvar ORDER_COMPARISON_OP_MAP = {\n lt: function (lval, rval) {\n return lval < rval;\n },\n lte: function (lval, rval) {\n return lval <= rval;\n },\n gt: function (lval, rval) {\n return lval > rval;\n },\n gte: function (lval, rval) {\n return lval >= rval;\n }\n};\n\nvar FilterOrderComparator =\n/** @class */\nfunction () {\n function FilterOrderComparator(op, rval) {\n if (typeof rval !== 'number') {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\n }\n\n throwError(errMsg);\n }\n\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterOrderComparator.prototype.evaluate = function (lval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n return typeof lval === 'number' ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat);\n };\n\n return FilterOrderComparator;\n}();\n\nvar SortOrderComparator =\n/** @class */\nfunction () {\n /**\n * @param order by defualt: 'asc'\n * @param incomparable by defualt: Always on the tail.\n * That is, if 'asc' => 'max', if 'desc' => 'min'\n * See the definition of \"incomparable\" in [SORT_COMPARISON_RULE]\n */\n function SortOrderComparator(order, incomparable) {\n var isDesc = order === 'desc';\n this._resultLT = isDesc ? 1 : -1;\n\n if (incomparable == null) {\n incomparable = isDesc ? 'min' : 'max';\n }\n\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\n } // See [SORT_COMPARISON_RULE].\n // Performance sensitive.\n\n\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n var lvalTypeof = typeof lval;\n var rvalTypeof = typeof rval;\n var lvalFloat = lvalTypeof === 'number' ? lval : numericToNumber(lval);\n var rvalFloat = rvalTypeof === 'number' ? rval : numericToNumber(rval);\n var lvalNotNumeric = isNaN(lvalFloat);\n var rvalNotNumeric = isNaN(rvalFloat);\n\n if (lvalNotNumeric) {\n lvalFloat = this._incomparable;\n }\n\n if (rvalNotNumeric) {\n rvalFloat = this._incomparable;\n }\n\n if (lvalNotNumeric && rvalNotNumeric) {\n var lvalIsStr = lvalTypeof === 'string';\n var rvalIsStr = rvalTypeof === 'string';\n\n if (lvalIsStr) {\n lvalFloat = rvalIsStr ? lval : 0;\n }\n\n if (rvalIsStr) {\n rvalFloat = lvalIsStr ? rval : 0;\n }\n }\n\n return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0;\n };\n\n return SortOrderComparator;\n}();\n\nexport { SortOrderComparator };\n\nvar FilterEqualityComparator =\n/** @class */\nfunction () {\n function FilterEqualityComparator(isEq, rval) {\n this._rval = rval;\n this._isEQ = isEq;\n this._rvalTypeof = typeof rval;\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterEqualityComparator.prototype.evaluate = function (lval) {\n var eqResult = lval === this._rval;\n\n if (!eqResult) {\n var lvalTypeof = typeof lval;\n\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\n eqResult = numericToNumber(lval) === this._rvalFloat;\n }\n }\n\n return this._isEQ ? eqResult : !eqResult;\n };\n\n return FilterEqualityComparator;\n}();\n/**\n * [FILTER_COMPARISON_RULE]\n * `lt`|`lte`|`gt`|`gte`:\n * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.\n * `eq`:\n * + If same type, compare with `===`.\n * + If there is one number, convert to number (`numericToNumber`) to compare.\n * + Else return `false`.\n * `ne`:\n * + Not `eq`.\n *\n *\n * [SORT_COMPARISON_RULE]\n * All the values are grouped into three categories:\n * + \"numeric\" (number and numeric string)\n * + \"non-numeric-string\" (string that excluding numeric string)\n * + \"others\"\n * \"numeric\" vs \"numeric\": values are ordered by number order.\n * \"non-numeric-string\" vs \"non-numeric-string\": values are ordered by ES spec (#sec-abstract-relational-comparison).\n * \"others\" vs \"others\": do not change order (always return 0).\n * \"numeric\" vs \"non-numeric-string\": \"non-numeric-string\" is treated as \"incomparable\".\n * \"number\" vs \"others\": \"others\" is treated as \"incomparable\".\n * \"non-numeric-string\" vs \"others\": \"others\" is treated as \"incomparable\".\n * \"incomparable\" will be seen as -Infinity or Infinity (depends on the settings).\n * MEMO:\n * non-numeric string sort make sence when need to put the items with the same tag together.\n * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,\n * So we treat \"numeric-string\" sorted by number order rather than string comparison.\n *\n *\n * [CHECK_LIST_OF_THE_RULE_DESIGN]\n * + Do not support string comparison until required. And also need to\n * void the misleading of \"2\" > \"12\".\n * + Should avoid the misleading case:\n * `\" 22 \" gte \"22\"` is `true` but `\" 22 \" eq \"22\"` is `false`.\n * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...\n * + Only \"numeric\" can be converted to comparable number, otherwise converted to NaN.\n * See `util/number.ts#numericToNumber`.\n *\n * @return If `op` is not `RelationalOperator`, return null;\n */\n\n\nexport function createFilterComparator(op, rval) {\n return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\n\n/**\n * List for data storage\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Model from '../model/Model';\nimport DataDiffer from './DataDiffer';\nimport { DefaultDataProvider } from './helper/dataProvider';\nimport { summarizeDimensions } from './helper/dimensionHelper';\nimport DataDimensionInfo from './DataDimensionInfo';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../util/types';\nimport { isDataItemOption, convertOptionIdName } from '../util/model';\nimport { getECData } from '../util/innerStore';\nimport { parseDataValue } from './helper/dataValueHelper';\nimport { isSourceInstance } from './Source';\nvar mathFloor = Math.floor;\nvar isObject = zrUtil.isObject;\nvar map = zrUtil.map;\nvar UNDEFINED = 'undefined';\nvar INDEX_NOT_FOUND = -1; // Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird udpate animation.\n\nvar ID_PREFIX = 'e\\0\\0';\nvar dataCtors = {\n 'float': typeof Float64Array === UNDEFINED ? Array : Float64Array,\n 'int': typeof Int32Array === UNDEFINED ? Array : Int32Array,\n // Ordinal data type can be string or int\n 'ordinal': Array,\n 'number': Array,\n 'time': Array\n}; // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\n// different from the Ctor of typed array.\n\nvar CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\nvar CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\nvar CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_rawData', '_dimValueGetter', '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'];\nvar CLONE_PROPERTIES = ['_extent', '_approximateExtent', '_rawExtent']; // -----------------------------\n// Internal method declarations:\n// -----------------------------\n\nvar defaultDimValueGetters;\nvar prepareInvertedIndex;\nvar getIndicesCtor;\nvar prepareStorage;\nvar getRawIndexWithoutIndices;\nvar getRawIndexWithIndices;\nvar getId;\nvar getIdNameFromStore;\nvar makeIdFromName;\nvar normalizeDimensions;\nvar validateDimensions;\nvar cloneListForMapAndSample;\nvar getInitialExtent;\nvar setItemDataAndSeriesIndex;\nvar transferProperties;\n\nvar List =\n/** @class */\nfunction () {\n /**\n * @param dimensions\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\n */\n function List(dimensions, hostModel) {\n this.type = 'list';\n this._count = 0;\n this._rawCount = 0;\n this._storage = {}; // We have an extra array store here. It's faster to be acessed than KV structured `_storage`.\n // We profile the code `storage[dim]` and it seems to be KeyedLoadIC_Megamorphic instead of fast property access.\n // Not sure why this happens. But using an extra array seems leads to faster `initData`\n // See https://github.com/apache/incubator-echarts/pull/13314 for more explanation.\n\n this._storageArr = [];\n this._nameList = [];\n this._idList = []; // Models of data option is stored sparse for optimizing memory cost\n // Never used yet (not used yet).\n // private _optionModels: Model[] = [];\n // Global visual properties after visual coding\n\n this._visual = {}; // Globel layout properties.\n\n this._layout = {}; // Item visual properties after visual coding\n\n this._itemVisuals = []; // Item layout properties after layout\n\n this._itemLayouts = []; // Graphic elemnents\n\n this._graphicEls = []; // Raw extent will not be cloned, but only transfered.\n // It will not be calculated util needed.\n\n this._rawExtent = {};\n this._extent = {}; // key: dim, value: extent\n\n this._approximateExtent = {};\n this._calculationInfo = {}; // Having detected that there is data item is non primitive type\n // (in type `OptionDataItemObject`).\n // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\n // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\n\n this.hasItemOption = true; // Methods that create a new list based on this list should be listed here.\n // Notice that those method should `RETURN` the new list.\n\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; // Methods that change indices of this list should be listed here.\n\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\n /**\n * Get raw data index.\n * Do not initialize.\n * Default `getRawIndex`. And it can be changed.\n */\n\n this.getRawIndex = getRawIndexWithoutIndices;\n dimensions = dimensions || ['x', 'y'];\n var dimensionInfos = {};\n var dimensionNames = [];\n var invertedIndicesMap = {};\n\n for (var i = 0; i < dimensions.length; i++) {\n // Use the original dimensions[i], where other flag props may exists.\n var dimInfoInput = dimensions[i];\n var dimensionInfo = zrUtil.isString(dimInfoInput) ? new DataDimensionInfo({\n name: dimInfoInput\n }) : !(dimInfoInput instanceof DataDimensionInfo) ? new DataDimensionInfo(dimInfoInput) : dimInfoInput;\n var dimensionName = dimensionInfo.name;\n dimensionInfo.type = dimensionInfo.type || 'float';\n\n if (!dimensionInfo.coordDim) {\n dimensionInfo.coordDim = dimensionName;\n dimensionInfo.coordDimIndex = 0;\n }\n\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n dimensionNames.push(dimensionName);\n dimensionInfos[dimensionName] = dimensionInfo;\n dimensionInfo.index = i;\n\n if (dimensionInfo.createInvertedIndices) {\n invertedIndicesMap[dimensionName] = [];\n }\n\n if (otherDims.itemName === 0) {\n this._nameDimIdx = i;\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\n }\n\n if (otherDims.itemId === 0) {\n this._idDimIdx = i;\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\n }\n }\n\n this.dimensions = dimensionNames;\n this._dimensionInfos = dimensionInfos;\n this.hostModel = hostModel; // Cache summary info for fast visit. See \"dimensionHelper\".\n\n this._dimensionsSummary = summarizeDimensions(this);\n this._invertedIndicesMap = invertedIndicesMap;\n this.userOutput = this._dimensionsSummary.userOutput;\n }\n /**\n * The meanings of the input parameter `dim`:\n *\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\n * + If dim is a number-like string (e.g., `\"1\"`):\n * + If there is the same concrete dim name defined in `this.dimensions`, it means that concrete name.\n * + If not, it will be converted to a number, which means the index of the dimension.\n * (why? because of the backward compatbility. We have been tolerating number-like string in\n * dimension setting, although now it seems that it is not a good idea.)\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\n * if no dimension name is defined as `\"1\"`.\n * + If dim is a not-number-like string, it means the concrete dim name.\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\n * or customized in `dimensions` property of option like `\"age\"`.\n *\n * Get dimension name\n * @param dim See above.\n * @return Concrete dim name.\n */\n\n\n List.prototype.getDimension = function (dim) {\n if (typeof dim === 'number' // If being a number-like string but not being defined a dimension name.\n || !isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim)) {\n dim = this.dimensions[dim];\n }\n\n return dim;\n };\n /**\n * Get type and calculation info of particular dimension\n * @param dim\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\n */\n\n\n List.prototype.getDimensionInfo = function (dim) {\n // Do not clone, because there may be categories in dimInfo.\n return this._dimensionInfos[this.getDimension(dim)];\n };\n /**\n * concrete dimension name list on coord.\n */\n\n\n List.prototype.getDimensionsOnCoord = function () {\n return this._dimensionsSummary.dataDimsOnCoord.slice();\n };\n\n List.prototype.mapDimension = function (coordDim, idx) {\n var dimensionsSummary = this._dimensionsSummary;\n\n if (idx == null) {\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n }\n\n var dims = dimensionsSummary.encode[coordDim];\n return dims ? dims[idx] : null;\n };\n\n List.prototype.mapDimensionsAll = function (coordDim) {\n var dimensionsSummary = this._dimensionsSummary;\n var dims = dimensionsSummary.encode[coordDim];\n return (dims || []).slice();\n };\n /**\n * Initialize from data\n * @param data source or data or data provider.\n * @param nameList The name of a datum is used on data diff and\n * default label/tooltip.\n * A name can be specified in encode.itemName,\n * or dataItem.name (only for series option data),\n * or provided in nameList from outside.\n */\n\n\n List.prototype.initData = function (data, nameList, dimValueGetter) {\n var notProvider = isSourceInstance(data) || zrUtil.isArrayLike(data);\n var provider = notProvider ? new DefaultDataProvider(data, this.dimensions.length) : data;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(notProvider || zrUtil.isFunction(provider.getItem) && zrUtil.isFunction(provider.count), 'Inavlid data provider.');\n }\n\n this._rawData = provider;\n var sourceFormat = provider.getSource().sourceFormat; // Clear\n\n this._storage = {};\n this._indices = null;\n this._dontMakeIdFromName = this._idDimIdx != null || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY // Cosndier performance.\n || !!provider.fillStorage;\n this._nameList = (nameList || []).slice();\n this._idList = [];\n this._nameRepeatCount = {};\n\n if (!dimValueGetter) {\n this.hasItemOption = false;\n }\n\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat]; // Default dim value getter\n\n this._dimValueGetter = dimValueGetter = dimValueGetter || this.defaultDimValueGetter;\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows; // Reset raw extent.\n\n this._rawExtent = {};\n\n this._initDataFromProvider(0, provider.count()); // If data has no item option.\n\n\n if (provider.pure) {\n this.hasItemOption = false;\n }\n };\n\n List.prototype.getProvider = function () {\n return this._rawData;\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */\n\n\n List.prototype.appendData = function (data) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(!this._indices, 'appendData can only be called on raw data.');\n }\n\n var rawData = this._rawData;\n var start = this.count();\n rawData.appendData(data);\n var end = rawData.count();\n\n if (!rawData.persistent) {\n end += start;\n }\n\n this._initDataFromProvider(start, end, true);\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n * This method does not modify `rawData` (`dataProvider`), but only\n * add values to storage.\n *\n * The final count will be increased by `Math.max(values.length, names.length)`.\n *\n * @param values That is the SourceType: 'arrayRows', like\n * [\n * [12, 33, 44],\n * [NaN, 43, 1],\n * ['-', 'asdf', 0]\n * ]\n * Each item is exaclty cooresponding to a dimension.\n */\n\n\n List.prototype.appendValues = function (values, names) {\n var storage = this._storage;\n var dimensions = this.dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var start = this.count();\n var end = start + Math.max(values.length, names ? names.length : 0);\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[dim]) {\n rawExtent[dim] = getInitialExtent();\n }\n\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\n }\n\n var rawExtentArr = map(dimensions, function (dim) {\n return rawExtent[dim];\n });\n var storageArr = this._storageArr = map(dimensions, function (dim) {\n return storage[dim];\n });\n var emptyDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start; // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dim = dimensions[dimIdx];\n\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\n\n storageArr[dimIdx][idx] = val;\n var dimRawExtent = rawExtentArr[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n\n if (names) {\n this._nameList[idx] = names[sourceIdx];\n\n if (!this._dontMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = {};\n prepareInvertedIndex(this);\n };\n\n List.prototype._initDataFromProvider = function (start, end, append) {\n if (start >= end) {\n return;\n }\n\n var rawData = this._rawData;\n var storage = this._storage;\n var dimensions = this.dimensions;\n var dimLen = dimensions.length;\n var dimensionInfoMap = this._dimensionInfos;\n var nameList = this._nameList;\n var idList = this._idList;\n var rawExtent = this._rawExtent;\n var sourceFormat = rawData.getSource().sourceFormat;\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[dim]) {\n rawExtent[dim] = getInitialExtent();\n }\n\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\n }\n\n var storageArr = this._storageArr = map(dimensions, function (dim) {\n return storage[dim];\n });\n var rawExtentArr = map(dimensions, function (dim) {\n return rawExtent[dim];\n });\n\n if (rawData.fillStorage) {\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\n } else {\n var dataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n dataItem = rawData.getItem(idx, dataItem); // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dim = dimensions[dimIdx];\n var dimStorage = storageArr[dimIdx]; // PENDING NULL is empty or zero\n\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\n\n dimStorage[idx] = val;\n var dimRawExtent = rawExtentArr[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n } // If dataItem is {name: ...} or {id: ...}, it has highest priority.\n // This kind of ids and names are always stored `_nameList` and `_idList`.\n\n\n if (isFormatOriginal && !rawData.pure && dataItem) {\n var itemName = dataItem.name;\n\n if (nameList[idx] == null && itemName != null) {\n nameList[idx] = convertOptionIdName(itemName, null);\n }\n\n var itemId = dataItem.id;\n\n if (idList[idx] == null && itemId != null) {\n idList[idx] = convertOptionIdName(itemId, null);\n }\n }\n\n if (!this._dontMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n\n if (!rawData.persistent && rawData.clean) {\n // Clean unused data if data source is typed array.\n rawData.clean();\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = {};\n prepareInvertedIndex(this);\n };\n\n List.prototype.count = function () {\n return this._count;\n };\n\n List.prototype.getIndices = function () {\n var newIndices;\n var indices = this._indices;\n\n if (indices) {\n var Ctor = indices.constructor;\n var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\n\n if (Ctor === Array) {\n newIndices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n newIndices[i] = indices[i];\n }\n } else {\n newIndices = new Ctor(indices.buffer, 0, thisCount);\n }\n } else {\n var Ctor = getIndicesCtor(this);\n newIndices = new Ctor(this.count());\n\n for (var i = 0; i < newIndices.length; i++) {\n newIndices[i] = i;\n }\n }\n\n return newIndices;\n }; // Get data by index of dimension.\n // Because in v8 access array by number variable is faster than access object by string variable\n // Not sure why but the optimization just works.\n\n\n List.prototype.getByDimIdx = function (dimIdx, idx) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n\n var dimStore = this._storageArr[dimIdx];\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n };\n /**\n * Get value. Return NaN if idx is out of range.\n * @param dim Dim must be concrete name.\n */\n\n\n List.prototype.get = function (dim, idx) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n\n var dimStore = this._storage[dim];\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n };\n /**\n * @param dim concrete dim\n */\n\n\n List.prototype.getByRawIndex = function (dim, rawIdx) {\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\n return NaN;\n }\n\n var dimStore = this._storage[dim];\n return dimStore ? dimStore[rawIdx] : NaN;\n };\n\n List.prototype.getValues = function (dimensions, idx) {\n var values = [];\n\n if (!zrUtil.isArray(dimensions)) {\n // stack = idx;\n idx = dimensions;\n dimensions = this.dimensions;\n }\n\n for (var i = 0, len = dimensions.length; i < len; i++) {\n values.push(this.get(dimensions[i], idx\n /*, stack */\n ));\n }\n\n return values;\n };\n /**\n * If value is NaN. Inlcuding '-'\n * Only check the coord dimensions.\n */\n\n\n List.prototype.hasValue = function (idx) {\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\n\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\n // Ordinal type originally can be string or number.\n // But when an ordinal type is used on coord, it can\n // not be string but only number. So we can also use isNaN.\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\n return false;\n }\n }\n\n return true;\n };\n /**\n * Get extent of data in one dimension\n */\n\n\n List.prototype.getDataExtent = function (dim) {\n // Make sure use concrete dim as cache name.\n dim = this.getDimension(dim);\n var dimData = this._storage[dim];\n var initialExtent = getInitialExtent(); // stack = !!((stack || false) && this.getCalculationInfo(dim));\n\n if (!dimData) {\n return initialExtent;\n } // Make more strict checkings to ensure hitting cache.\n\n\n var currEnd = this.count(); // let cacheName = [dim, !!stack].join('_');\n // let cacheName = dim;\n // Consider the most cases when using data zoom, `getDataExtent`\n // happened before filtering. We cache raw extent, which is not\n // necessary to be cleared and recalculated when restore data.\n\n var useRaw = !this._indices; // && !stack;\n\n var dimExtent;\n\n if (useRaw) {\n return this._rawExtent[dim].slice();\n }\n\n dimExtent = this._extent[dim];\n\n if (dimExtent) {\n return dimExtent.slice();\n }\n\n dimExtent = initialExtent;\n var min = dimExtent[0];\n var max = dimExtent[1];\n\n for (var i = 0; i < currEnd; i++) {\n var rawIdx = this.getRawIndex(i);\n var value = dimData[rawIdx];\n value < min && (min = value);\n value > max && (max = value);\n }\n\n dimExtent = [min, max];\n this._extent[dim] = dimExtent;\n return dimExtent;\n };\n /**\n * PENDING: In fact currently this function is only used to short-circuit\n * the calling of `scale.unionExtentFromData` when data have been filtered by modules\n * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\n * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\n * been fixed and no need to calling `scale.unionExtentFromData` actually.\n * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\n * be still needed.\n *\n * Optimize for the scenario that data is filtered by a given extent.\n * Consider that if data amount is more than hundreds of thousand,\n * extent calculation will cost more than 10ms and the cache will\n * be erased because of the filtering.\n */\n\n\n List.prototype.getApproximateExtent = function (dim) {\n dim = this.getDimension(dim);\n return this._approximateExtent[dim] || this.getDataExtent(dim);\n };\n /**\n * Calculate extent on a filtered data might be time consuming.\n * Approximate extent is only used for: calculte extent of filtered data outside.\n */\n\n\n List.prototype.setApproximateExtent = function (extent, dim) {\n dim = this.getDimension(dim);\n this._approximateExtent[dim] = extent.slice();\n };\n\n List.prototype.getCalculationInfo = function (key) {\n return this._calculationInfo[key];\n };\n\n List.prototype.setCalculationInfo = function (key, value) {\n isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n };\n /**\n * Get sum of data in one dimension\n */\n\n\n List.prototype.getSum = function (dim) {\n var dimData = this._storage[dim];\n var sum = 0;\n\n if (dimData) {\n for (var i = 0, len = this.count(); i < len; i++) {\n var value = this.get(dim, i);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n }\n\n return sum;\n };\n /**\n * Get median of data in one dimension\n */\n\n\n List.prototype.getMedian = function (dim) {\n var dimDataArray = []; // map all data of one dimension\n\n this.each(dim, function (val) {\n if (!isNaN(val)) {\n dimDataArray.push(val);\n }\n }); // TODO\n // Use quick select?\n\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\n return a - b;\n });\n var len = this.count(); // calculate median\n\n return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\n }; // /**\n // * Retreive the index with given value\n // * @param {string} dim Concrete dimension.\n // * @param {number} value\n // * @return {number}\n // */\n // Currently incorrect: should return dataIndex but not rawIndex.\n // Do not fix it until this method is to be used somewhere.\n // FIXME Precision of float value\n // indexOf(dim, value) {\n // let storage = this._storage;\n // let dimData = storage[dim];\n // let chunkSize = this._chunkSize;\n // if (dimData) {\n // for (let i = 0, len = this.count(); i < len; i++) {\n // let chunkIndex = mathFloor(i / chunkSize);\n // let chunkOffset = i % chunkSize;\n // if (dimData[chunkIndex][chunkOffset] === value) {\n // return i;\n // }\n // }\n // }\n // return -1;\n // }\n\n /**\n * Only support the dimension which inverted index created.\n * Do not support other cases until required.\n * @param dim concrete dim\n * @param value ordinal index\n * @return rawIndex\n */\n\n\n List.prototype.rawIndexOf = function (dim, value) {\n var invertedIndices = dim && this._invertedIndicesMap[dim];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!invertedIndices) {\n throw new Error('Do not supported yet');\n }\n }\n\n var rawIndex = invertedIndices[value];\n\n if (rawIndex == null || isNaN(rawIndex)) {\n return INDEX_NOT_FOUND;\n }\n\n return rawIndex;\n };\n /**\n * Retreive the index with given name\n */\n\n\n List.prototype.indexOfName = function (name) {\n for (var i = 0, len = this.count(); i < len; i++) {\n if (this.getName(i) === name) {\n return i;\n }\n }\n\n return -1;\n };\n /**\n * Retreive the index with given raw data index\n */\n\n\n List.prototype.indexOfRawIndex = function (rawIndex) {\n if (rawIndex >= this._rawCount || rawIndex < 0) {\n return -1;\n }\n\n if (!this._indices) {\n return rawIndex;\n } // Indices are ascending\n\n\n var indices = this._indices; // If rawIndex === dataIndex\n\n var rawDataIndex = indices[rawIndex];\n\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\n return rawIndex;\n }\n\n var left = 0;\n var right = this._count - 1;\n\n while (left <= right) {\n var mid = (left + right) / 2 | 0;\n\n if (indices[mid] < rawIndex) {\n left = mid + 1;\n } else if (indices[mid] > rawIndex) {\n right = mid - 1;\n } else {\n return mid;\n }\n }\n\n return -1;\n };\n /**\n * Retreive the index of nearest value\n * @param dim\n * @param value\n * @param [maxDistance=Infinity]\n * @return If and only if multiple indices has\n * the same value, they are put to the result.\n */\n\n\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n var storage = this._storage;\n var dimData = storage[dim];\n var nearestIndices = [];\n\n if (!dimData) {\n return nearestIndices;\n }\n\n if (maxDistance == null) {\n maxDistance = Infinity;\n }\n\n var minDist = Infinity;\n var minDiff = -1;\n var nearestIndicesLen = 0; // Check the test case of `test/ut/spec/data/List.js`.\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var dataIndex = this.getRawIndex(i);\n var diff = value - dimData[dataIndex];\n var dist = Math.abs(diff);\n\n if (dist <= maxDistance) {\n // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\n // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\n // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\n // So we chose the one that `diff >= 0` in this csae.\n // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n // should be push to `nearestIndices`.\n if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n nearestIndicesLen = 0;\n }\n\n if (diff === minDiff) {\n nearestIndices[nearestIndicesLen++] = i;\n }\n }\n }\n\n nearestIndices.length = nearestIndicesLen;\n return nearestIndices;\n };\n /**\n * Get raw data item\n */\n\n\n List.prototype.getRawDataItem = function (idx) {\n if (!this._rawData.persistent) {\n var val = [];\n\n for (var i = 0; i < this.dimensions.length; i++) {\n var dim = this.dimensions[i];\n val.push(this.get(dim, idx));\n }\n\n return val;\n } else {\n return this._rawData.getItem(this.getRawIndex(idx));\n }\n };\n /**\n * @return Never be null/undefined. `number` will be converted to string. Becuase:\n * In most cases, name is used in display, where returning a string is more convenient.\n * In other cases, name is used in query (see `indexOfName`), where we can keep the\n * rule that name `2` equals to name `'2'`.\n */\n\n\n List.prototype.getName = function (idx) {\n var rawIndex = this.getRawIndex(idx);\n var name = this._nameList[rawIndex];\n\n if (name == null && this._nameDimIdx != null) {\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\n }\n\n if (name == null) {\n name = '';\n }\n\n return name;\n };\n /**\n * @return Never null/undefined. `number` will be converted to string. Becuase:\n * In all cases having encountered at present, id is used in making diff comparison, which\n * are usually based on hash map. We can keep the rule that the internal id are always string\n * (treat `2` is the same as `'2'`) to make the related logic simple.\n */\n\n\n List.prototype.getId = function (idx) {\n return getId(this, this.getRawIndex(idx));\n };\n\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\n 'use strict';\n\n var _this = this;\n\n if (!this._count) {\n return;\n }\n\n if (typeof dims === 'function') {\n ctxCompat = ctx;\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || ctxCompat || this;\n var dimNames = map(normalizeDimensions(dims), this.getDimension, this);\n\n if (process.env.NODE_ENV !== 'production') {\n validateDimensions(this, dimNames);\n }\n\n var dimSize = dimNames.length;\n var dimIndices = map(dimNames, function (dimName) {\n return _this._dimensionInfos[dimName].index;\n });\n var storageArr = this._storageArr;\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var rawIdx = this.getRawIndex(i); // Simple optimization\n\n switch (dimSize) {\n case 0:\n cb.call(fCtx, i);\n break;\n\n case 1:\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\n break;\n\n case 2:\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\n break;\n\n default:\n var k = 0;\n var value = [];\n\n for (; k < dimSize; k++) {\n value[k] = storageArr[dimIndices[k]][rawIdx];\n } // Index\n\n\n value[k] = i;\n cb.apply(fCtx, value);\n }\n }\n };\n\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\n 'use strict';\n\n var _this = this;\n\n if (!this._count) {\n return;\n }\n\n if (typeof dims === 'function') {\n ctxCompat = ctx;\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || ctxCompat || this;\n var dimNames = map(normalizeDimensions(dims), this.getDimension, this);\n\n if (process.env.NODE_ENV !== 'production') {\n validateDimensions(this, dimNames);\n }\n\n var count = this.count();\n var Ctor = getIndicesCtor(this);\n var newIndices = new Ctor(count);\n var value = [];\n var dimSize = dimNames.length;\n var offset = 0;\n var dimIndices = map(dimNames, function (dimName) {\n return _this._dimensionInfos[dimName].index;\n });\n var dim0 = dimIndices[0];\n var storageArr = this._storageArr;\n\n for (var i = 0; i < count; i++) {\n var keep = void 0;\n var rawIdx = this.getRawIndex(i); // Simple optimization\n\n if (dimSize === 0) {\n keep = cb.call(fCtx, i);\n } else if (dimSize === 1) {\n var val = storageArr[dim0][rawIdx];\n keep = cb.call(fCtx, val, i);\n } else {\n var k = 0;\n\n for (; k < dimSize; k++) {\n value[k] = storageArr[dimIndices[k]][rawIdx];\n }\n\n value[k] = i;\n keep = cb.apply(fCtx, value);\n }\n\n if (keep) {\n newIndices[offset++] = rawIdx;\n }\n } // Set indices after filtered.\n\n\n if (offset < count) {\n this._indices = newIndices;\n }\n\n this._count = offset; // Reset data extent\n\n this._extent = {};\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return this;\n };\n /**\n * Select data in range. (For optimization of filter)\n * (Manually inline code, support 5 million data filtering in data zoom.)\n */\n\n\n List.prototype.selectRange = function (range) {\n 'use strict';\n\n var _this = this;\n\n var len = this._count;\n\n if (!len) {\n return;\n }\n\n var dimensions = [];\n\n for (var dim in range) {\n if (range.hasOwnProperty(dim)) {\n dimensions.push(dim);\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n validateDimensions(this, dimensions);\n }\n\n var dimSize = dimensions.length;\n\n if (!dimSize) {\n return;\n }\n\n var originalCount = this.count();\n var Ctor = getIndicesCtor(this);\n var newIndices = new Ctor(originalCount);\n var offset = 0;\n var dim0 = dimensions[0];\n var dimIndices = map(dimensions, function (dimName) {\n return _this._dimensionInfos[dimName].index;\n });\n var min = range[dim0][0];\n var max = range[dim0][1];\n var storageArr = this._storageArr;\n var quickFinished = false;\n\n if (!this._indices) {\n // Extreme optimization for common case. About 2x faster in chrome.\n var idx = 0;\n\n if (dimSize === 1) {\n var dimStorage = storageArr[dimIndices[0]];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty\n // value indicates the line should be broken. But for the case like\n // scatter plot, a data item with empty value will not be rendered,\n // but the axis extent may be effected if some other dim of the data\n // item has value. Fortunately it is not a significant negative effect.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n } else if (dimSize === 2) {\n var dimStorage = storageArr[dimIndices[0]];\n var dimStorage2 = storageArr[dimIndices[1]];\n var min2 = range[dimensions[1]][0];\n var max2 = range[dimensions[1]][1];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i];\n var val2 = dimStorage2[i]; // Do not filter NaN, see comment above.\n\n if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n }\n }\n\n if (!quickFinished) {\n if (dimSize === 1) {\n for (var i = 0; i < originalCount; i++) {\n var rawIndex = this.getRawIndex(i);\n var val = storageArr[dimIndices[0]][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = rawIndex;\n }\n }\n } else {\n for (var i = 0; i < originalCount; i++) {\n var keep = true;\n var rawIndex = this.getRawIndex(i);\n\n for (var k = 0; k < dimSize; k++) {\n var dimk = dimensions[k];\n var val = storageArr[dimIndices[k]][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val < range[dimk][0] || val > range[dimk][1]) {\n keep = false;\n }\n }\n\n if (keep) {\n newIndices[offset++] = this.getRawIndex(i);\n }\n }\n }\n } // Set indices after filtered.\n\n\n if (offset < originalCount) {\n this._indices = newIndices;\n }\n\n this._count = offset; // Reset data extent\n\n this._extent = {};\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return this;\n };\n /* eslint-enable */\n\n\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\n 'use strict';\n\n if (typeof dims === 'function') {\n ctxCompat = ctx;\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n ctx = ctx || ctxCompat || this;\n var result = [];\n this.each(dims, function () {\n result.push(cb && cb.apply(this, arguments));\n }, ctx);\n return result;\n };\n\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\n 'use strict'; // ctxCompat just for compat echarts3\n\n var fCtx = ctx || ctxCompat || this;\n var dimNames = map(normalizeDimensions(dims), this.getDimension, this);\n\n if (process.env.NODE_ENV !== 'production') {\n validateDimensions(this, dimNames);\n }\n\n var list = cloneListForMapAndSample(this, dimNames);\n var storage = list._storage; // Following properties are all immutable.\n // So we can reference to the same value\n\n list._indices = this._indices;\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n var tmpRetValue = [];\n var dimSize = dimNames.length;\n var dataCount = this.count();\n var values = [];\n var rawExtent = list._rawExtent;\n\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\n }\n\n values[dimSize] = dataIndex;\n var retValue = cb && cb.apply(fCtx, values);\n\n if (retValue != null) {\n // a number or string (in oridinal dimension)?\n if (typeof retValue !== 'object') {\n tmpRetValue[0] = retValue;\n retValue = tmpRetValue;\n }\n\n var rawIndex = this.getRawIndex(dataIndex);\n\n for (var i = 0; i < retValue.length; i++) {\n var dim = dimNames[i];\n var val = retValue[i];\n var rawExtentOnDim = rawExtent[dim];\n var dimStore = storage[dim];\n\n if (dimStore) {\n dimStore[rawIndex] = val;\n }\n\n if (val < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = val;\n }\n\n if (val > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = val;\n }\n }\n }\n }\n\n return list;\n };\n /**\n * Large data down sampling on given dimension\n * @param sampleIndex Sample index for name and id\n */\n\n\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var list = cloneListForMapAndSample(this, [dimension]);\n var targetStorage = list._storage;\n var frameValues = [];\n var frameSize = mathFloor(1 / rate);\n var dimStore = targetStorage[dimension];\n var len = this.count();\n var rawExtentOnDim = list._rawExtent[dimension];\n var newIndices = new (getIndicesCtor(this))(len);\n var offset = 0;\n\n for (var i = 0; i < len; i += frameSize) {\n // Last frame\n if (frameSize > len - i) {\n frameSize = len - i;\n frameValues.length = frameSize;\n }\n\n for (var k = 0; k < frameSize; k++) {\n var dataIdx = this.getRawIndex(i + k);\n frameValues[k] = dimStore[dataIdx];\n }\n\n var value = sampleValue(frameValues);\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)); // Only write value on the filtered data\n\n dimStore[sampleFrameIdx] = value;\n\n if (value < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = value;\n }\n\n if (value > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = value;\n }\n\n newIndices[offset++] = sampleFrameIdx;\n }\n\n list._count = offset;\n list._indices = newIndices;\n list.getRawIndex = getRawIndexWithIndices;\n return list;\n };\n /**\n * Large data down sampling using largest-triangle-three-buckets\n * @param {string} valueDimension\n * @param {number} targetCount\n */\n\n\n List.prototype.lttbDownSample = function (valueDimension, rate) {\n var list = cloneListForMapAndSample(this, []);\n var targetStorage = list._storage;\n var dimStore = targetStorage[valueDimension];\n var len = this.count();\n var newIndices = new (getIndicesCtor(this))(len);\n var sampledIndex = 0;\n var frameSize = mathFloor(1 / rate);\n var currentRawIndex = this.getRawIndex(0);\n var maxArea;\n var area;\n var nextRawIndex; // First frame use the first data.\n\n newIndices[sampledIndex++] = currentRawIndex;\n\n for (var i = 1; i < len - 1; i += frameSize) {\n var nextFrameStart = Math.min(i + frameSize, len - 1);\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\n var avgY = 0;\n\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n continue;\n }\n\n avgY += y;\n }\n\n avgY /= nextFrameEnd - nextFrameStart;\n var frameStart = i;\n var frameEnd = Math.min(i + frameSize, len);\n var pointAX = i - 1;\n var pointAY = dimStore[currentRawIndex];\n maxArea = -1;\n nextRawIndex = frameStart; // Find a point from current frame that construct a triangel with largest area with previous selected point\n // And the average of next frame.\n\n for (var idx = frameStart; idx < frameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n continue;\n } // Calculate triangle area over three buckets\n\n\n area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY));\n\n if (area > maxArea) {\n maxArea = area;\n nextRawIndex = rawIndex; // Next a is this b\n }\n }\n\n newIndices[sampledIndex++] = nextRawIndex;\n currentRawIndex = nextRawIndex; // This a is the next a (chosen b)\n } // First frame use the last data.\n\n\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\n list._count = sampledIndex;\n list._indices = newIndices;\n list.getRawIndex = getRawIndexWithIndices;\n return list;\n };\n /**\n * Get model of one data item.\n */\n // TODO: Type of data item\n\n\n List.prototype.getItemModel = function (idx) {\n var hostModel = this.hostModel;\n var dataItem = this.getRawDataItem(idx);\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\n };\n /**\n * Create a data differ\n */\n\n\n List.prototype.diff = function (otherList) {\n var thisList = this;\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\n return getId(otherList, idx);\n }, function (idx) {\n return getId(thisList, idx);\n });\n };\n /**\n * Get visual property.\n */\n\n\n List.prototype.getVisual = function (key) {\n var visual = this._visual;\n return visual && visual[key];\n };\n\n List.prototype.setVisual = function (kvObj, val) {\n this._visual = this._visual || {};\n\n if (isObject(kvObj)) {\n zrUtil.extend(this._visual, kvObj);\n } else {\n this._visual[kvObj] = val;\n }\n };\n /**\n * Get visual property of single data item\n */\n // eslint-disable-next-line\n\n\n List.prototype.getItemVisual = function (idx, key) {\n var itemVisual = this._itemVisuals[idx];\n var val = itemVisual && itemVisual[key];\n\n if (val == null) {\n // Use global visual property\n return this.getVisual(key);\n }\n\n return val;\n };\n /**\n * If exists visual property of single data item\n */\n\n\n List.prototype.hasItemVisual = function () {\n return this._itemVisuals.length > 0;\n };\n /**\n * Make sure itemVisual property is unique\n */\n // TODO: use key to save visual to reduce memory.\n\n\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\n var itemVisuals = this._itemVisuals;\n var itemVisual = itemVisuals[idx];\n\n if (!itemVisual) {\n itemVisual = itemVisuals[idx] = {};\n }\n\n var val = itemVisual[key];\n\n if (val == null) {\n val = this.getVisual(key); // TODO Performance?\n\n if (zrUtil.isArray(val)) {\n val = val.slice();\n } else if (isObject(val)) {\n val = zrUtil.extend({}, val);\n }\n\n itemVisual[key] = val;\n }\n\n return val;\n }; // eslint-disable-next-line\n\n\n List.prototype.setItemVisual = function (idx, key, value) {\n var itemVisual = this._itemVisuals[idx] || {};\n this._itemVisuals[idx] = itemVisual;\n\n if (isObject(key)) {\n zrUtil.extend(itemVisual, key);\n } else {\n itemVisual[key] = value;\n }\n };\n /**\n * Clear itemVisuals and list visual.\n */\n\n\n List.prototype.clearAllVisual = function () {\n this._visual = {};\n this._itemVisuals = [];\n };\n\n List.prototype.setLayout = function (key, val) {\n if (isObject(key)) {\n for (var name_1 in key) {\n if (key.hasOwnProperty(name_1)) {\n this.setLayout(name_1, key[name_1]);\n }\n }\n\n return;\n }\n\n this._layout[key] = val;\n };\n /**\n * Get layout property.\n */\n\n\n List.prototype.getLayout = function (key) {\n return this._layout[key];\n };\n /**\n * Get layout of single data item\n */\n\n\n List.prototype.getItemLayout = function (idx) {\n return this._itemLayouts[idx];\n };\n /**\n * Set layout of single data item\n */\n\n\n List.prototype.setItemLayout = function (idx, layout, merge) {\n this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n };\n /**\n * Clear all layout of single data item\n */\n\n\n List.prototype.clearItemLayouts = function () {\n this._itemLayouts.length = 0;\n };\n /**\n * Set graphic element relative to data. It can be set as null\n */\n\n\n List.prototype.setItemGraphicEl = function (idx, el) {\n var hostModel = this.hostModel;\n\n if (el) {\n var ecData = getECData(el); // Add data index and series index for indexing the data by element\n // Useful in tooltip\n\n ecData.dataIndex = idx;\n ecData.dataType = this.dataType;\n ecData.seriesIndex = hostModel && hostModel.seriesIndex; // TODO: not store dataIndex on children.\n\n if (el.type === 'group') {\n el.traverse(setItemDataAndSeriesIndex, el);\n }\n }\n\n this._graphicEls[idx] = el;\n };\n\n List.prototype.getItemGraphicEl = function (idx) {\n return this._graphicEls[idx];\n };\n\n List.prototype.eachItemGraphicEl = function (cb, context) {\n zrUtil.each(this._graphicEls, function (el, idx) {\n if (el) {\n cb && cb.call(context, el, idx);\n }\n });\n };\n /**\n * Shallow clone a new list except visual and layout properties, and graph elements.\n * New list only change the indices.\n */\n\n\n List.prototype.cloneShallow = function (list) {\n if (!list) {\n var dimensionInfoList = map(this.dimensions, this.getDimensionInfo, this);\n list = new List(dimensionInfoList, this.hostModel);\n } // FIXME\n\n\n list._storage = this._storage;\n list._storageArr = this._storageArr;\n transferProperties(list, this); // Clone will not change the data extent and indices\n\n if (this._indices) {\n var Ctor = this._indices.constructor;\n\n if (Ctor === Array) {\n var thisCount = this._indices.length;\n list._indices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n list._indices[i] = this._indices[i];\n }\n } else {\n list._indices = new Ctor(this._indices);\n }\n } else {\n list._indices = null;\n }\n\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\n return list;\n };\n /**\n * Wrap some method to add more feature\n */\n\n\n List.prototype.wrapMethod = function (methodName, injectFunction) {\n var originalMethod = this[methodName];\n\n if (typeof originalMethod !== 'function') {\n return;\n }\n\n this.__wrappedMethods = this.__wrappedMethods || [];\n\n this.__wrappedMethods.push(methodName);\n\n this[methodName] = function () {\n var res = originalMethod.apply(this, arguments);\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n };\n }; // ----------------------------------------------------------\n // A work around for internal method visiting private member.\n // ----------------------------------------------------------\n\n\n List.internalField = function () {\n defaultDimValueGetters = {\n arrayRows: getDimValueSimply,\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\n },\n keyedColumns: getDimValueSimply,\n original: function (dataItem, dimName, dataIndex, dimIndex) {\n // Performance sensitive, do not use modelUtil.getDataItemValue.\n // If dataItem is an plain object with no value field, the let `value`\n // will be assigned with the object, but it will be tread correctly\n // in the `convertValue`.\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); // If any dataItem is like { value: 10 }\n\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\n this.hasItemOption = true;\n }\n\n return parseDataValue(value instanceof Array ? value[dimIndex] // If value is a single number or something else not array.\n : value, this._dimensionInfos[dimName]);\n },\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\n return dataItem[dimIndex];\n }\n };\n\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\n }\n\n prepareInvertedIndex = function (list) {\n var invertedIndicesMap = list._invertedIndicesMap;\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n var dimInfo = list._dimensionInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices.\n\n var ordinalMeta = dimInfo.ordinalMeta;\n\n if (ordinalMeta) {\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\n\n for (var i = 0; i < invertedIndices.length; i++) {\n invertedIndices[i] = INDEX_NOT_FOUND;\n }\n\n for (var i = 0; i < list._count; i++) {\n // Only support the case that all values are distinct.\n invertedIndices[list.get(dim, i)] = i;\n }\n }\n });\n };\n\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\n var val;\n var chunk = list._storageArr[dimIdx];\n\n if (chunk) {\n val = chunk[rawIndex];\n\n if (ordinalMeta && ordinalMeta.categories.length) {\n val = ordinalMeta.categories[val];\n }\n }\n\n return convertOptionIdName(val, null);\n };\n\n getIndicesCtor = function (list) {\n // The possible max value in this._indicies is always this._rawCount despite of filtering.\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\n };\n\n prepareStorage = function (storage, dimInfo, end, append) {\n var DataCtor = dataCtors[dimInfo.type];\n var dim = dimInfo.name;\n\n if (append) {\n var oldStore = storage[dim];\n var oldLen = oldStore && oldStore.length;\n\n if (!(oldLen === end)) {\n var newStore = new DataCtor(end); // The cost of the copy is probably inconsiderable\n // within the initial chunkSize.\n\n for (var j = 0; j < oldLen; j++) {\n newStore[j] = oldStore[j];\n }\n\n storage[dim] = newStore;\n }\n } else {\n storage[dim] = new DataCtor(end);\n }\n };\n\n getRawIndexWithoutIndices = function (idx) {\n return idx;\n };\n\n getRawIndexWithIndices = function (idx) {\n if (idx < this._count && idx >= 0) {\n return this._indices[idx];\n }\n\n return -1;\n };\n /**\n * @see the comment of `List['getId']`.\n */\n\n\n getId = function (list, rawIndex) {\n var id = list._idList[rawIndex];\n\n if (id == null && list._idDimIdx != null) {\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\n }\n\n if (id == null) {\n id = ID_PREFIX + rawIndex;\n }\n\n return id;\n };\n\n normalizeDimensions = function (dimensions) {\n if (!zrUtil.isArray(dimensions)) {\n dimensions = dimensions != null ? [dimensions] : [];\n }\n\n return dimensions;\n };\n\n validateDimensions = function (list, dims) {\n for (var i = 0; i < dims.length; i++) {\n // stroage may be empty when no data, so use\n // dimensionInfos to check.\n if (!list._dimensionInfos[dims[i]]) {\n console.error('Unkown dimension ' + dims[i]);\n }\n }\n }; // Data in excludeDimensions is copied, otherwise transfered.\n\n\n cloneListForMapAndSample = function (original, excludeDimensions) {\n var allDimensions = original.dimensions;\n var list = new List(map(allDimensions, original.getDimensionInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n var storage = list._storage = {};\n var originalStorage = original._storage;\n var storageArr = list._storageArr = []; // Init storage\n\n for (var i = 0; i < allDimensions.length; i++) {\n var dim = allDimensions[i];\n\n if (originalStorage[dim]) {\n // Notice that we do not reset invertedIndicesMap here, becuase\n // there is no scenario of mapping or sampling ordinal dimension.\n if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {\n storage[dim] = cloneChunk(originalStorage[dim]);\n list._rawExtent[dim] = getInitialExtent();\n list._extent[dim] = null;\n } else {\n // Direct reference for other dimensions\n storage[dim] = originalStorage[dim];\n }\n\n storageArr.push(storage[dim]);\n }\n }\n\n return list;\n };\n\n function cloneChunk(originalChunk) {\n var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array.\n\n return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);\n }\n\n getInitialExtent = function () {\n return [Infinity, -Infinity];\n };\n\n setItemDataAndSeriesIndex = function (child) {\n var childECData = getECData(child);\n var thisECData = getECData(this);\n childECData.seriesIndex = thisECData.seriesIndex;\n childECData.dataIndex = thisECData.dataIndex;\n childECData.dataType = thisECData.dataType;\n };\n\n transferProperties = function (target, source) {\n zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n if (source.hasOwnProperty(propName)) {\n target[propName] = source[propName];\n }\n });\n target.__wrappedMethods = source.__wrappedMethods;\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\n target[propName] = zrUtil.clone(source[propName]);\n });\n target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\n };\n\n makeIdFromName = function (list, idx) {\n var nameList = list._nameList;\n var idList = list._idList;\n var nameDimIdx = list._nameDimIdx;\n var idDimIdx = list._idDimIdx;\n var name = nameList[idx];\n var id = idList[idx];\n\n if (name == null && nameDimIdx != null) {\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\n }\n\n if (id == null && idDimIdx != null) {\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\n }\n\n if (id == null && name != null) {\n var nameRepeatCount = list._nameRepeatCount;\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\n id = name;\n\n if (nmCnt > 1) {\n id += '__ec__' + nmCnt;\n }\n\n idList[idx] = id;\n }\n };\n }();\n\n return List;\n}();\n\nexport default List;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isString } from 'zrender/lib/core/util';\n/**\n * Note that it is too complicated to support 3d stack by value\n * (have to create two-dimension inverted index), so in 3d case\n * we just support that stacked by index.\n *\n * @param seriesModel\n * @param dimensionInfoList The same as the input of .\n * The input dimensionInfoList will be modified.\n * @param opt\n * @param opt.stackedCoordDimension Specify a coord dimension if needed.\n * @param opt.byIndex=false\n * @return calculationInfo\n * {\n * stackedDimension: string\n * stackedByDimension: string\n * isStackedByIndex: boolean\n * stackedOverDimension: string\n * stackResultDimension: string\n * }\n */\n\nexport function enableDataStack(seriesModel, dimensionInfoList, opt) {\n opt = opt || {};\n var byIndex = opt.byIndex;\n var stackedCoordDimension = opt.stackedCoordDimension; // Compatibal: when `stack` is set as '', do not stack.\n\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\n var stackedByDimInfo;\n var stackedDimInfo;\n var stackResultDimension;\n var stackedOverDimension;\n each(dimensionInfoList, function (dimensionInfo, index) {\n if (isString(dimensionInfo)) {\n dimensionInfoList[index] = dimensionInfo = {\n name: dimensionInfo\n };\n }\n\n if (mayStack && !dimensionInfo.isExtraCoord) {\n // Find the first ordinal dimension as the stackedByDimInfo.\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\n stackedByDimInfo = dimensionInfo;\n } // Find the first stackable dimension as the stackedDimInfo.\n\n\n if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\n stackedDimInfo = dimensionInfo;\n }\n }\n });\n\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\n // Compatible with previous design, value axis (time axis) only stack by index.\n // It may make sense if the user provides elaborately constructed data.\n byIndex = true;\n } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n // That put stack logic in List is for using conveniently in echarts extensions, but it\n // might not be a good way.\n\n\n if (stackedDimInfo) {\n // Use a weird name that not duplicated with other names.\n stackResultDimension = '__\\0ecstackresult';\n stackedOverDimension = '__\\0ecstackedover'; // Create inverted index to fast query index by value.\n\n if (stackedByDimInfo) {\n stackedByDimInfo.createInvertedIndices = true;\n }\n\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\n var stackedDimType = stackedDimInfo.type;\n var stackedDimCoordIndex_1 = 0;\n each(dimensionInfoList, function (dimensionInfo) {\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\n stackedDimCoordIndex_1++;\n }\n });\n dimensionInfoList.push({\n name: stackResultDimension,\n coordDim: stackedDimCoordDim_1,\n coordDimIndex: stackedDimCoordIndex_1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true\n });\n stackedDimCoordIndex_1++;\n dimensionInfoList.push({\n name: stackedOverDimension,\n // This dimension contains stack base (generally, 0), so do not set it as\n // `stackedDimCoordDim` to avoid extent calculation, consider log scale.\n coordDim: stackedOverDimension,\n coordDimIndex: stackedDimCoordIndex_1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true\n });\n }\n\n return {\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\n isStackedByIndex: byIndex,\n stackedOverDimension: stackedOverDimension,\n stackResultDimension: stackResultDimension\n };\n}\nexport function isDimensionStacked(data, stackedDim\n/*, stackedByDim*/\n) {\n // Each single series only maps to one pair of axis. So we do not need to\n // check stackByDim, whatever stacked by a dimension or stacked by index.\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension'); // && (\n // stackedByDim != null\n // ? stackedByDim === data.getCalculationInfo('stackedByDimension')\n // : data.getCalculationInfo('isStackedByIndex')\n // );\n}\nexport function getStackedDimension(data, targetDim) {\n return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, isObject, map } from 'zrender/lib/core/util';\n\nvar OrdinalMeta =\n/** @class */\nfunction () {\n function OrdinalMeta(opt) {\n this.categories = opt.categories || [];\n this._needCollect = opt.needCollect;\n this._deduplication = opt.deduplication;\n }\n\n OrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n };\n\n ;\n\n OrdinalMeta.prototype.getOrdinal = function (category) {\n // @ts-ignore\n return this._getOrCreateMap().get(category);\n };\n /**\n * @return The ordinal. If not found, return NaN.\n */\n\n\n OrdinalMeta.prototype.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect; // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n\n if (typeof category !== 'string' && !needCollect) {\n return category;\n } // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n\n\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n\n var map = this._getOrCreateMap(); // @ts-ignore\n\n\n index = map.get(category);\n\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category; // @ts-ignore\n\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n\n return index;\n }; // Consider big data, do not create map until needed.\n\n\n OrdinalMeta.prototype._getOrCreateMap = function () {\n return this._map || (this._map = createHashMap(this.categories));\n };\n\n return OrdinalMeta;\n}();\n\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\n\nexport default OrdinalMeta;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types';\nimport { normalizeToArray } from '../../util/model';\nimport { createHashMap, bind, each, hasOwn, map, clone, isObject, extend } from 'zrender/lib/core/util';\nimport { getRawSourceItemGetter, getRawSourceDataCounter, getRawSourceValueGetter } from './dataProvider';\nimport { parseDataValue } from './dataValueHelper';\nimport { consoleLog, makePrintable, throwError } from '../../util/log';\nimport { createSource, detectSourceFormat } from '../Source';\n/**\n * TODO: disable writable.\n * This structure will be exposed to users.\n */\n\nvar ExternalSource =\n/** @class */\nfunction () {\n function ExternalSource() {}\n\n ExternalSource.prototype.getRawData = function () {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n\n ExternalSource.prototype.cloneRawData = function () {\n return;\n };\n /**\n * @return If dimension not found, return null/undefined.\n */\n\n\n ExternalSource.prototype.getDimensionInfo = function (dim) {\n return;\n };\n /**\n * dimensions defined if and only if either:\n * (a) dataset.dimensions are declared.\n * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).\n * If dimensions are defined, `dimensionInfoAll` is corresponding to\n * the defined dimensions.\n * Otherwise, `dimensionInfoAll` is determined by data columns.\n * @return Always return an array (even empty array).\n */\n\n\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\n return;\n };\n\n ExternalSource.prototype.count = function () {\n return;\n };\n /**\n * Only support by dimension index.\n * No need to support by dimension name in transform function,\n * becuase transform function is not case-specific, no need to use name literally.\n */\n\n\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\n return;\n };\n\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\n return;\n };\n\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\n return parseDataValue(rawVal, dimInfo);\n };\n\n return ExternalSource;\n}();\n\nexport { ExternalSource };\n\nfunction createExternalSource(internalSource, externalTransform) {\n var extSource = new ExternalSource();\n var data = internalSource.data;\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\n var sourceHeaderCount = internalSource.startIndex;\n var errMsg = '';\n\n if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) {\n // For the logic simplicity in transformer, only 'culumn' is\n // supported in data transform. Otherwise, the `dimensionsDefine`\n // might be detected by 'row', which probably confuses users.\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`seriesLayoutBy` of upstream dataset can only be \"column\" in data transform.';\n }\n\n throwError(errMsg);\n } // [MEMO]\n // Create a new dimensions structure for exposing.\n // Do not expose all dimension info to users directly.\n // Becuase the dimension is probably auto detected from data and not might reliable.\n // Should not lead the transformers to think that is relialbe and return it.\n // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n\n\n var dimensions = [];\n var dimsByName = {};\n var dimsDef = internalSource.dimensionsDefine;\n\n if (dimsDef) {\n each(dimsDef, function (dimDef, idx) {\n var name = dimDef.name;\n var dimDefExt = {\n index: idx,\n name: name,\n displayName: dimDef.displayName\n };\n dimensions.push(dimDefExt); // Users probably not sepcify dimension name. For simplicity, data transform\n // do not generate dimension name.\n\n if (name != null) {\n // Dimension name should not be duplicated.\n // For simplicity, data transform forbid name duplication, do not generate\n // new name like module `completeDimensions.ts` did, but just tell users.\n var errMsg_1 = '';\n\n if (hasOwn(dimsByName, name)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'dimension name \"' + name + '\" duplicated.';\n }\n\n throwError(errMsg_1);\n }\n\n dimsByName[name] = dimDefExt;\n }\n });\n } // If dimension definitions are not defined and can not be detected.\n // e.g., pure data `[[11, 22], ...]`.\n else {\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\n // Do not generete name or anything others. The consequence process in\n // `transform` or `series` probably have there own name generation strategry.\n dimensions.push({\n index: i\n });\n }\n } // Implement public methods:\n\n\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n\n if (externalTransform.__isBuiltIn) {\n extSource.getRawDataItem = function (dataIndex) {\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n };\n\n extSource.getRawData = bind(getRawData, null, internalSource);\n }\n\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\n\n extSource.retrieveValue = function (dataIndex, dimIndex) {\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n return retrieveValueFromItem(rawItem, dimIndex);\n };\n\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\n if (dataItem == null) {\n return;\n }\n\n var dimDef = dimensions[dimIndex]; // When `dimIndex` is `null`, `rawValueGetter` return the whole item.\n\n if (dimDef) {\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\n }\n };\n\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\n return extSource;\n}\n\nfunction getRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\n }\n\n throwError(errMsg);\n }\n\n return upstream.data;\n}\n\nfunction cloneRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n var data = upstream.data;\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat;\n }\n\n throwError(errMsg);\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var result = [];\n\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(data[i].slice());\n }\n\n return result;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n var result = [];\n\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(extend({}, data[i]));\n }\n\n return result;\n }\n}\n\nfunction getDimensionInfo(dimensions, dimsByName, dim) {\n if (dim == null) {\n return;\n } // Keep the same logic as `List::getDimension` did.\n\n\n if (typeof dim === 'number' // If being a number-like string but not being defined a dimension name.\n || !isNaN(dim) && !hasOwn(dimsByName, dim)) {\n return dimensions[dim];\n } else if (hasOwn(dimsByName, dim)) {\n return dimsByName[dim];\n }\n}\n\nfunction cloneAllDimensionInfo(dimensions) {\n return clone(dimensions);\n}\n\nvar externalTransformMap = createHashMap();\nexport function registerExternalTransform(externalTransform) {\n externalTransform = clone(externalTransform);\n var type = externalTransform.type;\n var errMsg = '';\n\n if (!type) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have a `type` when `registerTransform`.';\n }\n\n throwError(errMsg);\n }\n\n var typeParsed = type.split(':');\n\n if (typeParsed.length !== 2) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Name must include namespace like \"ns:regression\".';\n }\n\n throwError(errMsg);\n } // Namespace 'echarts:xxx' is official namespace, where the transforms should\n // be called directly via 'xxx' rather than 'echarts:xxx'.\n\n\n var isBuiltIn = false;\n\n if (typeParsed[0] === 'echarts') {\n type = typeParsed[1];\n isBuiltIn = true;\n }\n\n externalTransform.__isBuiltIn = isBuiltIn;\n externalTransformMap.set(type, externalTransform);\n}\nexport function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\n var pipedTransOption = normalizeToArray(rawTransOption);\n var pipeLen = pipedTransOption.length;\n var errMsg = '';\n\n if (!pipeLen) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'If `transform` declared, it should at least contain one transform.';\n }\n\n throwError(errMsg);\n }\n\n for (var i = 0, len = pipeLen; i < len; i++) {\n var transOption = pipedTransOption[i];\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i); // piped transform only support single input, except the fist one.\n // piped transform only support single output, except the last one.\n\n if (i !== len - 1) {\n sourceList.length = Math.max(sourceList.length, 1);\n }\n }\n\n return sourceList;\n}\n\nfunction applySingleDataTransform(transOption, upSourceList, infoForPrint, // If `pipeIndex` is null/undefined, no piped transform.\npipeIndex) {\n var errMsg = '';\n\n if (!upSourceList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have at least one upstream dataset.';\n }\n\n throwError(errMsg);\n }\n\n if (!isObject(transOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\n }\n\n throwError(errMsg);\n }\n\n var transType = transOption.type;\n var externalTransform = externalTransformMap.get(transType);\n\n if (!externalTransform) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not find transform on type \"' + transType + '\".';\n }\n\n throwError(errMsg);\n } // Prepare source\n\n\n var extUpSourceList = map(upSourceList, function (upSource) {\n return createExternalSource(upSource, externalTransform);\n });\n var resultList = normalizeToArray(externalTransform.transform({\n upstream: extUpSourceList[0],\n upstreamList: extUpSourceList,\n config: clone(transOption.config)\n }));\n\n if (process.env.NODE_ENV !== 'production') {\n if (transOption.print) {\n var printStrArr = map(resultList, function (extSource) {\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\n return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\\n');\n }).join('\\n');\n consoleLog(printStrArr);\n }\n }\n\n return map(resultList, function (result, resultIndex) {\n var errMsg = '';\n\n if (!isObject(result)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'A transform should not return some empty results.';\n }\n\n throwError(errMsg);\n }\n\n if (!result.data) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be not be null or undefined';\n }\n\n throwError(errMsg);\n }\n\n var sourceFormat = detectSourceFormat(result.data);\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be array rows or object rows.';\n }\n\n throwError(errMsg);\n }\n\n var resultMetaRawOption;\n var firstUpSource = upSourceList[0];\n /**\n * Intuitively, the end users known the content of the original `dataset.source`,\n * calucating the transform result in mind.\n * Suppose the original `dataset.source` is:\n * ```js\n * [\n * ['product', '2012', '2013', '2014', '2015'],\n * ['AAA', 41.1, 30.4, 65.1, 53.3],\n * ['BBB', 86.5, 92.1, 85.7, 83.1],\n * ['CCC', 24.1, 67.2, 79.5, 86.4]\n * ]\n * ```\n * The dimension info have to be detected from the source data.\n * Some of the transformers (like filter, sort) will follow the dimension info\n * of upstream, while others use new dimensions (like aggregate).\n * Transformer can output a field `dimensions` to define the its own output dimensions.\n * We also allow transformers to ignore the output `dimensions` field, and\n * inherit the upstream dimensions definition. It can reduce the burden of handling\n * dimensions in transformers.\n *\n * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n */\n\n if (firstUpSource && resultIndex === 0 // If transformer returns `dimensions`, it means that the transformer has different\n // dimensions definitions. We do not inherit anything from upstream.\n && !result.dimensions) {\n var startIndex = firstUpSource.startIndex; // We copy the header of upstream to the result becuase:\n // (1) The returned data always does not contain header line and can not be used\n // as dimension-detection. In this case we can not use \"detected dimensions\" of\n // upstream directly, because it might be detected based on different `seriesLayoutBy`.\n // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.\n // So the original detected header should be add to the result, otherwise they can not be read.\n\n if (startIndex) {\n result.data = firstUpSource.data.slice(0, startIndex).concat(result.data);\n }\n\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: startIndex,\n dimensions: firstUpSource.metaRawOption.dimensions\n };\n } else {\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: 0,\n dimensions: result.dimensions\n };\n }\n\n return createSource(result.data, resultMetaRawOption, null, null);\n });\n}\n\nfunction isSupportedSourceFormat(sourceFormat) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, createHashMap, assert } from 'zrender/lib/core/util';\nimport { VISUAL_DIMENSIONS } from '../../util/types';\nexport function summarizeDimensions(data) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = createHashMap();\n var defaultedLabel = [];\n var defaultedTooltip = []; // See the comment of `List.js#userOutput`.\n\n var userOutput = summary.userOutput = {\n dimensionNames: data.dimensions.slice(),\n encode: {}\n };\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\n }\n\n var coordDimIndex = dimItem.coordDimIndex;\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\n\n if (!dimItem.isExtraCoord) {\n notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label,\n // because when dataset is used, it is hard to guess which dimension\n // can be value dimension. If both show x, y on label is not look good,\n // and conventionally y axis is focused more.\n\n if (mayLabelDimType(dimItem.type)) {\n defaultedLabel[0] = dimName;\n } // User output encode do not contain generated coords.\n // And it only has index. User can use index to retrieve value from the raw item array.\n\n\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n encodeArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim];\n encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data\n // dim canot on more than one coordDim.\n\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\n });\n summary.dataDimsOnCoord = dataDimsOnCoord;\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set\n // in this way. Use label.formatter instead. May be remove this approach someday.\n\n if (encodeLabel && encodeLabel.length) {\n defaultedLabel = encodeLabel.slice();\n }\n\n var encodeTooltip = encode.tooltip;\n\n if (encodeTooltip && encodeTooltip.length) {\n defaultedTooltip = encodeTooltip.slice();\n } else if (!defaultedTooltip.length) {\n defaultedTooltip = defaultedLabel.slice();\n }\n\n encode.defaultedLabel = defaultedLabel;\n encode.defaultedTooltip = defaultedTooltip;\n return summary;\n}\n\nfunction getOrCreateEncodeArr(encode, dim) {\n if (!encode.hasOwnProperty(dim)) {\n encode[dim] = [];\n }\n\n return encode[dim];\n} // FIXME:TS should be type `AxisType`\n\n\nexport function getDimensionTypeByAxis(axisType) {\n return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float';\n}\n\nfunction mayLabelDimType(dimType) {\n // In most cases, ordinal and time do not suitable for label.\n // Ordinal info can be displayed on axis. Time is too long.\n return !(dimType === 'ordinal' || dimType === 'time');\n} // function findTheLastDimMayLabel(data) {\n// // Get last value dim\n// let dimensions = data.dimensions.slice();\n// let valueType;\n// let valueDim;\n// while (dimensions.length && (\n// valueDim = dimensions.pop(),\n// valueType = data.getDimensionInfo(valueDim).type,\n// valueType === 'ordinal' || valueType === 'time'\n// )) {} // jshint ignore:line\n// return valueDim;\n// }","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @deprecated\n * Use `echarts/data/helper/createDimensions` instead.\n */\nimport { createHashMap, each, isString, defaults, extend, isObject, clone } from 'zrender/lib/core/util';\nimport { normalizeToArray } from '../../util/model';\nimport { guessOrdinal, BE_ORDINAL } from './sourceHelper';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source';\nimport { VISUAL_DIMENSIONS } from '../../util/types';\nimport DataDimensionInfo from '../DataDimensionInfo';\n/**\n * @see {module:echarts/test/ut/spec/data/completeDimensions}\n *\n * This method builds the relationship between:\n * + \"what the coord sys or series requires (see `sysDims`)\",\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimsDef` and `opt.encodeDef`)\"\n * + \"what the data source provids (see `source`)\".\n *\n * Some guess strategy will be adapted if user does not define something.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which\n * provides not only dim template, but also default order.\n * properties: 'name', 'type', 'displayName'.\n * `name` of each item provides default coord name.\n * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and\n * provide dims count that the sysDim required.\n * [{ordinalMeta}] can be specified.\n * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)\n * @param {Object} [opt]\n * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions\n * For example: ['asdf', {name, type}, ...].\n * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}\n * @param {Function} [opt.encodeDefaulter] Called if no `opt.encodeDef` exists.\n * If not specified, auto find the next available data dim.\n * param source {module:data/Source}\n * param dimCount {number}\n * return {Object} encode Never be `null/undefined`.\n * @param {string} [opt.generateCoord] Generate coord dim with the given name.\n * If not specified, extra dim names will be:\n * 'value', 'value0', 'value1', ...\n * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.\n * If `generateCoordCount` specified, the generated dim names will be:\n * `generateCoord` + 0, `generateCoord` + 1, ...\n * can be Infinity, indicate that use all of the remain columns.\n * @param {number} [opt.dimCount] If not specified, guess by the first data item.\n * @return {Array.}\n */\n\nfunction completeDimensions(sysDims, source, opt) {\n if (!isSourceInstance(source)) {\n source = createSourceFromSeriesDataOption(source);\n }\n\n opt = opt || {};\n sysDims = (sysDims || []).slice();\n var dimsDef = (opt.dimsDef || []).slice();\n var dataDimNameMap = createHashMap();\n var coordDimNameMap = createHashMap(); // let valueCandidate;\n\n var result = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); // Apply user defined dims (`name` and `type`) and init result.\n\n for (var i = 0; i < dimCount; i++) {\n var dimDefItemRaw = dimsDef[i];\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : {\n name: dimDefItemRaw\n });\n var userDimName = dimDefItem.name;\n var resultItem = result[i] = new DataDimensionInfo(); // Name will be applied later for avoiding duplication.\n\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n // Only if `series.dimensions` is defined in option\n // displayName, will be set, and dimension will be diplayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n dataDimNameMap.set(userDimName, i);\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n }\n\n var encodeDef = opt.encodeDef;\n\n if (!encodeDef && opt.encodeDefaulter) {\n encodeDef = opt.encodeDefaulter(source, dimCount);\n }\n\n var encodeDefMap = createHashMap(encodeDef); // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.\n\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\n var dataDims = normalizeToArray(dataDimsRaw).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n // this case.\n\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\n encodeDefMap.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDefMap.set(coordDim, []);\n each(dataDims, function (resultDimIdxOrName, idx) {\n // The input resultDimIdx can be dim name or index.\n var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(result[resultDimIdx], coordDim, idx);\n }\n });\n }); // Apply templetes and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItemRaw) {\n var coordDim;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n var sysDimItem;\n\n if (isString(sysDimItemRaw)) {\n coordDim = sysDimItemRaw;\n sysDimItem = {};\n } else {\n sysDimItem = sysDimItemRaw;\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = clone(sysDimItem);\n sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly.\n\n sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemOtherDims = sysDimItem.otherDims;\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n }\n\n var dataDims = encodeDefMap.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences.\n\n if (!dataDims.length) {\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < result.length && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = result[resultDimIdx];\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n\n if (resultItem.name == null && sysDimItemDimsDef) {\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n name: sysDimItemDimsDefItem\n });\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n\n\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n });\n });\n\n function applyDim(resultItem, coordDim, coordDimIndex) {\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\n resultItem.otherDims[coordDim] = coordDimIndex;\n } else {\n resultItem.coordDim = coordDim;\n resultItem.coordDimIndex = coordDimIndex;\n coordDimNameMap.set(coordDim, true);\n }\n } // Make sure the first extra dim is 'value'.\n\n\n var generateCoord = opt.generateCoord;\n var generateCoordCount = opt.generateCoordCount;\n var fromZero = generateCoordCount != null;\n generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n var extra = generateCoord || 'value'; // Set dim `name` and other `coordDim` and other props.\n\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0;\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\n\n if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must // Consider the case:\n // {\n // dataset: {source: [\n // ['2001', 123],\n // ['2002', 456],\n // ...\n // ['The others', 987],\n // ]},\n // series: {type: 'pie'}\n // }\n // The first colum should better be treated as a \"ordinal\" although it\n // might not able to be detected as an \"ordinal\" by `guessOrdinal`.\n || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {\n resultItem.type = 'ordinal';\n }\n }\n\n return result;\n} // ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calcualte bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in storage?\n\n\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n // Note that the result dimCount should not small than columns count\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef;\n\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\n }\n });\n return dimCount;\n}\n\nfunction genName(name, map, fromZero) {\n if (fromZero || map.get(name) != null) {\n var i = 0;\n\n while (map.get(name + i) != null) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\n}\n\nexport default completeDimensions;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Substitute `completeDimensions`.\n * `completeDimensions` is to be deprecated.\n */\nimport completeDimensions from './completeDimensions';\n/**\n * @param opt.coordDimensions\n * @param opt.dimensionsDefine By default `source.dimensionsDefine` Overwrite source define.\n * @param opt.encodeDefine By default `source.encodeDefine` Overwrite source define.\n * @param opt.encodeDefaulter Make default encode if user not specified.\n */\n\nexport default function createDimensions( // TODO: TYPE completeDimensions type\nsource, opt) {\n opt = opt || {};\n return completeDimensions(opt.coordDimensions || [], source, {\n // FIXME:TS detect whether source then call `.dimensionsDefine` and `.encodeDefine`?\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\n encodeDef: opt.encodeDefine || source.encodeDefine,\n dimCount: opt.dimensionsCount,\n encodeDefaulter: opt.encodeDefaulter,\n generateCoord: opt.generateCoord,\n generateCoordCount: opt.generateCoordCount\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { setAsPrimitive, map, isTypedArray, assert, each, retrieve2 } from 'zrender/lib/core/util';\nimport { createSource, cloneSourceShallow } from '../Source';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../../util/types';\nimport { querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels } from './sourceHelper';\nimport { applyDataTransform } from './transform';\n/**\n * [REQUIREMENT_MEMO]:\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\n * `root-dataset`. Them on `series` has higher priority.\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\n * confuse users: whether those props indicate how to visit the upstream source or visit\n * the transform result source, and some transforms has nothing to do with these props,\n * and some transforms might have multiple upstream.\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\n * declared in `root-dataset`.\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\n * That is for reducing complexity in transfroms.\n * PENDING: Whether to provide transposition transform?\n *\n * [IMPLEMENTAION_MEMO]:\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\n * They will not be calculated until `source` is about to be visited (to prevent from\n * duplicate calcuation). `source` is visited only in series and input to transforms.\n *\n * [DIMENSION_INHERIT_RULE]:\n * By default the dimensions are inherited from ancestors, unless a transform return\n * a new dimensions definition.\n * Consider the case:\n * ```js\n * dataset: [{\n * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\n * }, {\n * transform: { type: 'filter', ... }\n * }]\n * dataset: [{\n * dimension: ['Product', 'Sales', 'Prise'],\n * source: [ ['Cookies', 321, 44.21], ...]\n * }, {\n * transform: { type: 'filter', ... }\n * }]\n * ```\n * The two types of option should have the same behavior after transform.\n *\n *\n * [SCENARIO]:\n * (1) Provide source data directly:\n * ```js\n * series: {\n * encode: {...},\n * dimensions: [...]\n * seriesLayoutBy: 'row',\n * data: [[...]]\n * }\n * ```\n * (2) Series refer to dataset.\n * ```js\n * series: [{\n * encode: {...}\n * // Ignore datasetIndex means `datasetIndex: 0`\n * // and the dimensions defination in dataset is used\n * }, {\n * encode: {...},\n * seriesLayoutBy: 'column',\n * datasetIndex: 1\n * }]\n * ```\n * (3) dataset transform\n * ```js\n * dataset: [{\n * source: [...]\n * }, {\n * source: [...]\n * }, {\n * // By default from 0.\n * transform: { type: 'filter', config: {...} }\n * }, {\n * // Piped.\n * transform: [\n * { type: 'filter', config: {...} },\n * { type: 'sort', config: {...} }\n * ]\n * }, {\n * id: 'regressionData',\n * fromDatasetIndex: 1,\n * // Third-party transform\n * transform: { type: 'ecStat:regression', config: {...} }\n * }, {\n * // retrieve the extra result.\n * id: 'regressionFormula',\n * fromDatasetId: 'regressionData',\n * fromTransformResult: 1\n * }]\n * ```\n */\n\nvar SourceManager =\n/** @class */\nfunction () {\n function SourceManager(sourceHost) {\n // Cached source. Do not repeat calculating if not dirty.\n this._sourceList = []; // version sign of each upstream source manager.\n\n this._upstreamSignList = [];\n this._versionSignBase = 0;\n this._sourceHost = sourceHost;\n }\n /**\n * Mark dirty.\n */\n\n\n SourceManager.prototype.dirty = function () {\n this._setLocalSource([], []);\n };\n\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\n this._sourceList = sourceList;\n this._upstreamSignList = upstreamSignList;\n this._versionSignBase++;\n\n if (this._versionSignBase > 9e10) {\n this._versionSignBase = 0;\n }\n };\n /**\n * For detecting whether the upstream source is dirty, so that\n * the local cached source (in `_sourceList`) should be discarded.\n */\n\n\n SourceManager.prototype._getVersionSign = function () {\n return this._sourceHost.uid + '_' + this._versionSignBase;\n };\n /**\n * Always return a source instance. Otherwise throw error.\n */\n\n\n SourceManager.prototype.prepareSource = function () {\n // For the case that call `setOption` multiple time but no data changed,\n // cache the result source to prevent from repeating transform.\n if (this._isDirty()) {\n this._createSource();\n }\n };\n\n SourceManager.prototype._createSource = function () {\n this._setLocalSource([], []);\n\n var sourceHost = this._sourceHost;\n\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n var hasUpstream = !!upSourceMgrList.length;\n var resultSourceList;\n var upstreamSignList;\n\n if (isSeries(sourceHost)) {\n var seriesModel = sourceHost;\n var data = void 0;\n var sourceFormat = void 0;\n var upSource = void 0; // Has upstream dataset\n\n if (hasUpstream) {\n var upSourceMgr = upSourceMgrList[0];\n upSourceMgr.prepareSource();\n upSource = upSourceMgr.getSource();\n data = upSource.data;\n sourceFormat = upSource.sourceFormat;\n upstreamSignList = [upSourceMgr._getVersionSign()];\n } // Series data is from own.\n else {\n data = seriesModel.get('data', true);\n sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\n upstreamSignList = [];\n } // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\n\n\n var newMetaRawOption = this._getSourceMetaRawOption();\n\n var upMetaRawOption = upSource ? upSource.metaRawOption : null;\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption ? upMetaRawOption.seriesLayoutBy : null);\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption ? upMetaRawOption.sourceHeader : null); // Note here we should not use `upSource.dimensionsDefine`. Consider the case:\n // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`,\n // but series need `seriesLayoutBy: 'row'`.\n\n var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption ? upMetaRawOption.dimensions : null);\n resultSourceList = [createSource(data, {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n }, sourceFormat, seriesModel.get('encode', true))];\n } else {\n var datasetModel = sourceHost; // Has upstream dataset.\n\n if (hasUpstream) {\n var result = this._applyTransform(upSourceMgrList);\n\n resultSourceList = result.sourceList;\n upstreamSignList = result.upstreamSignList;\n } // Is root dataset.\n else {\n var sourceData = datasetModel.get('source', true);\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, // Note: dataset option does not have `encode`.\n null)];\n upstreamSignList = [];\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(resultSourceList && upstreamSignList);\n }\n\n this._setLocalSource(resultSourceList, upstreamSignList);\n };\n\n SourceManager.prototype._applyTransform = function (upMgrList) {\n var datasetModel = this._sourceHost;\n var transformOption = datasetModel.get('transform', true);\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(fromTransformResult != null || transformOption != null);\n }\n\n if (fromTransformResult != null) {\n var errMsg = '';\n\n if (upMgrList.length !== 1) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\n }\n\n doThrow(errMsg);\n }\n }\n\n var sourceList;\n var upSourceList = [];\n var upstreamSignList = [];\n each(upMgrList, function (upMgr) {\n upMgr.prepareSource();\n var upSource = upMgr.getSource(fromTransformResult || 0);\n var errMsg = '';\n\n if (fromTransformResult != null && !upSource) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\n }\n\n doThrow(errMsg);\n }\n\n upSourceList.push(upSource);\n upstreamSignList.push(upMgr._getVersionSign());\n });\n\n if (transformOption) {\n sourceList = applyDataTransform(transformOption, upSourceList, {\n datasetIndex: datasetModel.componentIndex\n });\n } else if (fromTransformResult != null) {\n sourceList = [cloneSourceShallow(upSourceList[0])];\n }\n\n return {\n sourceList: sourceList,\n upstreamSignList: upstreamSignList\n };\n };\n\n SourceManager.prototype._isDirty = function () {\n var sourceList = this._sourceList;\n\n if (!sourceList.length) {\n return true;\n } // All sourceList is from the some upsteam.\n\n\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n for (var i = 0; i < upSourceMgrList.length; i++) {\n var upSrcMgr = upSourceMgrList[i];\n\n if ( // Consider the case that there is ancestor diry, call it recursively.\n // The performance is probably not an issue because usually the chain is not long.\n upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\n return true;\n }\n }\n };\n /**\n * @param sourceIndex By defualt 0, means \"main source\".\n * Most cases there is only one source.\n */\n\n\n SourceManager.prototype.getSource = function (sourceIndex) {\n return this._sourceList[sourceIndex || 0];\n };\n /**\n * PEDING: Is it fast enough?\n * If no upstream, return empty array.\n */\n\n\n SourceManager.prototype._getUpstreamSourceManagers = function () {\n // Always get the relationship from the raw option.\n // Do not cache the link of the dependency graph, so that\n // no need to update them when change happen.\n var sourceHost = this._sourceHost;\n\n if (isSeries(sourceHost)) {\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\n } else {\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) {\n return datasetModel.getSourceManager();\n });\n }\n };\n\n SourceManager.prototype._getSourceMetaRawOption = function () {\n var sourceHost = this._sourceHost;\n var seriesLayoutBy;\n var sourceHeader;\n var dimensions;\n\n if (isSeries(sourceHost)) {\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\n sourceHeader = sourceHost.get('sourceHeader', true);\n dimensions = sourceHost.get('dimensions', true);\n } // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them.\n else if (!this._getUpstreamSourceManagers().length) {\n var model = sourceHost;\n seriesLayoutBy = model.get('seriesLayoutBy', true);\n sourceHeader = model.get('sourceHeader', true);\n dimensions = model.get('dimensions', true);\n }\n\n return {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n };\n };\n\n return SourceManager;\n}();\n\nexport { SourceManager }; // Call this method after `super.init` and `super.mergeOption` to\n// disable the transform merge, but do not disable transfrom clone from rawOption.\n\nexport function disableTransformOptionMerge(datasetModel) {\n var transformOption = datasetModel.option.transform;\n transformOption && setAsPrimitive(datasetModel.option.transform);\n}\n\nfunction isSeries(sourceHost) {\n // Avoid circular dependency with Series.ts\n return sourceHost.mainType === 'series';\n}\n\nfunction doThrow(errMsg) {\n throw new Error(errMsg);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util'; // id may be function name of Object, add a prefix to avoid this problem.\n\nfunction generateNodeKey(id) {\n return '_EC_' + id;\n}\n\nvar Graph =\n/** @class */\nfunction () {\n function Graph(directed) {\n this.type = 'graph';\n this.nodes = [];\n this.edges = [];\n this._nodesMap = {};\n /**\n * @type {Object.}\n * @private\n */\n\n this._edgesMap = {};\n this._directed = directed || false;\n }\n /**\n * If is directed graph\n */\n\n\n Graph.prototype.isDirected = function () {\n return this._directed;\n };\n\n ;\n /**\n * Add a new node\n */\n\n Graph.prototype.addNode = function (id, dataIndex) {\n id = id == null ? '' + dataIndex : '' + id;\n var nodesMap = this._nodesMap;\n\n if (nodesMap[generateNodeKey(id)]) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Graph nodes have duplicate name or id');\n }\n\n return;\n }\n\n var node = new GraphNode(id, dataIndex);\n node.hostGraph = this;\n this.nodes.push(node);\n nodesMap[generateNodeKey(id)] = node;\n return node;\n };\n\n ;\n /**\n * Get node by data index\n */\n\n Graph.prototype.getNodeByIndex = function (dataIndex) {\n var rawIdx = this.data.getRawIndex(dataIndex);\n return this.nodes[rawIdx];\n };\n\n ;\n /**\n * Get node by id\n */\n\n Graph.prototype.getNodeById = function (id) {\n return this._nodesMap[generateNodeKey(id)];\n };\n\n ;\n /**\n * Add a new edge\n */\n\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\n var nodesMap = this._nodesMap;\n var edgesMap = this._edgesMap; // PNEDING\n\n if (typeof n1 === 'number') {\n n1 = this.nodes[n1];\n }\n\n if (typeof n2 === 'number') {\n n2 = this.nodes[n2];\n }\n\n if (!(n1 instanceof GraphNode)) {\n n1 = nodesMap[generateNodeKey(n1)];\n }\n\n if (!(n2 instanceof GraphNode)) {\n n2 = nodesMap[generateNodeKey(n2)];\n }\n\n if (!n1 || !n2) {\n return;\n }\n\n var key = n1.id + '-' + n2.id;\n var edge = new GraphEdge(n1, n2, dataIndex);\n edge.hostGraph = this;\n\n if (this._directed) {\n n1.outEdges.push(edge);\n n2.inEdges.push(edge);\n }\n\n n1.edges.push(edge);\n\n if (n1 !== n2) {\n n2.edges.push(edge);\n }\n\n this.edges.push(edge);\n edgesMap[key] = edge;\n return edge;\n };\n\n ;\n /**\n * Get edge by data index\n */\n\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\n return this.edges[rawIdx];\n };\n\n ;\n /**\n * Get edge by two linked nodes\n */\n\n Graph.prototype.getEdge = function (n1, n2) {\n if (n1 instanceof GraphNode) {\n n1 = n1.id;\n }\n\n if (n2 instanceof GraphNode) {\n n2 = n2.id;\n }\n\n var edgesMap = this._edgesMap;\n\n if (this._directed) {\n return edgesMap[n1 + '-' + n2];\n } else {\n return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1];\n }\n };\n\n ;\n /**\n * Iterate all nodes\n */\n\n Graph.prototype.eachNode = function (cb, context) {\n var nodes = this.nodes;\n var len = nodes.length;\n\n for (var i = 0; i < len; i++) {\n if (nodes[i].dataIndex >= 0) {\n cb.call(context, nodes[i], i);\n }\n }\n };\n\n ;\n /**\n * Iterate all edges\n */\n\n Graph.prototype.eachEdge = function (cb, context) {\n var edges = this.edges;\n var len = edges.length;\n\n for (var i = 0; i < len; i++) {\n if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) {\n cb.call(context, edges[i], i);\n }\n }\n };\n\n ;\n /**\n * Breadth first traverse\n * Return true to stop traversing\n */\n\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\n if (!(startNode instanceof GraphNode)) {\n startNode = this._nodesMap[generateNodeKey(startNode)];\n }\n\n if (!startNode) {\n return;\n }\n\n var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges';\n\n for (var i = 0; i < this.nodes.length; i++) {\n this.nodes[i].__visited = false;\n }\n\n if (cb.call(context, startNode, null)) {\n return;\n }\n\n var queue = [startNode];\n\n while (queue.length) {\n var currentNode = queue.shift();\n var edges = currentNode[edgeType];\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n var otherNode = e.node1 === currentNode ? e.node2 : e.node1;\n\n if (!otherNode.__visited) {\n if (cb.call(context, otherNode, currentNode)) {\n // Stop traversing\n return;\n }\n\n queue.push(otherNode);\n otherNode.__visited = true;\n }\n }\n }\n };\n\n ; // TODO\n // depthFirstTraverse(\n // cb, startNode, direction, context\n // ) {\n // };\n // Filter update\n\n Graph.prototype.update = function () {\n var data = this.data;\n var edgeData = this.edgeData;\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n\n edgeData.filterSelf(function (idx) {\n var edge = edges[edgeData.getRawIndex(idx)];\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\n }); // Update edge\n\n for (var i = 0, len = edges.length; i < len; i++) {\n edges[i].dataIndex = -1;\n }\n\n for (var i = 0, len = edgeData.count(); i < len; i++) {\n edges[edgeData.getRawIndex(i)].dataIndex = i;\n }\n };\n\n ;\n /**\n * @return {module:echarts/data/Graph}\n */\n\n Graph.prototype.clone = function () {\n var graph = new Graph(this._directed);\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\n }\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\n }\n\n return graph;\n };\n\n ;\n return Graph;\n}();\n\nvar GraphNode =\n/** @class */\nfunction () {\n function GraphNode(id, dataIndex) {\n this.inEdges = [];\n this.outEdges = [];\n this.edges = [];\n this.dataIndex = -1;\n this.id = id == null ? '' : id;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.degree = function () {\n return this.edges.length;\n };\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.inDegree = function () {\n return this.inEdges.length;\n };\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.outDegree = function () {\n return this.outEdges.length;\n };\n\n GraphNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphNode.prototype.getAdjacentDataIndices = function () {\n var dataIndices = {\n edge: [],\n node: []\n };\n\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n\n dataIndices.edge.push(adjacentEdge.dataIndex);\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\n }\n\n return dataIndices;\n };\n\n return GraphNode;\n}();\n\nvar GraphEdge =\n/** @class */\nfunction () {\n function GraphEdge(n1, n2, dataIndex) {\n this.dataIndex = -1;\n this.node1 = n1;\n this.node2 = n2;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n\n GraphEdge.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphEdge.prototype.getAdjacentDataIndices = function () {\n return {\n edge: [this.dataIndex],\n node: [this.node1.dataIndex, this.node2.dataIndex]\n };\n };\n\n return GraphEdge;\n}();\n\nfunction createGraphDataProxyMixin(hostName, dataName) {\n return {\n /**\n * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.\n */\n getValue: function (dimension) {\n var data = this[hostName][dataName];\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\n },\n // TODO: TYPE stricter type.\n setVisual: function (key, value) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\n },\n getVisual: function (key) {\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\n },\n setLayout: function (layout, merge) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\n },\n getLayout: function () {\n return this[hostName][dataName].getItemLayout(this.dataIndex);\n },\n getGraphicEl: function () {\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\n },\n getRawIndex: function () {\n return this[hostName][dataName].getRawIndex(this.dataIndex);\n }\n };\n}\n\n;\n;\n;\nzrUtil.mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\nzrUtil.mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\nexport default Graph;\nexport { GraphNode, GraphEdge };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Link lists and struct (graph or tree)\n */\nimport { curry, each, assert, extend, map, keys } from 'zrender/lib/core/util';\nimport { makeInner } from '../../util/model';\nvar inner = makeInner();\n\nfunction linkList(opt) {\n var mainData = opt.mainData;\n var datas = opt.datas;\n\n if (!datas) {\n datas = {\n main: mainData\n };\n opt.datasAttr = {\n main: 'data'\n };\n }\n\n opt.datas = opt.mainData = null;\n linkAll(mainData, datas, opt); // Porxy data original methods.\n\n each(datas, function (data) {\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\n data.wrapMethod(methodName, curry(transferInjection, opt));\n });\n }); // Beyond transfer, additional features should be added to `cloneShallow`.\n\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger\n // another changable methods, which may bring about dead lock.\n\n each(mainData.CHANGABLE_METHODS, function (methodName) {\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\n }); // Make sure datas contains mainData.\n\n assert(datas[mainData.dataType] === mainData);\n}\n\nfunction transferInjection(opt, res) {\n if (isMainData(this)) {\n // Transfer datas to new main data.\n var datas = extend({}, inner(this).datas);\n datas[this.dataType] = res;\n linkAll(res, datas, opt);\n } else {\n // Modify the reference in main data to point newData.\n linkSingle(res, this.dataType, inner(this).mainData, opt);\n }\n\n return res;\n}\n\nfunction changeInjection(opt, res) {\n opt.struct && opt.struct.update();\n return res;\n}\n\nfunction cloneShallowInjection(opt, res) {\n // cloneShallow, which brings about some fragilities, may be inappropriate\n // to be exposed as an API. So for implementation simplicity we can make\n // the restriction that cloneShallow of not-mainData should not be invoked\n // outside, but only be invoked here.\n each(inner(res).datas, function (data, dataType) {\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\n });\n return res;\n}\n/**\n * Supplement method to List.\n *\n * @public\n * @param [dataType] If not specified, return mainData.\n */\n\n\nfunction getLinkedData(dataType) {\n var mainData = inner(this).mainData;\n return dataType == null || mainData == null ? mainData : inner(mainData).datas[dataType];\n}\n/**\n * Get list of all linked data\n */\n\n\nfunction getLinkedDataAll() {\n var mainData = inner(this).mainData;\n return mainData == null ? [{\n data: mainData\n }] : map(keys(inner(mainData).datas), function (type) {\n return {\n type: type,\n data: inner(mainData).datas[type]\n };\n });\n}\n\nfunction isMainData(data) {\n return inner(data).mainData === data;\n}\n\nfunction linkAll(mainData, datas, opt) {\n inner(mainData).datas = {};\n each(datas, function (data, dataType) {\n linkSingle(data, dataType, mainData, opt);\n });\n}\n\nfunction linkSingle(data, dataType, mainData, opt) {\n inner(mainData).datas[dataType] = data;\n inner(data).mainData = mainData;\n data.dataType = dataType;\n\n if (opt.struct) {\n data[opt.structAttr] = opt.struct;\n opt.struct[opt.datasAttr[dataType]] = data;\n } // Supplement method.\n\n\n data.getLinkedData = getLinkedData;\n data.getLinkedDataAll = getLinkedDataAll;\n}\n\nexport default linkList;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isTypedArray, clone, createHashMap, isArray, isObject, isArrayLike, hasOwn, assert, each, map, isNumber, isString } from 'zrender/lib/core/util';\nimport { SOURCE_FORMAT_ORIGINAL, SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_UNKNOWN, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW } from '../util/types';\nimport { getDataItemValue } from '../util/model';\n; // @inner\n\nvar SourceImpl =\n/** @class */\nfunction () {\n // readonly frozen: boolean;\n function SourceImpl(fields) {\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; // Visit config\n\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n this.startIndex = fields.startIndex || 0;\n this.dimensionsDefine = fields.dimensionsDefine;\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\n this.encodeDefine = fields.encodeDefine;\n this.metaRawOption = fields.metaRawOption;\n }\n\n return SourceImpl;\n}();\n\nexport function isSourceInstance(val) {\n return val instanceof SourceImpl;\n}\nexport function createSource(sourceData, thisMetaRawOption, // can be null. If not provided, auto detect it from `sourceData`.\nsourceFormat, encodeDefine // can be null\n) {\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\n var source = new SourceImpl({\n data: sourceData,\n sourceFormat: sourceFormat,\n seriesLayoutBy: seriesLayoutBy,\n dimensionsDefine: determined.dimensionsDefine,\n startIndex: determined.startIndex,\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\n encodeDefine: makeEncodeDefine(encodeDefine),\n metaRawOption: clone(thisMetaRawOption)\n });\n return source;\n}\n/**\n * Wrap original series data for some compatibility cases.\n */\n\nexport function createSourceFromSeriesDataOption(data) {\n return new SourceImpl({\n data: data,\n sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL\n });\n}\n/**\n * Clone source but excludes source data.\n */\n\nexport function cloneSourceShallow(source) {\n return new SourceImpl({\n data: source.data,\n sourceFormat: source.sourceFormat,\n seriesLayoutBy: source.seriesLayoutBy,\n dimensionsDefine: clone(source.dimensionsDefine),\n startIndex: source.startIndex,\n dimensionsDetectedCount: source.dimensionsDetectedCount,\n encodeDefine: makeEncodeDefine(source.encodeDefine)\n });\n}\n\nfunction makeEncodeDefine(encodeDefine) {\n // null means user not specify `series.encode`.\n return encodeDefine ? createHashMap(encodeDefine) : null;\n}\n/**\n * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.\n */\n\n\nexport function detectSourceFormat(data) {\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\n\n if (isTypedArray(data)) {\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\n } else if (isArray(data)) {\n // FIXME Whether tolerate null in top level array?\n if (data.length === 0) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n }\n\n for (var i = 0, len = data.length; i < len; i++) {\n var item = data[i];\n\n if (item == null) {\n continue;\n } else if (isArray(item)) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n break;\n } else if (isObject(item)) {\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\n break;\n }\n }\n } else if (isObject(data)) {\n for (var key in data) {\n if (hasOwn(data, key) && isArrayLike(data[key])) {\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n break;\n }\n }\n }\n\n return sourceFormat;\n}\n/**\n * Determine the source definitions from data standalone dimensions definitions\n * are not specified.\n */\n\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, // standalone raw dimensions definition, like:\n// {\n// dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\n// }\n// in `dataset` or `series`\ndimensionsDefine) {\n var dimensionsDetectedCount;\n var startIndex; // PEDING: could data be null/undefined here?\n // currently, if `dataset.source` not specified, error thrown.\n // if `series.data` not specified, nothing rendered without error thrown.\n // Should test these cases.\n\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n startIndex: startIndex,\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data; // Rule: Most of the first line are string: it is header.\n // Caution: consider a line with 5 string and 1 number,\n // it still can not be sure it is a head, because the\n // 5 string may be 5 values of category columns.\n\n if (sourceHeader === 'auto' || sourceHeader == null) {\n arrayRowsTravelFirst(function (val) {\n // '-' is regarded as null/undefined.\n if (val != null && val !== '-') {\n if (isString(val)) {\n startIndex == null && (startIndex = 1);\n } else {\n startIndex = 0;\n }\n } // 10 is an experience number, avoid long loop.\n\n }, seriesLayoutBy, dataArrayRows, 10);\n } else {\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\n }\n\n if (!dimensionsDefine && startIndex === 1) {\n dimensionsDefine = [];\n arrayRowsTravelFirst(function (val, index) {\n dimensionsDefine[index] = val != null ? val + '' : '';\n }, seriesLayoutBy, dataArrayRows, Infinity);\n }\n\n dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n each(data, function (colArr, key) {\n dimensionsDefine.push(key);\n });\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var value0 = getDataItemValue(data[0]);\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\n } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\n }\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n}\n\nfunction objectRowsCollectDimensions(data) {\n var firstIndex = 0;\n var obj;\n\n while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line\n\n\n if (obj) {\n var dimensions_1 = [];\n each(obj, function (value, key) {\n dimensions_1.push(key);\n });\n return dimensions_1;\n }\n} // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],\n// which is reasonable. But dimension name is duplicated.\n// Returns undefined or an array contains only object without null/undefiend or string.\n\n\nfunction normalizeDimensionsOption(dimensionsDefine) {\n if (!dimensionsDefine) {\n // The meaning of null/undefined is different from empty array.\n return;\n }\n\n var nameMap = createHashMap();\n return map(dimensionsDefine, function (rawItem, index) {\n rawItem = isObject(rawItem) ? rawItem : {\n name: rawItem\n }; // Other fields will be discarded.\n\n var item = {\n name: rawItem.name,\n displayName: rawItem.displayName,\n type: rawItem.type\n }; // User can set null in dimensions.\n // We dont auto specify name, othewise a given name may\n // cause it be refered unexpectedly.\n\n if (item.name == null) {\n return item;\n } // Also consider number form like 2012.\n\n\n item.name += ''; // User may also specify displayName.\n // displayName will always exists except user not\n // specified or dim name is not specified or detected.\n // (A auto generated dim name will not be used as\n // displayName).\n\n if (item.displayName == null) {\n item.displayName = item.name;\n }\n\n var exist = nameMap.get(item.name);\n\n if (!exist) {\n nameMap.set(item.name, {\n count: 1\n });\n } else {\n item.name += '-' + exist.count++;\n }\n\n return item;\n });\n}\n\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n cb(data[i] ? data[i][0] : null, i);\n }\n } else {\n var value0 = data[0] || [];\n\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\n cb(value0[i], i);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _a, _b, _c; // TODO\n// ??? refactor? check the outer usage of data provider.\n// merge with defaultDimValueGetter?\n\n\nimport { isTypedArray, extend, assert, each, isObject, bind } from 'zrender/lib/core/util';\nimport { getDataItemValue } from '../../util/model';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SERIES_LAYOUT_BY_COLUMN, SERIES_LAYOUT_BY_ROW } from '../../util/types';\nvar providerMethods;\nvar mountMethods;\n/**\n * If normal array used, mutable chunk size is supported.\n * If typed array used, chunk size must be fixed.\n */\n\nvar DefaultDataProvider =\n/** @class */\nfunction () {\n function DefaultDataProvider(sourceParam, dimSize) {\n // let source: Source;\n var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam; // declare source is Source;\n\n this._source = source;\n var data = this._data = source.data; // Typed array. TODO IE10+?\n\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n if (dimSize == null) {\n throw new Error('Typed array data must specify dimension size');\n }\n }\n\n this._offset = 0;\n this._dimSize = dimSize;\n this._data = data;\n }\n\n mountMethods(this, data, source);\n }\n\n DefaultDataProvider.prototype.getSource = function () {\n return this._source;\n };\n\n DefaultDataProvider.prototype.count = function () {\n return 0;\n };\n\n DefaultDataProvider.prototype.getItem = function (idx, out) {\n return;\n };\n\n DefaultDataProvider.prototype.appendData = function (newData) {};\n\n DefaultDataProvider.prototype.clean = function () {};\n\n DefaultDataProvider.protoInitialize = function () {\n // PENDING: To avoid potential incompat (e.g., prototype\n // is visited somewhere), still init them on prototype.\n var proto = DefaultDataProvider.prototype;\n proto.pure = false;\n proto.persistent = true;\n }();\n\n DefaultDataProvider.internalField = function () {\n var _a;\n\n mountMethods = function (provider, data, source) {\n var sourceFormat = source.sourceFormat;\n var seriesLayoutBy = source.seriesLayoutBy;\n var startIndex = source.startIndex;\n var dimsDef = source.dimensionsDefine;\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\n }\n\n extend(provider, methods);\n\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n provider.getItem = getItemForTypedArray;\n provider.count = countForTypedArray;\n provider.fillStorage = fillStorageForTypedArray;\n } else {\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\n }\n };\n\n var getItemForTypedArray = function (idx, out) {\n idx = idx - this._offset;\n out = out || [];\n var data = this._data;\n var dimSize = this._dimSize;\n var offset = dimSize * idx;\n\n for (var i = 0; i < dimSize; i++) {\n out[i] = data[offset + i];\n }\n\n return out;\n };\n\n var fillStorageForTypedArray = function (start, end, storage, extent) {\n var data = this._data;\n var dimSize = this._dimSize;\n\n for (var dim = 0; dim < dimSize; dim++) {\n var dimExtent = extent[dim];\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\n var count = end - start;\n var arr = storage[dim];\n\n for (var i = 0; i < count; i++) {\n // appendData with TypedArray will always do replace in provider.\n var val = data[i * dimSize + dim];\n arr[start + i] = val;\n val < min && (min = val);\n val > max && (max = val);\n }\n\n dimExtent[0] = min;\n dimExtent[1] = max;\n }\n };\n\n var countForTypedArray = function () {\n return this._data ? this._data.length / this._dimSize : 0;\n };\n\n providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\n pure: true,\n appendData: function () {\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\n }\n }, _a[SOURCE_FORMAT_OBJECT_ROWS] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\n pure: true,\n appendData: function (newData) {\n var data = this._data;\n each(newData, function (newCol, key) {\n var oldCol = data[key] || (data[key] = []);\n\n for (var i = 0; i < (newCol || []).length; i++) {\n oldCol.push(newCol[i]);\n }\n });\n }\n }, _a[SOURCE_FORMAT_ORIGINAL] = {\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_TYPED_ARRAY] = {\n persistent: false,\n pure: true,\n appendData: function (newData) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\n }\n\n this._data = newData;\n },\n // Clean self if data is already used.\n clean: function () {\n // PENDING\n this._offset += this.count();\n this._data = null;\n }\n }, _a);\n\n function appendDataSimply(newData) {\n for (var i = 0; i < newData.length; i++) {\n this._data.push(newData[i]);\n }\n }\n }();\n\n return DefaultDataProvider;\n}();\n\nexport { DefaultDataProvider };\n\nvar getItemSimply = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx];\n};\n\nvar rawSourceItemGetterMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx + startIndex];\n}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\n idx += startIndex;\n var item = [];\n var data = rawData;\n\n for (var i = 0; i < data.length; i++) {\n var row = data[i];\n item.push(row ? row[idx] : null);\n }\n\n return item;\n}, _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\n var item = [];\n\n for (var i = 0; i < dimsDef.length; i++) {\n var dimName = dimsDef[i].name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n\n var col = rawData[dimName];\n item.push(col ? col[idx] : null);\n }\n\n return item;\n}, _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _a);\nexport function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n\n return method;\n}\n\nvar countSimply = function (rawData, startIndex, dimsDef) {\n return rawData.length;\n};\n\nvar rawSourceDataCounterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\n return Math.max(0, rawData.length - startIndex);\n}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\n var row = rawData[0];\n return row ? Math.max(0, row.length - startIndex) : 0;\n}, _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\n var dimName = dimsDef[0].name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n\n var col = rawData[dimName];\n return col ? col.length : 0;\n}, _b[SOURCE_FORMAT_ORIGINAL] = countSimply, _b);\nexport function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n\n return method;\n}\n\nvar getRawValueSimply = function (dataItem, dimIndex, dimName) {\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\n};\n\nvar rawSourceValueGetterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\n return dimIndex != null ? dataItem[dimName] : dataItem;\n}, _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\n // FIXME: In some case (markpoint in geo (geo-map.html)),\n // dataItem is {coord: [...]}\n var value = getDataItemValue(dataItem);\n return dimIndex == null || !(value instanceof Array) ? value : value[dimIndex];\n}, _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _c);\nexport function getRawSourceValueGetter(sourceFormat) {\n var method = rawSourceValueGetterMap[sourceFormat];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\n }\n\n return method;\n}\n\nfunction getMethodMapKey(sourceFormat, seriesLayoutBy) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat;\n} // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,\n// Consider persistent.\n// Caution: why use raw value to display on label or tooltip?\n// A reason is to avoid format. For example time value we do not know\n// how to format is expected. More over, if stack is used, calculated\n// value may be 0.91000000001, which have brings trouble to display.\n// TODO: consider how to treat null/undefined/NaN when display?\n\n\nexport function retrieveRawValue(data, dataIndex, dim // If dimIndex is null/undefined, return OptionDataItem.\n// Otherwise, return OptionDataValue.\n) {\n if (!data) {\n return;\n } // Consider data may be not persistent.\n\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (dataItem == null) {\n return;\n }\n\n var sourceFormat = data.getProvider().getSource().sourceFormat;\n var dimName;\n var dimIndex;\n var dimInfo = data.getDimensionInfo(dim);\n\n if (dimInfo) {\n dimName = dimInfo.name;\n dimIndex = dimInfo.index;\n }\n\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\n}\n/**\n * Compatible with some cases (in pie, map) like:\n * data: [{name: 'xx', value: 5, selected: true}, ...]\n * where only sourceFormat is 'original' and 'objectRows' supported.\n *\n * // TODO\n * Supported detail options in data item when using 'arrayRows'.\n *\n * @param data\n * @param dataIndex\n * @param attr like 'selected'\n */\n\nexport function retrieveRawAttr(data, dataIndex, attr) {\n if (!data) {\n return;\n }\n\n var sourceFormat = data.getProvider().getSource().sourceFormat;\n\n if (sourceFormat !== SOURCE_FORMAT_ORIGINAL && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n return;\n }\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject(dataItem)) {\n dataItem = null;\n }\n\n if (dataItem) {\n return dataItem[attr];\n }\n}"],"sourceRoot":""}