Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default async function(type, scaleFactor) {
if (type !== Type.Canvas && type !== Type.SVG && type !== Type.PNG) {
error('Unrecognized image type: ' + type);
}
const r = await renderHeadless(this, type, scaleFactor);
return type === Type.SVG
? toBlobURL(r.svg(), 'image/svg+xml')
: r.canvas().toDataURL('image/png');
}
export default async function(type, scaleFactor) {
if (type !== Type.Canvas && type !== Type.SVG && type !== Type.PNG) {
error('Unrecognized image type: ' + type);
}
const r = await renderHeadless(this, type, scaleFactor);
return type === Type.SVG
? toBlobURL(r.svg(), 'image/svg+xml')
: r.canvas().toDataURL('image/png');
}
import {Warn} from 'vega-util'
import {RenderType} from 'vega-scenegraph'
export const LOG_LEVEL = Warn
export const RENDER_TYPE = RenderType.SVG
export const COMPONENT_TEMPLATE = '<div></div>'
export const VEGA_LITE_COMPONENT_NAME = 'vega-lite'
export const DEFAULT_DATA_SOURCE_NAME = 'source_0'
export const SIGNAL_EVENT_PREFIX = 'signal'
export const VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v2.6.0.json'
export const EVENTS_TO_DELEGATE = [
'keydown',
'keypress',
'keyup',
'dragenter',
'dragleave',
'dragover',
'mousedown',
'mouseup',
'mousemove',
'mouseout',
export default async function(scaleFactor) {
const r = await renderHeadless(this, RenderType.SVG, scaleFactor);
return r.svg();
}
export default function(scaleFactor) {
return renderHeadless(this, RenderType.SVG, scaleFactor)
.then(function(renderer) { return renderer.svg(); });
}