UNPKG

@visactor/vchart

Version:

charts lib based @visactor/VGrammar

19 lines (13 loc) 744 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.copyDataView = void 0; const vutils_1 = require("@visactor/vutils"), vdataset_1 = require("@visactor/vdataset"); function copyOneDataView(d, deep = !1) { let _deep = deep; return d.latestData instanceof vdataset_1.DataView && (_deep = !1), _deep ? (0, vutils_1.cloneDeep)(d.latestData) : d.latestData && d.latestData.slice(); } 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))); exports.copyDataView = copyDataView; //# sourceMappingURL=copy-data-view.js.map