from typing import Union


def _get_vars(symbol: Union[str, int]) -> str:
    """Get the javascript variable declarations associated with a given symbol.

    These are adapted from plotly.js -> src/components/drawing/symbol_defs.js

    Args:
        symbol: The symbol whose variables should be retrieved.

    Returns:
        A minified string representation of the variables to be declared in javascript.
    """
    if isinstance(symbol, str):
        return {'circle': 'var b1=n.round(t,2);',
                'square': 'var b1=n.round(t,2);',
                'diamond': 'var b1=n.round(t*1.3,2);',
                'hexagram': 'var b1=n.round(t,2);var b2=n.round(t/2,2);var b3=n.round(t*Math.sqrt(3)/2,2);'}[symbol]
    return {37: 'var d1=n.round(t*1.2,2);var d2=n.round(t*1.6,2);var d3=n.round(t*0.8,2);',
            38: 'var d1=n.round(t*1.2,2);var d2=n.round(t*1.6,2);var d3=n.round(t*0.8,2);',
            39: 'var d1=n.round(t*1.2,2);var d2=n.round(t*1.6,2);var d3=n.round(t*0.8,2);',
            40: 'var d1=n.round(t*1.2,2);var d2=n.round(t*1.6,2);var d3=n.round(t*0.8,2);',
            34: 'var d1=n.round(t,2);',
            33: 'var d1=n.round(t*1.4,2);',
            35: 'var d1=n.round(t*1.2,2);var d2=n.round(t*0.85,2);',
            36: 'var d1=n.round(t/2,2);var d2=n.round(t,2);'}[symbol]