This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/components/VSparkline/helpers/path.js.map

1 line
2.8 KiB
Text
Raw Normal View History

2019-08-11 18:48:02 +00:00
{"version":3,"sources":["../../../../src/components/VSparkline/helpers/path.ts"],"names":[],"mappings":"AACA,SAAS,cAAT,EAAyB,WAAzB,EAAsC,MAAtC,QAAoD,QAApD;AAEA;;;;AAGA,OAAM,SAAU,OAAV,CAAmB,MAAnB,EAAoC,MAApC,EAAoD,IAAI,GAAG,KAA3D,EAAkE,MAAM,GAAG,EAA3E,EAA6E;AACjF,QAAM,KAAK,GAAG,MAAM,CAAC,KAAP,EAAd;AACA,QAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,MAAP,GAAgB,CAAjB,CAAlB;AAEA,SACE,CAAC,IAAI,GAAG,IAAI,KAAK,CAAC,CAAC,IAAI,MAAM,GAAG,KAAK,CAAC,CAAf,GAAmB,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAA7D,GAAkE,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAA7F,IACA,MAAM,CACH,GADH,CACO,CAAC,KAAD,EAAQ,KAAR,KAAiB;AACpB,UAAM,IAAI,GAAG,MAAM,CAAC,KAAK,GAAG,CAAT,CAAnB;AACA,UAAM,IAAI,GAAG,MAAM,CAAC,KAAK,GAAG,CAAT,CAAN,IAAqB,KAAlC;AACA,UAAM,WAAW,GAAG,IAAI,IAAI,cAAc,CAAC,IAAD,EAAO,KAAP,EAAc,IAAd,CAA1C;;AAEA,QAAI,CAAC,IAAD,IAAS,WAAb,EAA0B;AACxB,aAAO,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAA7B;AACD;;AAED,UAAM,SAAS,GAAG,IAAI,CAAC,GAAL,CAChB,WAAW,CAAC,IAAD,EAAO,KAAP,CADK,EAEhB,WAAW,CAAC,IAAD,EAAO,KAAP,CAFK,CAAlB;AAIA,UAAM,mBAAmB,GAAG,SAAS,GAAG,CAAZ,GAAgB,MAA5C;AACA,UAAM,cAAc,GAAG,mBAAmB,GAAG,SAAS,GAAG,CAAf,GAAmB,MAA7D;AAEA,UAAM,MAAM,GAAG,MAAM,CAAC,IAAD,EAAO,KAAP,EAAc,cAAd,CAArB;AACA,UAAM,KAAK,GAAG,MAAM,CAAC,IAAD,EAAO,KAAP,EAAc,cAAd,CAApB;AAEA,WAAO,IAAI,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAA3E;AACD,GArBH,EAsBG,IAtBH,CAsBQ,EAtBR,CADA,IAwBC,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,MAAM,GAAG,KAAK,CAAC,CAAf,GAAmB,CAAC,IAApC,GAA2C,EAxBhD,CADF;AA2BD","sourcesContent":["import { Point } from '../VSparkline'\nimport { checkCollinear, getDistance, moveTo } from './math'\n\n/**\n * From https://github.com/unsplash/react-trend/blob/master/src/helpers/DOM.helpers.js#L18\n */\nexport function genPath (points: Point[], radius: number, fill = false, height = 75) {\n const start = points.shift()!\n const end = points[points.length - 1]\n\n return (\n (fill ? `M${start.x} ${height - start.x + 2} L${start.x} ${start.y}` : `M${start.x} ${start.y}`) +\n points\n .map((point, index) => {\n const next = points[index + 1]\n const prev = points[index - 1] || start\n const isCollinear = next && checkCollinear(next, point, prev)\n\n if (!next || isCollinear) {\n return `L${point.x} ${point.y}`\n }\n\n const threshold = Math.min(\n getDistance(prev, point),\n getDistance(next, point)\n )\n const isTooCloseForRadius = threshold / 2 < radius\n const radiusForPoint = isTooCloseForRadius ? threshold / 2 : radius\n\n const before = moveTo(prev, point, radiusForPoint)\n const after = moveTo(next, point, radiusForPoint)\n\n return `L${before.x} ${before.y}S${point.x} ${point.y} ${after.x} ${after.y}`\n })\n .join('') +\n (fill ? `L${end.x} ${height - start.x + 2} Z` : '')\n )\n}\n"],"sourceRoot":"","file":"path.js"}