How to use the konva.Label function in konva

To help you get started, we’ve selected a few konva examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tryolabs / taggerine / frontend / src / utils.js View on Github external
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
}
github NCI-GDC / portal-ui / src / packages / @ncigdc / modern_components / GeneExpression / inchlib / index.js View on Github external
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({
github sb / smallbasic-editor / Source / SuperBasic.Client / Shapes / ButtonShape.ts View on Github external
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,

konva

<p align="center"> <img src="https://konvajs.org/android-chrome-192x192.png" alt="Konva logo" height="180" /> </p>

MIT
Latest version published 9 days ago

Package Health Score

88 / 100
Full package analysis