"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setVisibility = setVisibility;
/**
* 设置图形实例的可见性
*
* Set the visibility of the shape instance
* @param shape - 图形实例 | shape instance
* @param value - 可见性 | visibility
* @param filter - 筛选出需要设置可见性的图形 | Filter out the shapes that need to set visibility
* @remarks
* 在设置 enableCSSParsing 为 false 的情况下,复合图形无法继承父属性,因此需要对所有子图形应用相同的可见性
*
* After setting enableCSSParsing to false, the compound shape cannot inherit the parent attribute, so the same visibility needs to be applied to all child shapes
*/
function setVisibility(shape, value, filter) {
const callback = (node) => {
if (filter && !filter(node))
return;
node.style.visibility = value;
};
shape.forEach((node) => {
callback(node);
});
}
//# sourceMappingURL=visibility.js.map