d2694e7b5725f7c3cda2a50c6f5246c5a049222e9c06312d4c223ec3d4ef76ed.json 13 KB

1
  1. {"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/*\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;\n // Do not use function binding or curry for performance.\n var selectors = {\n point: function (itemLayout) {\n return selector[brushType].point(itemLayout, selectors, area);\n },\n rect: function (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 (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.intersect(itemLayout);\n }\n },\n polygon: {\n point: function (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 (itemLayout, selectors, area) {\n var points = area.range;\n if (!itemLayout || points.length <= 1) {\n return false;\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 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};\nfunction getLineSelectors(xyIndex) {\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n return {\n point: function (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 (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}\nfunction inLineRange(p, range) {\n return range[0] <= p && p <= range[1];\n}\nexport default selector;","map":{"version":3,"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"],"sources":["E:/git/2021项目/安科院大屏/node_modules/echarts/lib/component/brush/selector.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 * 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;\n // Do not use function binding or curry for performance.\n var selectors = {\n point: function (itemLayout) {\n return selector[brushType].point(itemLayout, selectors, area);\n },\n rect: function (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 (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.intersect(itemLayout);\n }\n },\n polygon: {\n point: function (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 (itemLayout, selectors, area) {\n var points = area.range;\n if (!itemLayout || points.length <= 1) {\n return false;\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 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};\nfunction getLineSelectors(xyIndex) {\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n return {\n point: function (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 (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}\nfunction inLineRange(p, range) {\n return range[0] <= p && p <= range[1];\n}\nexport default selector;"],"mappings":"AACA;AACA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