Preparing search index...

    Function getSymbol

    • Gets an SVG as a string or as a Data URL, with option to modify attributes.

      Parameters

      • symbolName: Symbols

        Name of the icon without extension .svg

      • Optionaloptions: SymbolOptions

        Options to modify attributes or return as a Data URL

      Returns { toDataURL(): string; toString(): string }

      SVG as string or Data URL

      import { getSymbol, SIGNS } from 'western-signs'

      // Get the symbol with initial options
      const symbol = getSymbol(SIGNS.TAURUS, { stroke: 'blue', stroke-width: 2 })

      // Log the modified SVG as a string
      console.log(symbol.toString())

      // Log the modified SVG as a Data URL
      console.log(symbol.toDataURL())

      Will throw an error if the specified SVG file is not found