1 line
14 KiB
JSON
1 line
14 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*/\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { linePolygonIntersect } from '../../util/graphic.js';\nexport function makeBrushCommonSelectorForSeries(area) {\n var brushType = area.brushType; // Do not use function binding or curry for performance.\n\n var selectors = {\n point: function point(itemLayout) {\n return selector[brushType].point(itemLayout, selectors, area);\n },\n rect: function rect(itemLayout) {\n return selector[brushType].rect(itemLayout, selectors, area);\n }\n };\n return selectors;\n}\nvar selector = {\n lineX: getLineSelectors(0),\n lineY: getLineSelectors(1),\n rect: {\n point: function point(itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\n },\n rect: function rect(itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.intersect(itemLayout);\n }\n },\n polygon: {\n point: function point(itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && polygonContain.contain(area.range, itemLayout[0], itemLayout[1]);\n },\n rect: function rect(itemLayout, selectors, area) {\n var points = area.range;\n\n if (!itemLayout || points.length <= 1) {\n return false;\n }\n\n var x = itemLayout.x;\n var y = itemLayout.y;\n var width = itemLayout.width;\n var height = itemLayout.height;\n var p = points[0];\n\n if (polygonContain.contain(points, x, y) || polygonContain.contain(points, x + width, y) || polygonContain.contain(points, x, y + height) || polygonContain.contain(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\n return true;\n }\n }\n }\n};\n\nfunction getLineSelectors(xyIndex) {\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n return {\n point: function point(itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var p = itemLayout[xyIndex];\n return inLineRange(p, range);\n }\n },\n rect: function rect(itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\n return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);\n }\n }\n };\n}\n\nfunction inLineRange(p, range) {\n return range[0] <= p && p <= range[1];\n}\n\nexport default selector;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/component/brush/selector.js"],"names":["polygonContain","BoundingRect","linePolygonIntersect","makeBrushCommonSelectorForSeries","area","brushType","selectors","point","itemLayout","selector","rect","lineX","getLineSelectors","lineY","boundingRect","contain","intersect","polygon","range","points","length","x","y","width","height","p","create","xyIndex","xy","wh","inLineRange","layoutRange","reverse"],"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,OAAO,KAAKA,cAAZ,MAAgC,gCAAhC;AACA,OAAOC,YAAP,MAAyB,kCAAzB;AACA,SAASC,oBAAT,QAAqC,uBAArC;AACA,OAAO,SAASC,gCAAT,CAA0CC,IAA1C,EAAgD;AACrD,MAAIC,SAAS,GAAGD,IAAI,CAACC,SAArB,CADqD,CACrB;;AAEhC,MAAIC,SAAS,GAAG;AACdC,IAAAA,KAAK,EAAE,eAAUC,UAAV,EAAsB;AAC3B,aAAOC,QAAQ,CAACJ,SAAD,CAAR,CAAoBE,KAApB,CAA0BC,UAA1B,EAAsCF,SAAtC,EAAiDF,IAAjD,CAAP;AACD,KAHa;AAIdM,IAAAA,IAAI,EAAE,cAAUF,UAAV,EAAsB;AAC1B,aAAOC,QAAQ,CAACJ,SAAD,CAAR,CAAoBK,IAApB,CAAyBF,UAAzB,EAAqCF,SAArC,EAAgDF,IAAhD,CAAP;AACD;AANa,GAAhB;AAQA,SAAOE,SAAP;AACD;AACD,IAAIG,QAAQ,GAAG;AACbE,EAAAA,KAAK,EAAEC,gBAAgB,CAAC,CAAD,CADV;AAEbC,EAAAA,KAAK,EAAED,gBAAgB,CAAC,CAAD,CAFV;AAGbF,EAAAA,IAAI,EAAE;AACJH,IAAAA,KAAK,EAAE,eAAUC,UAAV,EAAsBF,SA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F,IAAjC,EAAuC;AAC5C,UAAII,UAAJ,EAAgB;AACd,YAAIU,KAAK,GAAGd,IAAI,CAACc,KAAjB;AACA,YAAIO,CAAC,GAAGjB,UAAU,CAACmB,OAAD,CAAlB;AACA,eAAOG,WAAW,CAACL,CAAD,EAAIP,KAAJ,CAAlB;AACD;AACF,KAPI;AAQLR,IAAAA,IAAI,EAAE,cAAUF,UAAV,EAAsBF,SAAtB,EAAiCF,IAAjC,EAAuC;AAC3C,UAAII,UAAJ,EAAgB;AACd,YAAIU,KAAK,GAAGd,IAAI,CAACc,KAAjB;AACA,YAAIa,WAAW,GAAG,CAACvB,UAAU,CAACoB,EAAE,CAACD,OAAD,CAAH,CAAX,EAA0BnB,UAAU,CAACoB,EAAE,CAACD,OAAD,CAAH,CAAV,GAA0BnB,UAAU,CAACqB,EAAE,CAACF,OAAD,CAAH,CAA9D,CAAlB;AACAI,QAAAA,WAAW,CAAC,CAAD,CAAX,GAAiBA,WAAW,CAAC,CAAD,CAA5B,IAAmCA,WAAW,CAACC,OAAZ,EAAnC;AACA,eAAOF,WAAW,CAACC,WAAW,CAAC,CAAD,CAAZ,EAAiBb,KAAjB,CAAX,IAAsCY,WAAW,CAACC,WAAW,CAAC,CAAD,CAAZ,EAAiBb,KAAjB,CAAjD,IAA4EY,WAAW,CAACZ,KAAK,CAAC,CAAD,CAAN,EAAWa,WAAX,CAAvF,IAAkHD,WAAW,CAACZ,KAAK,CAAC,CAAD,CAAN,EAAWa,WAAX,CAApI;AACD;AACF;AAfI,GAAP;AAiBD;;AAED,SAASD,WAAT,CAAqBL,CAArB,EAAwBP,KAAxB,EAA+B;AAC7B,SAAOA,KAAK,CAAC,CAAD,CAAL,IAAYO,CAAZ,IAAiBA,CAAC,IAAIP,KAAK,CAAC,CAAD,CAAlC;AACD;;AAED,eAAeT,QAAf","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 * as polygonContain from 'zrender/lib/contain/polygon.js';\r\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\r\nimport { linePolygonIntersect } from '../../util/graphic.js';\r\nexport function makeBrushCommonSelectorForSeries(area) {\r\n var brushType = area.brushType; // Do not use function binding or curry for performance.\r\n\r\n var selectors = {\r\n point: function (itemLayout) {\r\n return selector[brushType].point(itemLayout, selectors, area);\r\n },\r\n rect: function (itemLayout) {\r\n return selector[brushType].rect(itemLayout, selectors, area);\r\n }\r\n };\r\n return selectors;\r\n}\r\nvar selector = {\r\n lineX: getLineSelectors(0),\r\n lineY: getLineSelectors(1),\r\n rect: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.intersect(itemLayout);\r\n }\r\n },\r\n polygon: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && polygonContain.contain(area.range, itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n var points = area.range;\r\n\r\n if (!itemLayout || points.length <= 1) {\r\n return false;\r\n }\r\n\r\n var x = itemLayout.x;\r\n var y = itemLayout.y;\r\n var width = itemLayout.width;\r\n var height = itemLayout.height;\r\n var p = points[0];\r\n\r\n if (polygonContain.contain(points, x, y) || polygonContain.contain(points, x + width, y) || polygonContain.contain(points, x, y + height) || polygonContain.contain(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\r\n return true;\r\n }\r\n }\r\n }\r\n};\r\n\r\nfunction getLineSelectors(xyIndex) {\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n return {\r\n point: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var p = itemLayout[xyIndex];\r\n return inLineRange(p, range);\r\n }\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];\r\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\r\n return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);\r\n }\r\n }\r\n };\r\n}\r\n\r\nfunction inLineRange(p, range) {\r\n return range[0] <= p && p <= range[1];\r\n}\r\n\r\nexport default selector;"]},"metadata":{},"sourceType":"module"} |