Skip to main content
Renders a symbol from a set of predefined shapes based on D3 symbol types. The Symbols component provides various geometric shapes that can be used as markers in charts. Shapes include circles, squares, diamonds, triangles, stars, and more.

Props

Shape

SymbolType
default:"circle"
The type of symbol to render. Options:
  • 'circle' - Circle
  • 'cross' - Cross/plus sign
  • 'diamond' - Diamond
  • 'square' - Square
  • 'star' - Five-pointed star
  • 'triangle' - Triangle
  • 'wye' - Y-shape

Positioning

number
The x-coordinate of the symbol center in pixels.
number
The y-coordinate of the symbol center in pixels.

Size

number
default:"64"
The size of the symbol. The meaning depends on the sizeType prop.
'area' | 'diameter'
default:"area"
How to interpret the size prop:
  • 'area' - Size represents the area in square pixels
  • 'diameter' - Size represents the diameter/width in pixels

Appearance

string
CSS class name to apply to the symbol element.

SVG properties

This component accepts all standard SVG path element properties including:
  • fill - Fill color
  • stroke - Stroke color
  • strokeWidth - Stroke width
  • opacity - Opacity value
  • style - Inline styles
All SVG path event handlers are also supported (onClick, onMouseEnter, etc.).

Static methods

registerSymbol

Registers a custom D3 symbol type for use with the Symbols component.

Examples

Basic symbols

Symbol with diameter size

Custom symbol registration