AnalysisSystemForRadionucli.../src/utils/sampleHelper.js

21 lines
562 B
JavaScript
Raw Normal View History

/**
* 在返回的allData中查找指定的数据
* @param {Array} allData
* @param {*} name
* @param {*} group
*/
export const getLineData = (allData, name, group, isList = false) => {
const arrFunc = isList ? Array.prototype.filter : Array.prototype.find
return arrFunc.call(allData, item => item.name == name && item.group == group) || {}
}
/**
* 转换pointlist类型数据到series的data可用的数据
*/
export const transformPointListData = pointlist => {
if (!pointlist) {
return []
}
return pointlist.map(({ x, y }) => [x, y])
}