How to use the vega.isString function in vega

To help you get started, we’ve selected a few vega 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 / lyra / src / js / ctrl / export.ts View on Github external
function clean(spec, internal: boolean) {
  let cleanKey;
  for (const [key, prop] of Object.entries(spec)) {
    cleanKey = key.startsWith('_');
    cleanKey = cleanKey || prop === null || prop === undefined || (prop as any)._disabled;
    if (cleanKey) {
      delete spec[key];
    } else if (key === 'name' && isString(prop)) {
      spec[key] = name(prop);
    } else if (isObject(prop)) {
      if ((prop as any).signal && !internal) {
        // Render signals to their value
        spec[key] = signalLookup((prop as any).signal);
      } else {
        // Recurse
        spec[key] = clean(spec[key], internal);
      }
    }
  }

  return spec;
}
github vega / vega-embed / src / index.ts View on Github external
const wrapper: Wrapper = (...args: any[]): any => {
  if (args.length > 1 && ((isString(args[0]) && !isURL(args[0])) || isElement(args[0]) || args.length === 3)) {
    return embed(args[0], args[1], args[2]);
  }

  return container(args[0], args[1]);
};