{"version":3,"file":"vega-tooltip.js","sources":["../src/formatValue.ts","../src/style.ts","../src/defaults.ts","../src/position.ts","../src/Handler.ts","../src/index.ts"],"sourcesContent":["import {isArray, isObject, isString} from 'vega-util';\n\n/**\n * Format the value to be shown in the tooltip.\n *\n * @param value The value to show in the tooltip.\n * @param valueToHtml Function to convert a single cell value to an HTML string\n */\nexport function formatValue(value: any, valueToHtml: (value: any) => string, maxDepth: number): string {\n if (isArray(value)) {\n return `[${value.map((v) => valueToHtml(isString(v) ? v : stringify(v, maxDepth))).join(', ')}]`;\n }\n\n if (isObject(value)) {\n let content = '';\n\n const {title, image, ...rest} = value as any;\n\n if (title) {\n content += `
${valueToHtml(key)}: | ${valueToHtml(val)} |