Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createLabel = ({ text, color }) => {
const { opacity, fontSize, padding, fill, xOffset, yOffset } = LABEL_DEFAULTS
const label = new Konva.Label({ x: xOffset, y: yOffset, opacity })
label.add(new Konva.Tag({ fill: color }))
label.add(new Konva.Text({ text, fontSize, padding, fill }))
return label
}
b: 217,
},
end: {
r: 35,
g: 139,
b: 69,
},
},
};
/**
* Default Konvajs objects references
* @name InCHlib#objects_ref
*/
self.objects_ref = {
tooltip_label: new Konva.Label({
opacity: 1,
listening: false,
}),
tooltip_tag: new Konva.Tag({
cornerRadius: 4,
fill: self.options.tooltip.fill,
lineJoin: 'round',
listening: false,
pointerHeight: 10,
pointerWidth: 18,
stroke: self.options.tooltip.stroke,
strokeWidth: 2,
}),
tooltip_text: new Konva.Text({
public constructor(caption: string, left: number, top: number) {
const label = new Konva.Label({
x: left,
y: top,
listening: true
});
label.add(new Konva.Tag({
fill: ShapeStyles.defaultButtonColor,
stroke: ShapeStyles.defaultBorderColor,
strokeWidth: ShapeStyles.defaultBorderSize
}));
label.add(new Konva.Text({
text: caption,
fontFamily: ShapeStyles.defaultFontName,
fontSize: ShapeStyles.defaultFontSize,
padding: ShapeStyles.defaultPadding,