Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getClip(coord) {
const { start, end, width, height } = coord;
const clip = new G.Shapes.Rect({
attrs: {
x: start.x,
y: end.y,
width: 0,
height,
},
});
clip.set('isClip', true);
return clip;
}
function createClip(coord, from, to) {
const margin = 200;
const center = coord.getCenter();
const radius = coord.getRadius();
const clip = new G.Shapes.Fan({
attrs: {
x: center.x,
y: center.y,
rs: 0,
re: radius + margin,
startAngle: from,
endAngle: to,
},
});
return clip;
}