UNPKG

@antv/s2

Version:

effective spreadsheet render core lib

22 lines 743 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createOrUpdateRect = exports.batchSetStyle = void 0; const g_1 = require("@antv/g"); const lodash_1 = require("lodash"); function batchSetStyle(obj, style) { obj.setAttributes(style, { skipDispatchAttrModifiedEvent: true }); } exports.batchSetStyle = batchSetStyle; function createOrUpdateRect(propertyPath, style) { // @ts-ignore const context = this; const obj = (0, lodash_1.get)(context, propertyPath); if (!obj) { (0, lodash_1.set)(context, propertyPath, new g_1.Rect({ style })); } else { batchSetStyle(obj, style); } } exports.createOrUpdateRect = createOrUpdateRect; //# sourceMappingURL=g-utils.js.map