UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

21 lines 493 B
// TODO: Add more attributes need to be transform. // TODO: Opacity transform unexpectedly. export function attributeOf(shape, keys) { const attribute = {}; for (const key of keys) { const value = shape.style[key]; if (value) { attribute[key] = value; } } return attribute; } export const attributeKeys = [ 'fill', 'stroke', 'fillOpacity', 'strokeOpacity', 'opacity', 'lineWidth', ]; //# sourceMappingURL=utils.js.map