Skip to content
  1. API
  2. Types

Badge

Type: object

Properties

  • color(optional) Color[="white"] Fill color of the badge.

  • image(optional) object|null|string If not an object, alias to image.url

    • scale(optional) number[=1] Size of the image relative to the badge diameter
    • url(optional) null|string[=null] URL of the image to display in the badge
  • minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the badge will not be displayed

  • positionScale(optional) number[=1] Center of the badge relative to the node size (1 = at the node's border)

  • scale(optional) number[=0.45] Size of the badge relative to the node.

  • stroke(optional) object

    • color(optional) Color|"inherit"[="black"] Color of the badge stroke
    • scalingMethod(optional) ScalingMethod[="fixed"] Indicates if the badge width should be multiplied by the zoom when the node is displayed.
    • width(optional) PixelSize[=2] Width of the badge stroke
  • text(optional) object|TextContent If not an object, alias for text.content

    • color(optional) "inherit"|Color[="black"] Color of the badge text
    • content(optional) TextContent[=null] Text to display in the badge
    • font(optional) string[="Arial"] Font to use for the badge text
    • paddingLeft(optional) number[=0] Horizontal padding of the text inside the badge
    • paddingTop(optional) number[=0] Vertical padding of the text inside the badge
    • scale(optional) number[=0.5] Size of the text relative to the badge diameter
    • style(optional) FontStyle[="normal"] Style applied to the badge text