{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\@jiaminghi\\data-view\\lib\\components\\flylineChart\\src\\main.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\@jiaminghi\\data-view\\lib\\components\\flylineChart\\src\\main.vue","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import _toConsumableArray from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport _slicedToArray from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\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: 'DvFlylineChart',\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',\n      unique: Math.random(),\n      maskId: \"flyline-mask-id-\".concat(id),\n      maskCircleId: \"mask-circle-id-\".concat(id),\n      gradientId: \"gradient-id-\".concat(id),\n      gradient2Id: \"gradient2-id-\".concat(id),\n      defaultConfig: {\n        /**\n         * @description Flyline chart center point\n         * @type {Array<Number>}\n         * @default centerPoint = [0, 0]\n         */\n        centerPoint: [0, 0],\n\n        /**\n         * @description Flyline start points\n         * @type {Array<Array<Number>>}\n         * @default points = []\n         * @example points = [[10, 10], [100, 100]]\n         */\n        points: [],\n\n        /**\n         * @description Flyline width\n         * @type {Number}\n         * @default lineWidth = 1\n         */\n        lineWidth: 1,\n\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        /**\n         * @description Flyline color\n         * @type {String}\n         * @default orbitColor = '#ffde93'\n         */\n        flylineColor: '#ffde93',\n\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        /**\n         * @description Flyline curvature\n         * @type {Number}\n         * @default curvature = 5\n         */\n        curvature: 5,\n\n        /**\n         * @description Flyline radius\n         * @type {Number}\n         * @default flylineRadius = 100\n         */\n        flylineRadius: 100,\n\n        /**\n         * @description Flyline animation duration\n         * @type {Array<Number>}\n         * @default duration = [20, 30]\n         */\n        duration: [20, 30],\n\n        /**\n         * @description Relative points position\n         * @type {Boolean}\n         * @default relative = true\n         */\n        relative: true,\n\n        /**\n         * @description Back ground image url\n         * @type {String}\n         * @default bgImgUrl = ''\n         * @example bgImgUrl = './img/bg.jpg'\n         */\n        bgImgUrl: '',\n\n        /**\n         * @description Text configuration\n         * @type {Object}\n         */\n        text: {\n          /**\n           * @description Text offset\n           * @type {Array<Number>}\n           * @default offset = [0, 15]\n           */\n          offset: [0, 15],\n\n          /**\n           * @description Text color\n           * @type {String}\n           * @default color = '#ffdb5c'\n           */\n          color: '#ffdb5c',\n\n          /**\n           * @description Text font size\n           * @type {Number}\n           * @default fontSize = 12\n           */\n          fontSize: 12\n        },\n\n        /**\n         * @description Halo configuration\n         * @type {Object}\n         */\n        halo: {\n          /**\n           * @description Weather to show halo\n           * @type {Boolean}\n           * @default show = true\n           * @example show = true | false\n           */\n          show: true,\n\n          /**\n           * @description Halo animation duration (10 = 1s)\n           * @type {Number}\n           * @default duration = 30\n           */\n          duration: 30,\n\n          /**\n           * @description Halo color\n           * @type {String}\n           * @default color = '#fb7293'\n           */\n          color: '#fb7293',\n\n          /**\n           * @description Halo max radius\n           * @type {Number}\n           * @default radius = 120\n           */\n          radius: 120\n        },\n\n        /**\n         * @description Center point img configuration\n         * @type {Object}\n         */\n        centerPointImg: {\n          /**\n           * @description Center point img width\n           * @type {Number}\n           * @default width = 40\n           */\n          width: 40,\n\n          /**\n           * @description Center point img height\n           * @type {Number}\n           * @default height = 40\n           */\n          height: 40,\n\n          /**\n           * @description Center point img url\n           * @type {String}\n           * @default url = ''\n           */\n          url: ''\n        },\n\n        /**\n         * @description Points img configuration\n         * @type {Object}\n         * @default radius = 120\n         */\n        pointsImg: {\n          /**\n           * @description Points img width\n           * @type {Number}\n           * @default width = 15\n           */\n          width: 15,\n\n          /**\n           * @description Points img height\n           * @type {Number}\n           * @default height = 15\n           */\n          height: 15,\n\n          /**\n           * @description Points img url\n           * @type {String}\n           * @default url = ''\n           */\n          url: ''\n        }\n      },\n      mergedConfig: null,\n      paths: [],\n      lengths: [],\n      times: [],\n      texts: []\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, createFlylinePaths, calcLineLengths, calcTimes, calcTexts;\n        return regeneratorRuntime.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                mergeConfig = this.mergeConfig, createFlylinePaths = this.createFlylinePaths, calcLineLengths = this.calcLineLengths;\n                mergeConfig();\n                createFlylinePaths();\n                _context.next = 5;\n                return calcLineLengths();\n\n              case 5:\n                calcTimes = this.calcTimes, calcTexts = this.calcTexts;\n                calcTimes();\n                calcTexts();\n\n              case 8:\n              case \"end\":\n                return _context.stop();\n            }\n          }\n        }, _callee, this);\n      }));\n\n      function calcData() {\n        return _calcData.apply(this, arguments);\n      }\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      mergedConfig.points = points.map(function (item) {\n        if (item instanceof Array) {\n          return {\n            position: item,\n            text: ''\n          };\n        }\n\n        return item;\n      });\n      this.mergedConfig = mergedConfig;\n    },\n    createFlylinePaths: function createFlylinePaths() {\n      var getPath = this.getPath,\n          mergedConfig = this.mergedConfig,\n          width = this.width,\n          height = this.height;\n      var centerPoint = mergedConfig.centerPoint,\n          points = mergedConfig.points,\n          relative = mergedConfig.relative;\n      points = points.map(function (_ref) {\n        var position = _ref.position;\n        return position;\n      });\n\n      if (relative) {\n        centerPoint = [width * centerPoint[0], height * centerPoint[1]];\n        points = points.map(function (_ref2) {\n          var _ref3 = _slicedToArray(_ref2, 2),\n              x = _ref3[0],\n              y = _ref3[1];\n\n          return [width * x, height * y];\n        });\n      }\n\n      this.paths = points.map(function (point) {\n        return getPath(centerPoint, point);\n      });\n    },\n    getPath: function getPath(center, point) {\n      var getControlPoint = this.getControlPoint;\n      var controlPoint = getControlPoint(center, point);\n      return [point, controlPoint, center];\n    },\n    getControlPoint: function getControlPoint(_ref4, _ref5) {\n      var _ref6 = _slicedToArray(_ref4, 2),\n          sx = _ref6[0],\n          sy = _ref6[1];\n\n      var _ref7 = _slicedToArray(_ref5, 2),\n          ex = _ref7[0],\n          ey = _ref7[1];\n\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\n      do {\n        dx += disDived;\n        dy = getKLinePointByx(k, [mx, my], dx)[1];\n      } while (getPointDistance([mx, my], [dx, dy]) < targetLength);\n\n      return [dx, dy];\n    },\n    getKLinePointByx: function getKLinePointByx(k, _ref8, x) {\n      var _ref9 = _slicedToArray(_ref8, 2),\n          lx = _ref9[0],\n          ly = _ref9[1];\n\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, paths, $refs;\n        return regeneratorRuntime.wrap(function _callee2$(_context2) {\n          while (1) {\n            switch (_context2.prev = _context2.next) {\n              case 0:\n                $nextTick = this.$nextTick, paths = this.paths, $refs = this.$refs;\n                _context2.next = 3;\n                return $nextTick();\n\n              case 3:\n                this.lengths = paths.map(function (foo, i) {\n                  return $refs[\"path\".concat(i)][0].getTotalLength();\n                });\n\n              case 4:\n              case \"end\":\n                return _context2.stop();\n            }\n          }\n        }, _callee2, this);\n      }));\n\n      function calcLineLengths() {\n        return _calcLineLengths.apply(this, arguments);\n      }\n\n      return calcLineLengths;\n    }(),\n    calcTimes: function calcTimes() {\n      var _this$mergedConfig = this.mergedConfig,\n          duration = _this$mergedConfig.duration,\n          points = _this$mergedConfig.points;\n      this.times = points.map(function (foo) {\n        return randomExtend.apply(void 0, _toConsumableArray(duration)) / 10;\n      });\n    },\n    calcTexts: function calcTexts() {\n      var points = this.mergedConfig.points;\n      this.texts = points.map(function (_ref10) {\n        var text = _ref10.text;\n        return text;\n      });\n    },\n    consoleClickPos: function consoleClickPos(_ref11) {\n      var offsetX = _ref11.offsetX,\n          offsetY = _ref11.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 DEV: \\n Click Position is [\".concat(offsetX, \", \").concat(offsetY, \"] \\n Relative Position is [\").concat(relativeX, \", \").concat(relativeY, \"]\"));\n    }\n  }\n};",null]}