Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
draw: function () {
const { text, fillColor, textAttrs, shapeAttrs } = this.attr();
this.points = this.points || shapeAttrs.points;
this.$shape = new Polygon();
let mergeShapeAttr = newObj({
points: this.points,
fillColor,
// anchor: [0.5, 0.5],
}, shapeAttrs);
this.points = mergeShapeAttr.points;
this.attr({ shapeAttrs: mergeShapeAttr });
this.$shape.attr(mergeShapeAttr);
this.append(this.$shape);
addLabel.call(this, text, textAttrs)
}
}
this.renderLines.forEach((line, i) => {
let color = this.color(i)
let areaAttrs = {
fillColor: color,
lineWidth: 0,
strokeColor: 'transparent'
}
let cusAttrs = this.style('area')(
areaAttrs,
line.data.map(item => item.dataOrigin),
i
)
Object.assign(areaAttrs, cusAttrs)
if (cusAttrs !== false) {
delete areaAttrs.opacity
let polygon = new Polygon()
polygon.attr(areaAttrs)
let attrs = getAreaPoints(lines, i, { size, smooth, stack }, 'to')
patchPoints.start.push(line.points[0].point)
patchPoints.end.push(line.points[line.points.length - 1].point)
polygon.attr(attrs)
group.append(polygon)
polygon.on('afterdraw', e => {
setTimeout(_ => {
removeLine(patchPoints, layer, this.attr(), 0)
})
if (compositeOperation) {
layer.context.globalCompositeOperation = 'source-over'
}
})
new Tween()
.from(getAreaPoints(lines, i, { size, smooth, stack }, 'from'))