UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

25 lines 647 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.attributeKeys = exports.attributeOf = void 0; // TODO: Add more attributes need to be transform. // TODO: Opacity transform unexpectedly. function attributeOf(shape, keys) { const attribute = {}; for (const key of keys) { const value = shape.style[key]; if (value) { attribute[key] = value; } } return attribute; } exports.attributeOf = attributeOf; exports.attributeKeys = [ 'fill', 'stroke', 'fillOpacity', 'strokeOpacity', 'opacity', 'lineWidth', ]; //# sourceMappingURL=utils.js.map