1 line
21 KiB
JSON
1 line
21 KiB
JSON
{"ast":null,"code":"/*\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/*\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 { __extends } from \"tslib\";\nimport LineDraw from '../helper/LineDraw.js';\nimport EffectLine from '../helper/EffectLine.js';\nimport Line from '../helper/Line.js';\nimport Polyline from '../helper/Polyline.js';\nimport EffectPolyline from '../helper/EffectPolyline.js';\nimport LargeLineDraw from '../helper/LargeLineDraw.js';\nimport linesLayout from './linesLayout.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport ChartView from '../../view/Chart.js';\n\nvar LinesView =\n/** @class */\nfunction (_super) {\n __extends(LinesView, _super);\n\n function LinesView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LinesView.type;\n return _this;\n }\n\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n var zlevel = seriesModel.get('zlevel');\n var trailLength = seriesModel.get(['effect', 'trailLength']);\n var zr = api.getZr(); // Avoid the drag cause ghost shadow\n // FIXME Better way ?\n // SVG doesn't support\n\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg) {\n zr.painter.getLayer(zlevel).clear(true);\n } // Config layer with motion blur\n\n\n if (this._lastZlevel != null && !isSvg) {\n zr.configLayer(this._lastZlevel, {\n motionBlur: false\n });\n }\n\n if (this._showEffect(seriesModel) && trailLength > 0) {\n if (!isSvg) {\n zr.configLayer(zlevel, {\n motionBlur: true,\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\n });\n } else if (process.env.NODE_ENV !== 'production') {\n console.warn('SVG render mode doesn\\'t support lines with trail effect');\n }\n }\n\n lineDraw.updateData(data);\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n\n this._lastZlevel = zlevel;\n this._finished = true;\n };\n\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n lineDraw.incrementalPrepareUpdate(data);\n\n this._clearLayer(api);\n\n this._finished = false;\n };\n\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\n\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n\n LinesView.prototype.eachRendered = function (cb) {\n this._lineDraw && this._lineDraw.eachRendered(cb);\n };\n\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\n // TODO Don't have to do update in large mode. Only do it when there are millions of data.\n return {\n update: true\n };\n } else {\n // TODO Use same logic with ScatterView.\n // Manually update layout\n var res = linesLayout.reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n } // Not in large mode\n\n\n this._lineDraw.updateLayout();\n\n this._clearLayer(api);\n }\n };\n\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\n var lineDraw = this._lineDraw;\n\n var hasEffect = this._showEffect(seriesModel);\n\n var isPolyline = !!seriesModel.get('polyline');\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (process.env.NODE_ENV !== 'production') {\n if (hasEffect && isLargeDraw) {\n console.warn('Large lines not support effect');\n }\n }\n\n if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {\n if (lineDraw) {\n lineDraw.remove();\n }\n\n lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);\n this._hasEffet = hasEffect;\n this._isPolyline = isPolyline;\n this._isLargeDraw = isLargeDraw;\n }\n\n this.group.add(lineDraw.group);\n return lineDraw;\n };\n\n LinesView.prototype._showEffect = function (seriesModel) {\n return !!seriesModel.get(['effect', 'show']);\n };\n\n LinesView.prototype._clearLayer = function (api) {\n // Not use motion when dragging or zooming\n var zr = api.getZr();\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg && this._lastZlevel != null) {\n zr.painter.getLayer(this._lastZlevel).clear(true);\n }\n };\n\n LinesView.prototype.remove = function (ecModel, api) {\n this._lineDraw && this._lineDraw.remove();\n this._lineDraw = null; // Clear motion when lineDraw is removed\n\n this._clearLayer(api);\n };\n\n LinesView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n\n LinesView.type = 'lines';\n return LinesView;\n}(ChartView);\n\nexport default LinesView;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/echarts/lib/chart/lines/LinesView.js"],"names":["__extends","LineDraw","EffectLine","Line","Polyline","EffectPolyline","LargeLineDraw","linesLayout","createClipPath","ChartView","LinesView","_super","_this","apply","arguments","type","prototype","render","seriesModel","ecModel","api","data","getData","lineDraw","_updateLineDraw","zlevel","get","trailLength","zr","getZr","isSvg","painter","getType","getLayer","clear","_lastZlevel","configLayer","motionBlur","_showEffect","lastFrameAlpha","Math","max","min","process","env","NODE_ENV","console","warn","updateData","clipPath","coordinateSystem","group","setClipPath","removeClipPath","_finished","incrementalPrepareRender","incrementalPrepareUpdate","_clearLayer","incrementalRender","taskParams","_lineDraw","incrementalUpdate","end","count","eachRendered","cb","updateTransform","pipelineContext","large","progressiveRender","update","res","reset","progress","start","updateLayout","hasEffect","isPolyline","isLargeDraw","_hasEffet","_isPolyline","_isLargeDraw","remove","add","dispose"],"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,QAAP,MAAqB,uBAArB;AACA,OAAOC,UAAP,MAAuB,yBAAvB;AACA,OAAOC,IAAP,MAAiB,mBAAjB;AACA,OAAOC,QAAP,MAAqB,uBAArB;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,SAASC,cAAT,QAA+B,yCAA/B;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;AAEA,IAAIC,SAAS;AACb;AACA,UAAUC,MAAV,EAAkB;AAChBX,EAAAA,SAAS,CAACU,SAAD,EAAYC,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AAUpB,WAAV,EAAuB;AACvD,WAAO,CAAC,CAACA,WAAW,CAACQ,GAAZ,CAAgB,CAAC,QAAD,EAAW,MAAX,CAAhB,CAAT;AACD,GAFD;;AAIAhB,EAAAA,SAAS,CAACM,SAAV,CAAoByC,WAApB,GAAkC,UAAUrC,GAAV,EAAe;AAC/C;AACA,QAAIQ,EAAE,GAAGR,GAAG,CAACS,KAAJ,EAAT;AACA,QAAIC,KAAK,GAAGF,EAAE,CAACG,OAAH,CAAWC,OAAX,OAAyB,KAArC;;AAEA,QAAI,CAACF,KAAD,IAAU,KAAKK,WAAL,IAAoB,IAAlC,EAAwC;AACtCP,MAAAA,EAAE,CAACG,OAAH,CAAWE,QAAX,CAAoB,KAAKE,WAAzB,EAAsCD,KAAtC,CAA4C,IAA5C;AACD;AACF,GARD;;AAUAxB,EAAAA,SAAS,CAACM,SAAV,CAAoBkE,MAApB,GAA6B,UAAU/D,OAAV,EAAmBC,GAAnB,EAAwB;AACnD,SAAKwC,SAAL,IAAkB,KAAKA,SAAL,CAAesB,MAAf,EAAlB;AACA,SAAKtB,SAAL,GAAiB,IAAjB,CAFmD,CAE5B;;AAEvB,SAAKH,WAAL,CAAiBrC,GAAjB;AACD,GALD;;AAOAV,EAAAA,SAAS,CAACM,SAAV,CAAoBoE,OAApB,GAA8B,UAAUjE,OAAV,EAAmBC,GAAnB,EAAwB;AACpD,SAAK8D,MAAL,CAAY/D,OAAZ,EAAqBC,GAArB;AACD,GAFD;;AAIAV,EAAAA,SAAS,CAACK,IAAV,GAAiB,OAAjB;AACA,SAAOL,SAAP;AACD,CAtKD,CAsKED,SAtKF,CAFA;;AA0KA,eAAeC,SAAf","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 { __extends } from \"tslib\";\nimport LineDraw from '../helper/LineDraw.js';\nimport EffectLine from '../helper/EffectLine.js';\nimport Line from '../helper/Line.js';\nimport Polyline from '../helper/Polyline.js';\nimport EffectPolyline from '../helper/EffectPolyline.js';\nimport LargeLineDraw from '../helper/LargeLineDraw.js';\nimport linesLayout from './linesLayout.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport ChartView from '../../view/Chart.js';\n\nvar LinesView =\n/** @class */\nfunction (_super) {\n __extends(LinesView, _super);\n\n function LinesView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LinesView.type;\n return _this;\n }\n\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n var zlevel = seriesModel.get('zlevel');\n var trailLength = seriesModel.get(['effect', 'trailLength']);\n var zr = api.getZr(); // Avoid the drag cause ghost shadow\n // FIXME Better way ?\n // SVG doesn't support\n\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg) {\n zr.painter.getLayer(zlevel).clear(true);\n } // Config layer with motion blur\n\n\n if (this._lastZlevel != null && !isSvg) {\n zr.configLayer(this._lastZlevel, {\n motionBlur: false\n });\n }\n\n if (this._showEffect(seriesModel) && trailLength > 0) {\n if (!isSvg) {\n zr.configLayer(zlevel, {\n motionBlur: true,\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\n });\n } else if (process.env.NODE_ENV !== 'production') {\n console.warn('SVG render mode doesn\\'t support lines with trail effect');\n }\n }\n\n lineDraw.updateData(data);\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n\n this._lastZlevel = zlevel;\n this._finished = true;\n };\n\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n lineDraw.incrementalPrepareUpdate(data);\n\n this._clearLayer(api);\n\n this._finished = false;\n };\n\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\n\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n\n LinesView.prototype.eachRendered = function (cb) {\n this._lineDraw && this._lineDraw.eachRendered(cb);\n };\n\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\n // TODO Don't have to do update in large mode. Only do it when there are millions of data.\n return {\n update: true\n };\n } else {\n // TODO Use same logic with ScatterView.\n // Manually update layout\n var res = linesLayout.reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n } // Not in large mode\n\n\n this._lineDraw.updateLayout();\n\n this._clearLayer(api);\n }\n };\n\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\n var lineDraw = this._lineDraw;\n\n var hasEffect = this._showEffect(seriesModel);\n\n var isPolyline = !!seriesModel.get('polyline');\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (process.env.NODE_ENV !== 'production') {\n if (hasEffect && isLargeDraw) {\n console.warn('Large lines not support effect');\n }\n }\n\n if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {\n if (lineDraw) {\n lineDraw.remove();\n }\n\n lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);\n this._hasEffet = hasEffect;\n this._isPolyline = isPolyline;\n this._isLargeDraw = isLargeDraw;\n }\n\n this.group.add(lineDraw.group);\n return lineDraw;\n };\n\n LinesView.prototype._showEffect = function (seriesModel) {\n return !!seriesModel.get(['effect', 'show']);\n };\n\n LinesView.prototype._clearLayer = function (api) {\n // Not use motion when dragging or zooming\n var zr = api.getZr();\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg && this._lastZlevel != null) {\n zr.painter.getLayer(this._lastZlevel).clear(true);\n }\n };\n\n LinesView.prototype.remove = function (ecModel, api) {\n this._lineDraw && this._lineDraw.remove();\n this._lineDraw = null; // Clear motion when lineDraw is removed\n\n this._clearLayer(api);\n };\n\n LinesView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n\n LinesView.type = 'lines';\n return LinesView;\n}(ChartView);\n\nexport default LinesView;"]},"metadata":{},"sourceType":"module"} |