cd70545f4e7152296d1f6aae51a2433dab783e1f75fec553296abd9f0d405c2b.json 43 KB

1
  1. {"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\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 * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { setAsPrimitive, map, isTypedArray, assert, each, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createSource, cloneSourceShallow } from '../Source.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\nimport { querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels } from './sourceHelper.js';\nimport { applyDataTransform } from './transform.js';\nimport DataStore from '../DataStore.js';\nimport { DefaultDataProvider } from './dataProvider.js';\n/**\r\n * [REQUIREMENT_MEMO]:\r\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\r\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\r\n * `root-dataset`. Them on `series` has higher priority.\r\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\r\n * confuse users: whether those props indicate how to visit the upstream source or visit\r\n * the transform result source, and some transforms has nothing to do with these props,\r\n * and some transforms might have multiple upstream.\r\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\r\n * declared in `root-dataset`.\r\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\r\n * That is for reducing complexity in transforms.\r\n * PENDING: Whether to provide transposition transform?\r\n *\r\n * [IMPLEMENTAION_MEMO]:\r\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\r\n * They will not be calculated until `source` is about to be visited (to prevent from\r\n * duplicate calcuation). `source` is visited only in series and input to transforms.\r\n *\r\n * [DIMENSION_INHERIT_RULE]:\r\n * By default the dimensions are inherited from ancestors, unless a transform return\r\n * a new dimensions definition.\r\n * Consider the case:\r\n * ```js\r\n * dataset: [{\r\n * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * dataset: [{\r\n * dimension: ['Product', 'Sales', 'Prise'],\r\n * source: [ ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * ```\r\n * The two types of option should have the same behavior after transform.\r\n *\r\n *\r\n * [SCENARIO]:\r\n * (1) Provide source data directly:\r\n * ```js\r\n * series: {\r\n * encode: {...},\r\n * dimensions: [...]\r\n * seriesLayoutBy: 'row',\r\n * data: [[...]]\r\n * }\r\n * ```\r\n * (2) Series refer to dataset.\r\n * ```js\r\n * series: [{\r\n * encode: {...}\r\n * // Ignore datasetIndex means `datasetIndex: 0`\r\n * // and the dimensions defination in dataset is used\r\n * }, {\r\n * encode: {...},\r\n * seriesLayoutBy: 'column',\r\n * datasetIndex: 1\r\n * }]\r\n * ```\r\n * (3) dataset transform\r\n * ```js\r\n * dataset: [{\r\n * source: [...]\r\n * }, {\r\n * source: [...]\r\n * }, {\r\n * // By default from 0.\r\n * transform: { type: 'filter', config: {...} }\r\n * }, {\r\n * // Piped.\r\n * transform: [\r\n * { type: 'filter', config: {...} },\r\n * { type: 'sort', config: {...} }\r\n * ]\r\n * }, {\r\n * id: 'regressionData',\r\n * fromDatasetIndex: 1,\r\n * // Third-party transform\r\n * transform: { type: 'ecStat:regression', config: {...} }\r\n * }, {\r\n * // retrieve the extra result.\r\n * id: 'regressionFormula',\r\n * fromDatasetId: 'regressionData',\r\n * fromTransformResult: 1\r\n * }]\r\n * ```\r\n */\nvar SourceManager = /** @class */function () {\n function SourceManager(sourceHost) {\n // Cached source. Do not repeat calculating if not dirty.\n this._sourceList = [];\n this._storeList = [];\n // version sign of each upstream source manager.\n this._upstreamSignList = [];\n this._versionSignBase = 0;\n this._dirty = true;\n this._sourceHost = sourceHost;\n }\n /**\r\n * Mark dirty.\r\n */\n SourceManager.prototype.dirty = function () {\n this._setLocalSource([], []);\n this._storeList = [];\n this._dirty = true;\n };\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\n this._sourceList = sourceList;\n this._upstreamSignList = upstreamSignList;\n this._versionSignBase++;\n if (this._versionSignBase > 9e10) {\n this._versionSignBase = 0;\n }\n };\n /**\r\n * For detecting whether the upstream source is dirty, so that\r\n * the local cached source (in `_sourceList`) should be discarded.\r\n */\n SourceManager.prototype._getVersionSign = function () {\n return this._sourceHost.uid + '_' + this._versionSignBase;\n };\n /**\r\n * Always return a source instance. Otherwise throw error.\r\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 this._dirty = false;\n }\n };\n SourceManager.prototype._createSource = function () {\n this._setLocalSource([], []);\n var sourceHost = this._sourceHost;\n var upSourceMgrList = this._getUpstreamSourceManagers();\n var hasUpstream = !!upSourceMgrList.length;\n var resultSourceList;\n var upstreamSignList;\n if (isSeries(sourceHost)) {\n var seriesModel = sourceHost;\n var data = void 0;\n var sourceFormat = void 0;\n var upSource = void 0;\n // Has upstream dataset\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 }\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 }\n // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\n var newMetaRawOption = this._getSourceMetaRawOption() || {};\n var upMetaRawOption = upSource && upSource.metaRawOption || {};\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null;\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader);\n // 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 var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions);\n // We share source with dataset as much as possible\n // to avoid extra memory cost of high dimensional data.\n var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions;\n resultSourceList = needsCreateSource ? [createSource(data, {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n }, sourceFormat)] : [];\n } else {\n var datasetModel = sourceHost;\n // Has upstream dataset.\n if (hasUpstream) {\n var result = this._applyTransform(upSourceMgrList);\n resultSourceList = result.sourceList;\n upstreamSignList = result.upstreamSignList;\n }\n // Is root dataset.\n else {\n var sourceData = datasetModel.get('source', true);\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)];\n upstreamSignList = [];\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert(resultSourceList && upstreamSignList);\n }\n this._setLocalSource(resultSourceList, upstreamSignList);\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 if (process.env.NODE_ENV !== 'production') {\n assert(fromTransformResult != null || transformOption != null);\n }\n if (fromTransformResult != null) {\n var errMsg = '';\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 doThrow(errMsg);\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 if (fromTransformResult != null && !upSource) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\n }\n doThrow(errMsg);\n }\n upSourceList.push(upSource);\n upstreamSignList.push(upMgr._getVersionSign());\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 return {\n sourceList: sourceList,\n upstreamSignList: upstreamSignList\n };\n };\n SourceManager.prototype._isDirty = function () {\n if (this._dirty) {\n return true;\n }\n // All sourceList is from the some upstream.\n var upSourceMgrList = this._getUpstreamSourceManagers();\n for (var i = 0; i < upSourceMgrList.length; i++) {\n var upSrcMgr = upSourceMgrList[i];\n if (\n // 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 /**\r\n * @param sourceIndex By default 0, means \"main source\".\r\n * In most cases there is only one source.\r\n */\n SourceManager.prototype.getSource = function (sourceIndex) {\n sourceIndex = sourceIndex || 0;\n var source = this._sourceList[sourceIndex];\n if (!source) {\n // Series may share source instance with dataset.\n var upSourceMgrList = this._getUpstreamSourceManagers();\n return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex);\n }\n return source;\n };\n /**\r\n *\r\n * Get a data store which can be shared across series.\r\n * Only available for series.\r\n *\r\n * @param seriesDimRequest Dimensions that are generated in series.\r\n * Should have been sorted by `storeDimIndex` asc.\r\n */\n SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.');\n }\n var schema = seriesDimRequest.makeStoreSchema();\n return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash);\n };\n SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) {\n // TODO Can use other sourceIndex?\n var sourceIndex = 0;\n var storeList = this._storeList;\n var cachedStoreMap = storeList[sourceIndex];\n if (!cachedStoreMap) {\n cachedStoreMap = storeList[sourceIndex] = {};\n }\n var cachedStore = cachedStoreMap[sourceReadKey];\n if (!cachedStore) {\n var upSourceMgr = this._getUpstreamSourceManagers()[0];\n if (isSeries(this._sourceHost) && upSourceMgr) {\n cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey);\n } else {\n cachedStore = new DataStore();\n // Always create store from source of series.\n cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims);\n }\n cachedStoreMap[sourceReadKey] = cachedStore;\n }\n return cachedStore;\n };\n /**\r\n * PENDING: Is it fast enough?\r\n * If no upstream, return empty array.\r\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 // there is no need to update them when change happens.\n var sourceHost = this._sourceHost;\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 SourceManager.prototype._getSourceMetaRawOption = function () {\n var sourceHost = this._sourceHost;\n var seriesLayoutBy;\n var sourceHeader;\n var dimensions;\n if (isSeries(sourceHost)) {\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\n sourceHeader = sourceHost.get('sourceHeader', true);\n dimensions = sourceHost.get('dimensions', true);\n }\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 return {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n };\n };\n return SourceManager;\n}();\nexport { SourceManager };\n// Call this method after `super.init` and `super.mergeOption` to\n// disable the transform merge, but do not disable transform clone from rawOption.\nexport function disableTransformOptionMerge(datasetModel) {\n var transformOption = datasetModel.option.transform;\n transformOption && setAsPrimitive(datasetModel.option.transform);\n}\nfunction isSeries(sourceHost) {\n // Avoid circular dependency with Series.ts\n return sourceHost.mainType === 'series';\n}\nfunction doThrow(errMsg) {\n throw new Error(errMsg);\n}","map":{"version":3,"names":["setAsPrimitive","map","isTypedArray","assert","each","retrieve2","createSource","cloneSourceShallow","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_ORIGINAL","querySeriesUpstreamDatasetModel","queryDatasetUpstreamDatasetModels","applyDataTransform","DataStore","DefaultDataProvider","SourceManager","sourceHost","_sourceList","_storeList","_upstreamSignList","_versionSignBase","_dirty","_sourceHost","prototype","dirty","_setLocalSource","sourceList","upstreamSignList","_getVersionSign","uid","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","length","resultSourceList","isSeries","seriesModel","data","sourceFormat","upSource","upSourceMgr","getSource","get","newMetaRawOption","_getSourceMetaRawOption","upMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","dimensions","needsCreateSource","datasetModel","result","_applyTransform","sourceData","process","env","NODE_ENV","upMgrList","transformOption","fromTransformResult","errMsg","doThrow","upSourceList","upMgr","push","datasetIndex","componentIndex","i","upSrcMgr","sourceIndex","source","getSharedDataStore","seriesDimRequest","schema","makeStoreSchema","_innerGetDataStore","hash","storeDims","seriesSource","sourceReadKey","storeList","cachedStoreMap","cachedStore","initData","getSourceManager","model","disableTransformOptionMerge","option","transform","mainType","Error"],"sources":["E:/git/2021项目/安科院大屏/node_modules/echarts/lib/data/helper/sourceManager.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/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { setAsPrimitive, map, isTypedArray, assert, each, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createSource, cloneSourceShallow } from '../Source.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\nimport { querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels } from './sourceHelper.js';\nimport { applyDataTransform } from './transform.js';\nimport DataStore from '../DataStore.js';\nimport { DefaultDataProvider } from './dataProvider.js';\n/**\r\n * [REQUIREMENT_MEMO]:\r\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\r\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\r\n * `root-dataset`. Them on `series` has higher priority.\r\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\r\n * confuse users: whether those props indicate how to visit the upstream source or visit\r\n * the transform result source, and some transforms has nothing to do with these props,\r\n * and some transforms might have multiple upstream.\r\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\r\n * declared in `root-dataset`.\r\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\r\n * That is for reducing complexity in transforms.\r\n * PENDING: Whether to provide transposition transform?\r\n *\r\n * [IMPLEMENTAION_MEMO]:\r\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\r\n * They will not be calculated until `source` is about to be visited (to prevent from\r\n * duplicate calcuation). `source` is visited only in series and input to transforms.\r\n *\r\n * [DIMENSION_INHERIT_RULE]:\r\n * By default the dimensions are inherited from ancestors, unless a transform return\r\n * a new dimensions definition.\r\n * Consider the case:\r\n * ```js\r\n * dataset: [{\r\n * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * dataset: [{\r\n * dimension: ['Product', 'Sales', 'Prise'],\r\n * source: [ ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * ```\r\n * The two types of option should have the same behavior after transform.\r\n *\r\n *\r\n * [SCENARIO]:\r\n * (1) Provide source data directly:\r\n * ```js\r\n * series: {\r\n * encode: {...},\r\n * dimensions: [...]\r\n * seriesLayoutBy: 'row',\r\n * data: [[...]]\r\n * }\r\n * ```\r\n * (2) Series refer to dataset.\r\n * ```js\r\n * series: [{\r\n * encode: {...}\r\n * // Ignore datasetIndex means `datasetIndex: 0`\r\n * // and the dimensions defination in dataset is used\r\n * }, {\r\n * encode: {...},\r\n * seriesLayoutBy: 'column',\r\n * datasetIndex: 1\r\n * }]\r\n * ```\r\n * (3) dataset transform\r\n * ```js\r\n * dataset: [{\r\n * source: [...]\r\n * }, {\r\n * source: [...]\r\n * }, {\r\n * // By default from 0.\r\n * transform: { type: 'filter', config: {...} }\r\n * }, {\r\n * // Piped.\r\n * transform: [\r\n * { type: 'filter', config: {...} },\r\n * { type: 'sort', config: {...} }\r\n * ]\r\n * }, {\r\n * id: 'regressionData',\r\n * fromDatasetIndex: 1,\r\n * // Third-party transform\r\n * transform: { type: 'ecStat:regression', config: {...} }\r\n * }, {\r\n * // retrieve the extra result.\r\n * id: 'regressionFormula',\r\n * fromDatasetId: 'regressionData',\r\n * fromTransformResult: 1\r\n * }]\r\n * ```\r\n */\nvar SourceManager = /** @class */function () {\n function SourceManager(sourceHost) {\n // Cached source. Do not repeat calculating if not dirty.\n this._sourceList = [];\n this._storeList = [];\n // version sign of each upstream source manager.\n this._upstreamSignList = [];\n this._versionSignBase = 0;\n this._dirty = true;\n this._sourceHost = sourceHost;\n }\n /**\r\n * Mark dirty.\r\n */\n SourceManager.prototype.dirty = function () {\n this._setLocalSource([], []);\n this._storeList = [];\n this._dirty = true;\n };\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\n this._sourceList = sourceList;\n this._upstreamSignList = upstreamSignList;\n this._versionSignBase++;\n if (this._versionSignBase > 9e10) {\n this._versionSignBase = 0;\n }\n };\n /**\r\n * For detecting whether the upstream source is dirty, so that\r\n * the local cached source (in `_sourceList`) should be discarded.\r\n */\n SourceManager.prototype._getVersionSign = function () {\n return this._sourceHost.uid + '_' + this._versionSignBase;\n };\n /**\r\n * Always return a source instance. Otherwise throw error.\r\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 this._dirty = false;\n }\n };\n SourceManager.prototype._createSource = function () {\n this._setLocalSource([], []);\n var sourceHost = this._sourceHost;\n var upSourceMgrList = this._getUpstreamSourceManagers();\n var hasUpstream = !!upSourceMgrList.length;\n var resultSourceList;\n var upstreamSignList;\n if (isSeries(sourceHost)) {\n var seriesModel = sourceHost;\n var data = void 0;\n var sourceFormat = void 0;\n var upSource = void 0;\n // Has upstream dataset\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 }\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 }\n // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\n var newMetaRawOption = this._getSourceMetaRawOption() || {};\n var upMetaRawOption = upSource && upSource.metaRawOption || {};\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null;\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader);\n // 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 var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions);\n // We share source with dataset as much as possible\n // to avoid extra memory cost of high dimensional data.\n var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions;\n resultSourceList = needsCreateSource ? [createSource(data, {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n }, sourceFormat)] : [];\n } else {\n var datasetModel = sourceHost;\n // Has upstream dataset.\n if (hasUpstream) {\n var result = this._applyTransform(upSourceMgrList);\n resultSourceList = result.sourceList;\n upstreamSignList = result.upstreamSignList;\n }\n // Is root dataset.\n else {\n var sourceData = datasetModel.get('source', true);\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)];\n upstreamSignList = [];\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert(resultSourceList && upstreamSignList);\n }\n this._setLocalSource(resultSourceList, upstreamSignList);\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 if (process.env.NODE_ENV !== 'production') {\n assert(fromTransformResult != null || transformOption != null);\n }\n if (fromTransformResult != null) {\n var errMsg = '';\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 doThrow(errMsg);\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 if (fromTransformResult != null && !upSource) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\n }\n doThrow(errMsg);\n }\n upSourceList.push(upSource);\n upstreamSignList.push(upMgr._getVersionSign());\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 return {\n sourceList: sourceList,\n upstreamSignList: upstreamSignList\n };\n };\n SourceManager.prototype._isDirty = function () {\n if (this._dirty) {\n return true;\n }\n // All sourceList is from the some upstream.\n var upSourceMgrList = this._getUpstreamSourceManagers();\n for (var i = 0; i < upSourceMgrList.length; i++) {\n var upSrcMgr = upSourceMgrList[i];\n if (\n // 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 /**\r\n * @param sourceIndex By default 0, means \"main source\".\r\n * In most cases there is only one source.\r\n */\n SourceManager.prototype.getSource = function (sourceIndex) {\n sourceIndex = sourceIndex || 0;\n var source = this._sourceList[sourceIndex];\n if (!source) {\n // Series may share source instance with dataset.\n var upSourceMgrList = this._getUpstreamSourceManagers();\n return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex);\n }\n return source;\n };\n /**\r\n *\r\n * Get a data store which can be shared across series.\r\n * Only available for series.\r\n *\r\n * @param seriesDimRequest Dimensions that are generated in series.\r\n * Should have been sorted by `storeDimIndex` asc.\r\n */\n SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.');\n }\n var schema = seriesDimRequest.makeStoreSchema();\n return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash);\n };\n SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) {\n // TODO Can use other sourceIndex?\n var sourceIndex = 0;\n var storeList = this._storeList;\n var cachedStoreMap = storeList[sourceIndex];\n if (!cachedStoreMap) {\n cachedStoreMap = storeList[sourceIndex] = {};\n }\n var cachedStore = cachedStoreMap[sourceReadKey];\n if (!cachedStore) {\n var upSourceMgr = this._getUpstreamSourceManagers()[0];\n if (isSeries(this._sourceHost) && upSourceMgr) {\n cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey);\n } else {\n cachedStore = new DataStore();\n // Always create store from source of series.\n cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims);\n }\n cachedStoreMap[sourceReadKey] = cachedStore;\n }\n return cachedStore;\n };\n /**\r\n * PENDING: Is it fast enough?\r\n * If no upstream, return empty array.\r\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 // there is no need to update them when change happens.\n var sourceHost = this._sourceHost;\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 SourceManager.prototype._getSourceMetaRawOption = function () {\n var sourceHost = this._sourceHost;\n var seriesLayoutBy;\n var sourceHeader;\n var dimensions;\n if (isSeries(sourceHost)) {\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\n sourceHeader = sourceHost.get('sourceHeader', true);\n dimensions = sourceHost.get('dimensions', true);\n }\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 return {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n };\n };\n return SourceManager;\n}();\nexport { SourceManager };\n// Call this method after `super.init` and `super.mergeOption` to\n// disable the transform merge, but do not disable transform clone from rawOption.\nexport function disableTransformOptionMerge(datasetModel) {\n var transformOption = datasetModel.option.transform;\n transformOption && setAsPrimitive(datasetModel.option.transform);\n}\nfunction isSeries(sourceHost) {\n // Avoid circular dependency with Series.ts\n return sourceHost.mainType === 'series';\n}\nfunction doThrow(errMsg) {\n throw new Error(errMsg);\n}"],"mappings":";AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,GAAG,EAAEC,YAAY,EAAEC,MAAM,EAAEC,IAAI,EAAEC,SAAS,QAAQ,0BAA0B;AACrG,SAASC,YAAY,EAAEC,kBAAkB,QAAQ,cAAc;AAC/D,SAASC,yBAAyB,EAAEC,sBAAsB,QAAQ,qBAAqB;AACvF,SAASC,+BAA+B,EAAEC,iCAAiC,QAAQ,mBAAmB;AACtG,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,OAAOC,SAAS,MAAM,iBAAiB;AACvC,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,aAAa,GAAG,aAAa,YAAY;EAC3C,SAASA,aAAaA,CAACC,UAAU,EAAE;IACjC;IACA,IAAI,CAAC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