You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
6.8 KiB
1 line
6.8 KiB
{"version":3,"sources":["webpack:///./node_modules/core-js/modules/web.dom-collections.for-each.js","webpack:///./node_modules/core-js/modules/es.array.sort.js","webpack:///./src/assets/chartOpt/c0002.js"],"names":["global","DOMIterables","forEach","createNonEnumerableProperty","COLLECTION_NAME","Collection","CollectionPrototype","prototype","error","$","aFunction","toObject","fails","sloppyArrayMethod","test","nativeSort","sort","FAILS_ON_UNDEFINED","undefined","FAILS_ON_NULL","SLOPPY_METHOD","FORCED","target","proto","forced","comparefn","call","this","opt","mergeMatrix","m1","m2","x","Object","keys","y","res","x_key","y_key","dataPlus","dataReduce","currentResType","dataSum","heatmapData","cloneDeep","xAxis","data","yAxis","max","map","key","a","b","visualMap","resData","push","series"],"mappings":"qGAAA,IAAIA,EAAS,EAAQ,QACjBC,EAAe,EAAQ,QACvBC,EAAU,EAAQ,QAClBC,EAA8B,EAAQ,QAE1C,IAAK,IAAIC,KAAmBH,EAAc,CACxC,IAAII,EAAaL,EAAOI,GACpBE,EAAsBD,GAAcA,EAAWE,UAEnD,GAAID,GAAuBA,EAAoBJ,UAAYA,EAAS,IAClEC,EAA4BG,EAAqB,UAAWJ,GAC5D,MAAOM,GACPF,EAAoBJ,QAAUA,K,oCCXlC,IAAIO,EAAI,EAAQ,QACZC,EAAY,EAAQ,QACpBC,EAAW,EAAQ,QACnBC,EAAQ,EAAQ,QAChBC,EAAoB,EAAQ,QAE5BC,EAAO,GACPC,EAAaD,EAAKE,KAGlBC,EAAqBL,GAAM,WAC7BE,EAAKE,UAAKE,MAGRC,EAAgBP,GAAM,WACxBE,EAAKE,KAAK,SAGRI,EAAgBP,EAAkB,QAElCQ,EAASJ,IAAuBE,GAAiBC,EAIrDX,EAAE,CAAEa,OAAQ,QAASC,OAAO,EAAMC,OAAQH,GAAU,CAClDL,KAAM,SAAcS,GAClB,YAAqBP,IAAdO,EACHV,EAAWW,K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ASA,EAAED,KAAG,GACjIvB,EAAIyB,UAAUL,IAAMA,EACpB,IAAIM,EAAU,GAQd,OAPA1B,EAAIiB,MAAMC,KAAK5C,SAAQ,SAAAmC,GACnBT,EAAImB,MAAMD,KAAK5C,SAAQ,SAAAoC,GACnBgB,EAAQC,KAAK,CAAClB,EAAOC,EAAOK,EAAYN,GAAOC,WAGvDV,EAAI4B,OAAO,GAAGV,KAAOQ,EAEd1B","file":"js/chunk-451923cc.446b3203.js","sourcesContent":["var global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar forEach = require('../internals/array-for-each');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {\n createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);\n } catch (error) {\n CollectionPrototype.forEach = forEach;\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\nvar sloppyArrayMethod = require('../internals/sloppy-array-method');\n\nvar test = [];\nvar nativeSort = test.sort;\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar SLOPPY_METHOD = sloppyArrayMethod('sort');\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD;\n\n// `Array.prototype.sort` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? nativeSort.call(toObject(this))\n : nativeSort.call(toObject(this), aFunction(comparefn));\n }\n});\n","import { cloneDeep } from \"lodash\";\r\n\r\nconst opt = { \r\n \"tooltip\": { \r\n \"position\": \"top\" \r\n }, \r\n \"animation\": true, \r\n \"grid\": { \r\n \"height\": \"70%\", \r\n }, \r\n \"xAxis\": { \r\n \"type\": \"category\", \r\n \"data\": [], \r\n \"splitArea\": { \"show\": true }\r\n }, \r\n \"yAxis\": { \r\n \"type\": \"category\", \r\n \"data\": [],\r\n \"splitArea\": \r\n { \r\n \"show\": true \r\n }\r\n }, \r\n \"visualMap\": { \r\n \"min\": 0, \r\n \"max\": 10, \r\n \"calculable\": true, \r\n \"orient\": \"horizontal\", \r\n \"left\": \"center\", \r\n \"bottom\": \"5%\" \r\n }, \r\n \"series\": [\r\n { \r\n \"name\": \"Punch Card\", \r\n \"type\": \"heatmap\", \r\n \"data\": [[]],\r\n \"label\": { \r\n \"normal\": { \r\n \"show\": true \r\n } \r\n }, \r\n \"itemStyle\": { \r\n \"emphasis\": { \r\n \"shadowBlur\": 10, \r\n \"shadowColor\": \"rgba(0, 0, 0, 0.5)\" \r\n } \r\n } \r\n }] \r\n }\r\n\r\n\r\nexport default function ({\r\n dataPlus,\r\n dataReduce,\r\n currentResType\r\n}) {\r\n const dataSum = mergeMatrix(dataPlus, dataReduce)\r\n\r\n let heatmapData = []\r\n if (currentResType === 0) heatmapData = cloneDeep(dataPlus) \r\n if (currentResType === 1) heatmapData = cloneDeep(dataReduce)\r\n \r\n opt.xAxis.data = Object.keys(dataPlus)\r\n opt.yAxis.data = Object.keys(heatmapData[Object.keys(heatmapData)[0]])\r\n\r\n const max = Object.keys(dataSum[Object.keys(dataPlus)[0]]).map(key => dataSum[Object.keys(dataPlus)[0]][key]).sort((a,b) => b-a)[0]\r\n opt.visualMap.max = max\r\n let resData = []\r\n opt.xAxis.data.forEach(x_key => {\r\n opt.yAxis.data.forEach(y_key => {\r\n resData.push([x_key, y_key, heatmapData[x_key][y_key]])\r\n })\r\n })\r\n opt.series[0].data = resData;\r\n\r\n return opt\r\n}\r\n\r\n\r\nfunction mergeMatrix(m1,m2){\r\n let x = Object.keys(m1)\r\n let y = Object.keys(m1[x[0]])\r\n\r\n let res = {}\r\n x.forEach(x_key => {\r\n res[x_key] = {}\r\n y.forEach(y_key => {\r\n res[x_key][y_key] = m1[x_key][y_key] + m2[x_key][y_key]\r\n })\r\n })\r\n return res\r\n}"],"sourceRoot":""} |