{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\node_modules\\@jiaminghi\\data-view\\lib\\components\\flylineChartEnhanced\\src\\main.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\@jiaminghi\\data-view\\lib\\components\\flylineChartEnhanced\\src\\main.vue","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport _defineProperty from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.array.find\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport _toConsumableArray from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport _slicedToArray from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport { deepMerge } from '@jiaminghi/charts/lib/util/index';\nimport { deepClone } from '@jiaminghi/c-render/lib/plugin/util';\nimport { randomExtend, getPointDistance, uuid } from \"../../../util/index\";\nimport autoResize from \"../../../mixin/autoResize\";\nexport default {\n  name: 'DvFlylineChartEnhanced',\n  mixins: [autoResize],\n  props: {\n    config: {\n      type: Object,\n      default: function _default() {\n        return {};\n      }\n    },\n    dev: {\n      type: Boolean,\n      default: false\n    }\n  },\n  data: function data() {\n    var id = uuid();\n    return {\n      ref: 'dv-flyline-chart-enhanced',\n      unique: Math.random(),\n      flylineGradientId: \"flyline-gradient-id-\".concat(id),\n      haloGradientId: \"halo-gradient-id-\".concat(id),\n      /**\n       * @description Type Declaration\n       * \n       * interface Halo {\n       *    show?: boolean\n       *    duration?: [number, number]\n       *    color?: string\n       *    radius?: number\n       * }\n       * \n       * interface Text {\n       *    show?: boolean\n       *    offset?: [number, number]\n       *    color?: string\n       *    fontSize?: number\n       * }\n       * \n       * interface Icon {\n       *    show?: boolean\n       *    src?: string\n       *    width?: number\n       *    height?: number\n       * }\n       * \n       * interface Point {\n       *    name: string\n       *    coordinate: [number, number]\n       *    halo?: Halo\n       *    text?: Text\n       *    icon?: Icon\n       * }\n       * \n       * interface Line {\n       *    width?: number\n       *    color?: string\n       *    orbitColor?: string\n       *    duration?: [number, number]\n       *    radius?: string\n       * }\n       * \n       * interface Flyline extends Line {\n       *    source: string\n       *    target: string\n       * }\n       * \n       * interface FlylineWithPath extends Flyline {\n       *    d: string\n       *    path: [[number, number], [number, number], [number, number]]\n       *    key: string\n       * }\n       */\n      defaultConfig: {\n        /**\n         * @description Flyline chart points\n         * @type {Point[]}\n         * @default points = []\n         */\n        points: [],\n        /**\n         * @description Lines\n         * @type {Flyline[]}\n         * @default lines = []\n         */\n        lines: [],\n        /**\n         * @description Global halo configuration\n         * @type {Halo}\n         */\n        halo: {\n          /**\n           * @description Whether to show halo\n           * @type {Boolean}\n           * @default show = false\n           */\n          show: false,\n          /**\n           * @description Halo animation duration (1s = 10)\n           * @type {[number, number]}\n           */\n          duration: [20, 30],\n          /**\n           * @description Halo color\n           * @type {String}\n           * @default color = '#fb7293'\n           */\n          color: '#fb7293',\n          /**\n           * @description Halo radius\n           * @type {Number}\n           * @default radius = 120\n           */\n          radius: 120\n        },\n        /**\n         * @description Global text configuration\n         * @type {Text}\n         */\n        text: {\n          /**\n           * @description Whether to show text\n           * @type {Boolean}\n           * @default show = false\n           */\n          show: false,\n          /**\n           * @description Text offset\n           * @type {[number, number]}\n           * @default offset = [0, 15]\n           */\n          offset: [0, 15],\n          /**\n           * @description Text color\n           * @type {String}\n           * @default color = '#ffdb5c'\n           */\n          color: '#ffdb5c',\n          /**\n           * @description Text font size\n           * @type {Number}\n           * @default fontSize = 12\n           */\n          fontSize: 12\n        },\n        /**\n         * @description Global icon configuration\n         * @type {Icon}\n         */\n        icon: {\n          /**\n           * @description Whether to show icon\n           * @type {Boolean}\n           * @default show = false\n           */\n          show: false,\n          /**\n           * @description Icon src\n           * @type {String}\n           * @default src = ''\n           */\n          src: '',\n          /**\n           * @description Icon width\n           * @type {Number}\n           * @default width = 15\n           */\n          width: 15,\n          /**\n           * @description Icon height\n           * @type {Number}\n           * @default width = 15\n           */\n          height: 15\n        },\n        /**\n         * @description Global line configuration\n         * @type {Line}\n         */\n        line: {\n          /**\n           * @description Line width\n           * @type {Number}\n           * @default width = 1\n           */\n          width: 1,\n          /**\n           * @description Flyline color\n           * @type {String}\n           * @default color = '#ffde93'\n           */\n          color: '#ffde93',\n          /**\n           * @description Orbit color\n           * @type {String}\n           * @default orbitColor = 'rgba(103, 224, 227, .2)'\n           */\n          orbitColor: 'rgba(103, 224, 227, .2)',\n          /**\n           * @description Flyline animation duration\n           * @type {[number, number]}\n           * @default duration = [20, 30]\n           */\n          duration: [20, 30],\n          /**\n           * @description Flyline radius\n           * @type {Number}\n           * @default radius = 100\n           */\n          radius: 100\n        },\n        /**\n         * @description Back ground image url\n         * @type {String}\n         * @default bgImgSrc = ''\n         */\n        bgImgSrc: '',\n        /**\n         * @description K value\n         * @type {Number}\n         * @default k = -0.5\n         * @example k = -1 ~ 1\n         */\n        k: -0.5,\n        /**\n         * @description Flyline curvature\n         * @type {Number}\n         * @default curvature = 5\n         */\n        curvature: 5,\n        /**\n         * @description Relative points position\n         * @type {Boolean}\n         * @default relative = true\n         */\n        relative: true\n      },\n      /**\n       * @description Fly line data\n       * @type {FlylineWithPath[]}\n       * @default flylines = []\n       */\n      flylines: [],\n      /**\n       * @description Fly line lengths\n       * @type {Number[]}\n       * @default flylineLengths = []\n       */\n      flylineLengths: [],\n      /**\n       * @description Fly line points\n       * @default flylinePoints = []\n       */\n      flylinePoints: [],\n      mergedConfig: null\n    };\n  },\n  watch: {\n    config: function config() {\n      var calcData = this.calcData;\n      calcData();\n    }\n  },\n  methods: {\n    afterAutoResizeMixinInit: function afterAutoResizeMixinInit() {\n      var calcData = this.calcData;\n      calcData();\n    },\n    onResize: function onResize() {\n      var calcData = this.calcData;\n      calcData();\n    },\n    calcData: function () {\n      var _calcData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n        var mergeConfig, calcflylinePoints, calcLinePaths, calcLineLengths;\n        return regeneratorRuntime.wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              mergeConfig = this.mergeConfig, calcflylinePoints = this.calcflylinePoints, calcLinePaths = this.calcLinePaths;\n              mergeConfig();\n              calcflylinePoints();\n              calcLinePaths();\n              calcLineLengths = this.calcLineLengths;\n              _context.next = 7;\n              return calcLineLengths();\n            case 7:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function calcData() {\n        return _calcData.apply(this, arguments);\n      }\n      return calcData;\n    }(),\n    mergeConfig: function mergeConfig() {\n      var config = this.config,\n        defaultConfig = this.defaultConfig;\n      var mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {});\n      var points = mergedConfig.points,\n        lines = mergedConfig.lines,\n        halo = mergedConfig.halo,\n        text = mergedConfig.text,\n        icon = mergedConfig.icon,\n        line = mergedConfig.line;\n      mergedConfig.points = points.map(function (item) {\n        item.halo = deepMerge(deepClone(halo, true), item.halo || {});\n        item.text = deepMerge(deepClone(text, true), item.text || {});\n        item.icon = deepMerge(deepClone(icon, true), item.icon || {});\n        return item;\n      });\n      mergedConfig.lines = lines.map(function (item) {\n        return deepMerge(deepClone(line, true), item);\n      });\n      this.mergedConfig = mergedConfig;\n    },\n    calcflylinePoints: function calcflylinePoints() {\n      var mergedConfig = this.mergedConfig,\n        width = this.width,\n        height = this.height;\n      var relative = mergedConfig.relative,\n        points = mergedConfig.points;\n      this.flylinePoints = points.map(function (item, i) {\n        var _item$coordinate = _slicedToArray(item.coordinate, 2),\n          x = _item$coordinate[0],\n          y = _item$coordinate[1],\n          halo = item.halo,\n          icon = item.icon,\n          text = item.text;\n        if (relative) item.coordinate = [x * width, y * height];\n        item.halo.time = randomExtend.apply(void 0, _toConsumableArray(halo.duration)) / 10;\n        var iw = icon.width,\n          ih = icon.height;\n        item.icon.x = item.coordinate[0] - iw / 2;\n        item.icon.y = item.coordinate[1] - ih / 2;\n        var _text$offset = _slicedToArray(text.offset, 2),\n          ox = _text$offset[0],\n          oy = _text$offset[1];\n        item.text.x = item.coordinate[0] + ox;\n        item.text.y = item.coordinate[1] + oy;\n        item.key = \"\".concat(item.coordinate.toString()).concat(i);\n        return item;\n      });\n    },\n    calcLinePaths: function calcLinePaths() {\n      var getPath = this.getPath,\n        mergedConfig = this.mergedConfig;\n      var points = mergedConfig.points,\n        lines = mergedConfig.lines;\n      this.flylines = lines.map(function (item) {\n        var source = item.source,\n          target = item.target,\n          duration = item.duration;\n        var sourcePoint = points.find(function (_ref) {\n          var name = _ref.name;\n          return name === source;\n        }).coordinate;\n        var targetPoint = points.find(function (_ref2) {\n          var name = _ref2.name;\n          return name === target;\n        }).coordinate;\n        var path = getPath(sourcePoint, targetPoint).map(function (item) {\n          return item.map(function (v) {\n            return parseFloat(v.toFixed(10));\n          });\n        });\n        var d = \"M\".concat(path[0].toString(), \" Q\").concat(path[1].toString(), \" \").concat(path[2].toString());\n        var key = \"path\".concat(path.toString());\n        var time = randomExtend.apply(void 0, _toConsumableArray(duration)) / 10;\n        return _objectSpread(_objectSpread({}, item), {}, {\n          path: path,\n          key: key,\n          d: d,\n          time: time\n        });\n      });\n    },\n    getPath: function getPath(start, end) {\n      var getControlPoint = this.getControlPoint;\n      var controlPoint = getControlPoint(start, end);\n      return [start, controlPoint, end];\n    },\n    getControlPoint: function getControlPoint(_ref3, _ref4) {\n      var _ref5 = _slicedToArray(_ref3, 2),\n        sx = _ref5[0],\n        sy = _ref5[1];\n      var _ref6 = _slicedToArray(_ref4, 2),\n        ex = _ref6[0],\n        ey = _ref6[1];\n      var getKLinePointByx = this.getKLinePointByx,\n        mergedConfig = this.mergedConfig;\n      var curvature = mergedConfig.curvature,\n        k = mergedConfig.k;\n      var mx = (sx + ex) / 2,\n        my = (sy + ey) / 2;\n      var distance = getPointDistance([sx, sy], [ex, ey]);\n      var targetLength = distance / curvature;\n      var disDived = targetLength / 2;\n      var dx = mx,\n        dy = my;\n      do {\n        dx += disDived;\n        dy = getKLinePointByx(k, [mx, my], dx)[1];\n      } while (getPointDistance([mx, my], [dx, dy]) < targetLength);\n      return [dx, dy];\n    },\n    getKLinePointByx: function getKLinePointByx(k, _ref7, x) {\n      var _ref8 = _slicedToArray(_ref7, 2),\n        lx = _ref8[0],\n        ly = _ref8[1];\n      var y = ly - k * lx + k * x;\n      return [x, y];\n    },\n    calcLineLengths: function () {\n      var _calcLineLengths = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n        var $nextTick, flylines, $refs;\n        return regeneratorRuntime.wrap(function _callee2$(_context2) {\n          while (1) switch (_context2.prev = _context2.next) {\n            case 0:\n              $nextTick = this.$nextTick, flylines = this.flylines, $refs = this.$refs;\n              _context2.next = 3;\n              return $nextTick();\n            case 3:\n              this.flylineLengths = flylines.map(function (_ref9) {\n                var key = _ref9.key;\n                return $refs[key][0].getTotalLength();\n              });\n            case 4:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, this);\n      }));\n      function calcLineLengths() {\n        return _calcLineLengths.apply(this, arguments);\n      }\n      return calcLineLengths;\n    }(),\n    consoleClickPos: function consoleClickPos(_ref10) {\n      var offsetX = _ref10.offsetX,\n        offsetY = _ref10.offsetY;\n      var width = this.width,\n        height = this.height,\n        dev = this.dev;\n      if (!dev) return;\n      var relativeX = (offsetX / width).toFixed(2);\n      var relativeY = (offsetY / height).toFixed(2);\n      console.warn(\"dv-flyline-chart-enhanced DEV: \\n Click Position is [\".concat(offsetX, \", \").concat(offsetY, \"] \\n Relative Position is [\").concat(relativeX, \", \").concat(relativeY, \"]\"));\n    }\n  }\n};",null]}