Interface SymbolType

A Symbol Type.

Symbol types are typically not used directly, instead being passed to symbol.type. However, you can define your own symbol type implementation should none of the built-in types satisfy your needs using the following interface. You can also use this low-level interface with a built-in symbol type as an alternative to the symbol generator.

interface SymbolType {
    draw(context, size): void;
}

Methods

Methods

  • Renders this symbol type to the specified context with the specified size in square pixels. The context implements the CanvasPath interface. (Note that this is a subset of the CanvasRenderingContext2D interface!)

    Parameters

    • context: CanvasPath_D3Shape

      A rendering context implementing CanvasPath.

    • size: number

      Size of the symbol to draw.

    Returns void