How to use the vega-scenegraph.RenderType.SVG function in vega-scenegraph

To help you get started, we’ve selected a few vega-scenegraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vega / vega / packages / vega-view / src / render-to-image-url.js View on Github external
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');
}
github vega / vega / packages / vega-view / src / render-to-image-url.js View on Github external
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');
}
github nesterone / vue-vega / src / constants.js View on Github external
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',
github vega / vega / packages / vega-view / src / render-to-svg.js View on Github external
export default async function(scaleFactor) {
  const r = await renderHeadless(this, RenderType.SVG, scaleFactor);
  return r.svg();
}
github vega / vega-view / src / render-to-svg.js View on Github external
export default function(scaleFactor) {
  return renderHeadless(this, RenderType.SVG, scaleFactor)
    .then(function(renderer) { return renderer.svg(); });
}