UNPKG

@visactor/vchart

Version:

charts lib based @visactor/VGrammar

12 lines (8 loc) 575 B
import { cloneDeep } from "@visactor/vutils"; import { DataView } from "@visactor/vdataset"; function copyOneDataView(d, deep = !1) { let _deep = deep; return d.latestData instanceof DataView && (_deep = !1), _deep ? cloneDeep(d.latestData) : d.latestData && d.latestData.slice(); } export const copyDataView = (data, options) => 0 === data.length ? [] : 1 === data.length ? copyOneDataView(data[0], null == options ? void 0 : options.deep) : data.map((d => copyOneDataView(d, null == options ? void 0 : options.deep))); //# sourceMappingURL=copy-data-view.js.map