1 line
15 KiB
JSON
1 line
15 KiB
JSON
{"ast":null,"code":"/*\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*/\n\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\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*/\n\n/**\r\n * Link lists and struct (graph or tree)\r\n */\nimport { curry, each, assert, extend, map, keys } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\n\nfunction linkSeriesData(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/**\r\n * Supplement method to List.\r\n *\r\n * @public\r\n * @param [dataType] If not specified, return mainData.\r\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/**\r\n * Get list of all linked data\r\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 linkSeriesData;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/data/helper/linkSeriesData.js"],"names":["curry","each","assert","extend","map","keys","makeInner","inner","linkSeriesData","opt","mainData","datas","main","datasAttr","linkAll","data","TRANSFERABLE_METHODS","methodName","wrapMethod","transferInjection","cloneShallowInjection","CHANGABLE_METHODS","changeInjection","dataType","res","isMainData","linkSingle","struct","update","cloneShallow","getLinkedData","getLinkedDataAll","type","structAttr"],"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;;AAEA;AACA;AACA;AACA,SAASA,KAAT,EAAgBC,IAAhB,EAAsBC,MAAtB,EAA8BC,MAA9B,EAAsCC,GAAtC,EAA2CC,IAA3C,QAAuD,0BAAvD;AACA,SAASC,SAAT,QAA0B,qBAA1B;AACA,IAAIC,KAAK,GAAGD,SAAS,EAArB;;AAEA,SAASE,cAAT,CAAwBC,GAAxB,EAA6B;AAC3B,MAAIC,QAAQ,GAAGD,GAAG,CAACC,QAAnB;AACA,MAAIC,KAAK,GAAGF,GAAG,CAACE,KAAhB;;AAEA,MAAI,CAACA,KAAL,EAAY;AACVA,IAAAA,KAAK,GAAG;AACNC,MAAAA,IAAI,EAAEF;AADA,KAAR;AAGAD,IAAAA,GAAG,CAACI,SAAJ,GAAgB;AACdD,MAAAA,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AL,GAAqBA,aAArB;AACAf,EAAAA,IAAI,CAACgB,gBAAL,GAAwBA,gBAAxB;AACD;;AAED,eAAevB,cAAf","sourcesContent":["\r\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*/\r\n\r\n\r\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\r\n\r\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*/\r\n\r\n/**\r\n * Link lists and struct (graph or tree)\r\n */\r\nimport { curry, each, assert, extend, map, keys } from 'zrender/lib/core/util.js';\r\nimport { makeInner } from '../../util/model.js';\r\nvar inner = makeInner();\r\n\r\nfunction linkSeriesData(opt) {\r\n var mainData = opt.mainData;\r\n var datas = opt.datas;\r\n\r\n if (!datas) {\r\n datas = {\r\n main: mainData\r\n };\r\n opt.datasAttr = {\r\n main: 'data'\r\n };\r\n }\r\n\r\n opt.datas = opt.mainData = null;\r\n linkAll(mainData, datas, opt); // Porxy data original methods.\r\n\r\n each(datas, function (data) {\r\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\r\n data.wrapMethod(methodName, curry(transferInjection, opt));\r\n });\r\n }); // Beyond transfer, additional features should be added to `cloneShallow`.\r\n\r\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger\r\n // another changable methods, which may bring about dead lock.\r\n\r\n each(mainData.CHANGABLE_METHODS, function (methodName) {\r\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\r\n }); // Make sure datas contains mainData.\r\n\r\n assert(datas[mainData.dataType] === mainData);\r\n}\r\n\r\nfunction transferInjection(opt, res) {\r\n if (isMainData(this)) {\r\n // Transfer datas to new main data.\r\n var datas = extend({}, inner(this).datas);\r\n datas[this.dataType] = res;\r\n linkAll(res, datas, opt);\r\n } else {\r\n // Modify the reference in main data to point newData.\r\n linkSingle(res, this.dataType, inner(this).mainData, opt);\r\n }\r\n\r\n return res;\r\n}\r\n\r\nfunction changeInjection(opt, res) {\r\n opt.struct && opt.struct.update();\r\n return res;\r\n}\r\n\r\nfunction cloneShallowInjection(opt, res) {\r\n // cloneShallow, which brings about some fragilities, may be inappropriate\r\n // to be exposed as an API. So for implementation simplicity we can make\r\n // the restriction that cloneShallow of not-mainData should not be invoked\r\n // outside, but only be invoked here.\r\n each(inner(res).datas, function (data, dataType) {\r\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\r\n });\r\n return res;\r\n}\r\n/**\r\n * Supplement method to List.\r\n *\r\n * @public\r\n * @param [dataType] If not specified, return mainData.\r\n */\r\n\r\n\r\nfunction getLinkedData(dataType) {\r\n var mainData = inner(this).mainData;\r\n return dataType == null || mainData == null ? mainData : inner(mainData).datas[dataType];\r\n}\r\n/**\r\n * Get list of all linked data\r\n */\r\n\r\n\r\nfunction getLinkedDataAll() {\r\n var mainData = inner(this).mainData;\r\n return mainData == null ? [{\r\n data: mainData\r\n }] : map(keys(inner(mainData).datas), function (type) {\r\n return {\r\n type: type,\r\n data: inner(mainData).datas[type]\r\n };\r\n });\r\n}\r\n\r\nfunction isMainData(data) {\r\n return inner(data).mainData === data;\r\n}\r\n\r\nfunction linkAll(mainData, datas, opt) {\r\n inner(mainData).datas = {};\r\n each(datas, function (data, dataType) {\r\n linkSingle(data, dataType, mainData, opt);\r\n });\r\n}\r\n\r\nfunction linkSingle(data, dataType, mainData, opt) {\r\n inner(mainData).datas[dataType] = data;\r\n inner(data).mainData = mainData;\r\n data.dataType = dataType;\r\n\r\n if (opt.struct) {\r\n data[opt.structAttr] = opt.struct;\r\n opt.struct[opt.datasAttr[dataType]] = data;\r\n } // Supplement method.\r\n\r\n\r\n data.getLinkedData = getLinkedData;\r\n data.getLinkedDataAll = getLinkedDataAll;\r\n}\r\n\r\nexport default linkSeriesData;"]},"metadata":{},"sourceType":"module"} |