1 line
17 KiB
JSON
1 line
17 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.array.slice.js\";\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 * 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*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { each, isObject, clone } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName, getDataItemValue } from '../../util/model.js';\n\nvar TimelineModel =\n/** @class */\nfunction (_super) {\n __extends(TimelineModel, _super);\n\n function TimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TimelineModel.type;\n _this.layoutMode = 'box';\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._initData();\n };\n /**\r\n * @override\r\n */\n\n\n TimelineModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n this._initData();\n };\n\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\n if (currentIndex == null) {\n currentIndex = this.option.currentIndex;\n }\n\n var count = this._data.count();\n\n if (this.option.loop) {\n currentIndex = (currentIndex % count + count) % count;\n } else {\n currentIndex >= count && (currentIndex = count - 1);\n currentIndex < 0 && (currentIndex = 0);\n }\n\n this.option.currentIndex = currentIndex;\n };\n /**\r\n * @return {number} currentIndex\r\n */\n\n\n TimelineModel.prototype.getCurrentIndex = function () {\n return this.option.currentIndex;\n };\n /**\r\n * @return {boolean}\r\n */\n\n\n TimelineModel.prototype.isIndexMax = function () {\n return this.getCurrentIndex() >= this._data.count() - 1;\n };\n /**\r\n * @param {boolean} state true: play, false: stop\r\n */\n\n\n TimelineModel.prototype.setPlayState = function (state) {\n this.option.autoPlay = !!state;\n };\n /**\r\n * @return {boolean} true: play, false: stop\r\n */\n\n\n TimelineModel.prototype.getPlayState = function () {\n return !!this.option.autoPlay;\n };\n /**\r\n * @private\r\n */\n\n\n TimelineModel.prototype._initData = function () {\n var thisOption = this.option;\n var dataArr = thisOption.data || [];\n var axisType = thisOption.axisType;\n var names = this._names = [];\n var processedDataArr;\n\n if (axisType === 'category') {\n processedDataArr = [];\n each(dataArr, function (item, index) {\n var value = convertOptionIdName(getDataItemValue(item), '');\n var newItem;\n\n if (isObject(item)) {\n newItem = clone(item);\n newItem.value = index;\n } else {\n newItem = index;\n }\n\n processedDataArr.push(newItem);\n names.push(value);\n });\n } else {\n processedDataArr = dataArr;\n }\n\n var dimType = {\n category: 'ordinal',\n time: 'time',\n value: 'number'\n }[axisType] || 'number';\n var data = this._data = new SeriesData([{\n name: 'value',\n type: dimType\n }], this);\n data.initData(processedDataArr, names);\n };\n\n TimelineModel.prototype.getData = function () {\n return this._data;\n };\n /**\r\n * @public\r\n * @return {Array.<string>} categoreis\r\n */\n\n\n TimelineModel.prototype.getCategories = function () {\n if (this.get('axisType') === 'category') {\n return this._names.slice();\n }\n };\n\n TimelineModel.type = 'timeline';\n /**\r\n * @protected\r\n */\n\n TimelineModel.defaultOption = {\n // zlevel: 0, // 一级层叠\n z: 4,\n show: true,\n axisType: 'time',\n realtime: true,\n left: '20%',\n top: null,\n right: '20%',\n bottom: 0,\n width: null,\n height: 40,\n padding: 5,\n controlPosition: 'left',\n autoPlay: false,\n rewind: false,\n loop: true,\n playInterval: 2000,\n currentIndex: 0,\n itemStyle: {},\n label: {\n color: '#000'\n },\n data: []\n };\n return TimelineModel;\n}(ComponentModel);\n\nexport default TimelineModel;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/component/timeline/TimelineModel.js"],"names":["__extends","ComponentModel","SeriesData","each","isObject","clone","convertOptionIdName","getDataItemValue","TimelineModel","_super","_this","apply","arguments","type","layoutMode","prototype","init","option","parentModel","ecModel","mergeDefaultAndTheme","_initData","mergeOption","setCurrentIndex","currentIndex","count","_data","loop","getCurrentIndex","isIndexMax","setPlayState","state","autoPlay","getPlayState","thisOption","dataArr","data","axisType","names","_names","processedDataArr","item","index","value","newItem","push","dimType","category","time","name","initData","getData","getCategories","get","slice","defaultOption","z","show","realtime","left","top","right","bottom","width","height","padding","controlPosition","rewind","playInterval","itemStyle","label","color"],"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,SAAT,QAA0B,OAA1B;AACA,OAAOC,cA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;AAClD,QAAI,KAAKC,GAAL,CAAS,UAAT,MAAyB,UAA7B,EAAyC;AACvC,aAAO,KAAKd,MAAL,CAAYe,KAAZ,EAAP;AACD;AACF,GAJD;;AAMA9C,EAAAA,aAAa,CAACK,IAAd,GAAqB,UAArB;AACA;AACF;AACA;;AAEEL,EAAAA,aAAa,CAAC+C,aAAd,GAA8B;AAC5B;AACAC,IAAAA,CAAC,EAAE,CAFyB;AAG5BC,IAAAA,IAAI,EAAE,IAHsB;AAI5BpB,IAAAA,QAAQ,EAAE,MAJkB;AAK5BqB,IAAAA,QAAQ,EAAE,IALkB;AAM5BC,IAAAA,IAAI,EAAE,KANsB;AAO5BC,IAAAA,GAAG,EAAE,IAPuB;AAQ5BC,IAAAA,KAAK,EAAE,KARqB;AAS5BC,IAAAA,MAAM,EAAE,CAToB;AAU5BC,IAAAA,KAAK,EAAE,IAVqB;AAW5BC,IAAAA,MAAM,EAAE,EAXoB;AAY5BC,IAAAA,OAAO,EAAE,CAZmB;AAa5BC,IAAAA,eAAe,EAAE,MAbW;AAc5BlC,IAAAA,QAAQ,EAAE,KAdkB;AAe5BmC,IAAAA,MAAM,EAAE,KAfoB;AAgB5BxC,IAAAA,IAAI,EAAE,IAhBsB;AAiB5ByC,IAAAA,YAAY,EAAE,IAjBc;AAkB5B5C,IAAAA,YAAY,EAAE,CAlBc;AAmB5B6C,IAAAA,SAAS,EAAE,EAnBiB;AAoB5BC,IAAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAE;AADF,KApBqB;AAuB5BnC,IAAAA,IAAI,EAAE;AAvBsB,GAA9B;AAyBA,SAAO5B,aAAP;AACD,CAzKD,CAyKEP,cAzKF,CAFA;;AA6KA,eAAeO,aAAf","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\nimport { __extends } from \"tslib\";\r\nimport ComponentModel from '../../model/Component.js';\r\nimport SeriesData from '../../data/SeriesData.js';\r\nimport { each, isObject, clone } from 'zrender/lib/core/util.js';\r\nimport { convertOptionIdName, getDataItemValue } from '../../util/model.js';\r\n\r\nvar TimelineModel =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(TimelineModel, _super);\r\n\r\n function TimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\r\n _this.type = TimelineModel.type;\r\n _this.layoutMode = 'box';\r\n return _this;\r\n }\r\n /**\r\n * @override\r\n */\r\n\r\n\r\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n\r\n this._initData();\r\n };\r\n /**\r\n * @override\r\n */\r\n\r\n\r\n TimelineModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n\r\n this._initData();\r\n };\r\n\r\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\r\n if (currentIndex == null) {\r\n currentIndex = this.option.currentIndex;\r\n }\r\n\r\n var count = this._data.count();\r\n\r\n if (this.option.loop) {\r\n currentIndex = (currentIndex % count + count) % count;\r\n } else {\r\n currentIndex >= count && (currentIndex = count - 1);\r\n currentIndex < 0 && (currentIndex = 0);\r\n }\r\n\r\n this.option.currentIndex = currentIndex;\r\n };\r\n /**\r\n * @return {number} currentIndex\r\n */\r\n\r\n\r\n TimelineModel.prototype.getCurrentIndex = function () {\r\n return this.option.currentIndex;\r\n };\r\n /**\r\n * @return {boolean}\r\n */\r\n\r\n\r\n TimelineModel.prototype.isIndexMax = function () {\r\n return this.getCurrentIndex() >= this._data.count() - 1;\r\n };\r\n /**\r\n * @param {boolean} state true: play, false: stop\r\n */\r\n\r\n\r\n TimelineModel.prototype.setPlayState = function (state) {\r\n this.option.autoPlay = !!state;\r\n };\r\n /**\r\n * @return {boolean} true: play, false: stop\r\n */\r\n\r\n\r\n TimelineModel.prototype.getPlayState = function () {\r\n return !!this.option.autoPlay;\r\n };\r\n /**\r\n * @private\r\n */\r\n\r\n\r\n TimelineModel.prototype._initData = function () {\r\n var thisOption = this.option;\r\n var dataArr = thisOption.data || [];\r\n var axisType = thisOption.axisType;\r\n var names = this._names = [];\r\n var processedDataArr;\r\n\r\n if (axisType === 'category') {\r\n processedDataArr = [];\r\n each(dataArr, function (item, index) {\r\n var value = convertOptionIdName(getDataItemValue(item), '');\r\n var newItem;\r\n\r\n if (isObject(item)) {\r\n newItem = clone(item);\r\n newItem.value = index;\r\n } else {\r\n newItem = index;\r\n }\r\n\r\n processedDataArr.push(newItem);\r\n names.push(value);\r\n });\r\n } else {\r\n processedDataArr = dataArr;\r\n }\r\n\r\n var dimType = {\r\n category: 'ordinal',\r\n time: 'time',\r\n value: 'number'\r\n }[axisType] || 'number';\r\n var data = this._data = new SeriesData([{\r\n name: 'value',\r\n type: dimType\r\n }], this);\r\n data.initData(processedDataArr, names);\r\n };\r\n\r\n TimelineModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n /**\r\n * @public\r\n * @return {Array.<string>} categoreis\r\n */\r\n\r\n\r\n TimelineModel.prototype.getCategories = function () {\r\n if (this.get('axisType') === 'category') {\r\n return this._names.slice();\r\n }\r\n };\r\n\r\n TimelineModel.type = 'timeline';\r\n /**\r\n * @protected\r\n */\r\n\r\n TimelineModel.defaultOption = {\r\n // zlevel: 0, // 一级层叠\r\n z: 4,\r\n show: true,\r\n axisType: 'time',\r\n realtime: true,\r\n left: '20%',\r\n top: null,\r\n right: '20%',\r\n bottom: 0,\r\n width: null,\r\n height: 40,\r\n padding: 5,\r\n controlPosition: 'left',\r\n autoPlay: false,\r\n rewind: false,\r\n loop: true,\r\n playInterval: 2000,\r\n currentIndex: 0,\r\n itemStyle: {},\r\n label: {\r\n color: '#000'\r\n },\r\n data: []\r\n };\r\n return TimelineModel;\r\n}(ComponentModel);\r\n\r\nexport default TimelineModel;"]},"metadata":{},"sourceType":"module"} |